Video editing in Linux, it *is* possible
This article brought to you by LWN subscribersVideo editing is probably one of the last areas where Linux is still lagging behind proprietary operating systems. I have used Linux almost exclusively for the last few years, except for video editing where I still use Windows. That is about to change.Subscribers to LWN.net made this article — and everything that surrounds it — possible. If you appreciate our content, please buy a subscription and make the next set of articles possible.
My goal was to build a video box that would let me grab video from my digital video (DV) camera, edit scenes with features such as transitions, and create full featured DVD recordings. My hardware is very low end for this kind of task and it has proven to be extremely slow under Microsoft Windows. The test machine featured a 1.3GHz AMD Duron processor, 512 MB of RAM, a 4X single layer DVD burner and a Pinnacle firewire video capture card. Due to my low-end hardware, I decided to install the Slackware 11 distribution. Slackware is known for good performance on limited hardware.
Capturing Video
The initial requirement for a video editing system is the ability to capture the video data. Two choices were available: Kino and dvgrab. Kino is easy to use and even allows you to control your DV camera from a nice GUI interface. Kino requires some GNOME libraries, but Slackware does not provide them out of the box.I chose to use dvgrab for video capture, it operates with a very simple to use command line interface. For installation of dvgrab on Slackware, you will need to install the following packages (available here): libiec61883, libraw1394, libavc1394, libdv, libsamplerate and dvgrab. Once installed, dvgrab complained about the lack of the IEE1394 interface, /dev/raw1394. Fixing that problem involved creating two device nodes:
mknod /dev/raw1394 c 171 0
mknod /dev/video1394 c 172 0
Finally, due to a permission issue, I opted to use the root account for capturing video with the following command:
dvgrab video_file_name
The ownership of the resulting video file was then changed to my regular user for further processing.
Video Editing
The next step, and the most complex one, is video editing. The only effective video editor that I found was Cinelerra CV (community version). Until recently, Cinelerra was very unstable software and was not an attractive solution. You had to save very often because of the high risk of crashing. With the latest release, I experienced absolutely no crashes, and I performed some very wacky editing tricks with the software.The installation process for Cinelerra CV is not trivial if you decide to compile the source yourself. Luckily, the latest version and its dependencies are available for Slackware 11. Selected packages include: faac, faad2, fftw, jack, lame, liba52, libdv, libquicktime, libsndfile, libx264, mjpegtools, openexr and cinelerra.
The Cinelerra interface can be rough at first, but after a few hours of editing you will discover that it is rather usable. Basically, you just import the videos obtained through dvgrab, create clips from the video files, drag the desired clips to the various tracks, insert transitions, apply effects, and finally render your work.
The Cinelerra wiki offers a clear explanation on how to use the various components of the software. You can do tasks such as compositing various video tracks and using multiple audio tracks for dialogs, music, narration and more. Unlike various commercial video editing solutions on the Windows platform, it is not necessary to pay fees for incremental features, such as using a second video track.
Rendering the video
Once you are satisfied with your work, it is time to render everything to a file format that will work with DVD players. Since this step is a tricky and frustrating one, I provided the various steps (also available in the Cinelerra CV wiki) that you need to perform to reach success:- Create a script ~/cine_render.sh with the following two lines:
#/bin/bash mpeg2enc -v 0 -K tmpgenc -r 32 -4 1 -2 1 -D 10 -E 10 \ -g 15 -G 15 -q 6 -b 9400 -f 8 -o $1 - Add execute permissions to the script:
chmod +x ~/cine_render.sh - Open Cinelerra, and select the part of the video you want to render
with the [ and ] points.
- In Cinelerra, press Shift+R to bring up the render menu.
- Select the "YUV4MPEG Stream" file format.
- Deselect "Render audio tracks" and select "Render video tracks".
- Click on the wrench that shows up near the word Video.
- In the newly opened window, indicate the name of the m2v file that
you want to create. The m2v file will contain only the video.
- Click on "Use pipe" and enter the path of the previously created script:
/home/[your username]/cine_render.sh % - Click OK to close the second window, and OK again to render your m2v file.
- After the m2v file has been rendered, open the rendering window again
and render an ac3 audio file, choose the 224 kbit/sec sampling rate.
- Finally, combine the audio and video tracks with this command:
mplex -f 8 your_video_file.m2v your_audio_file.ac3 \ -o video_audio_file.mpeg
The resulting mpeg file should be compatible with commercial DVD players.
Creating a DVD
You now have the data to create a DVD. Several tools are available for this task, but ManDVD stands out as being very easy to use and full of features. To use this application, you will need to install the following Slackware packages: mplayer, ffmpeg, transcode, libdvdread, dvdauthor, dvd-slideshow and mandvd.ManDVD allows you to write DVDs. It featuring animated menus and can be operated without touching the command line. ManDVD can burn the final product directly, or it can use K3b for this task. In my case, K3b failed to create a working DVD, so I recommend burning directly from ManDVD.
Afterthoughts
Two new gstreamer-based video editing solutions are being developed at the moment, diva and PiTiVi. These two projects will eventually provide simple out of the box solutions for the various steps involved in movie creation. PiTiVi will also introduce some exciting new features, such as post-processing of screencasts created with Istanbul and collaborative video editing via bittorrent. The Diva and PiTiVi projects are under heavy development and would benefit from the help of additional hackers.
Until those new alternatives become usable, you will need to rely on a combination of specialized tools to fulfill your video editing needs.
With a minimum of pain and time, it is now possible to
create professional looking home movies using an entirely free solution
running on the Linux platform.
| Index entries for this article | |
|---|---|
| GuestArticles | Bolduc, Carl |
Posted Nov 22, 2006 6:18 UTC (Wed)
by yodermk (guest, #3803)
[Link]
I spent some time playing with it last year and was quite impressed. I was, without too much difficulty, able to make the main screen pan across a high-res still photo, and in the corner a stamp-sized video from my mini-DV camera was *rotating*. Useful? I don't know, but it was cool!
This seems to be a good way to introduce people to Free Software. After all, AFAIK, it only runs on Linux, and not Windows. Linux killer app, anyone?
One might be tempted to wonder how many patents it steps on, however, especially considering all its media-rich dependencies.
Posted Nov 22, 2006 8:34 UTC (Wed)
by brwk (guest, #6849)
[Link] (2 responses)
Further, it seems your excuse for not at least trying it is based on the fact that it's not made easy for you to use on your obscure distribution. While I would never question your right to use an obscure and aged distribution, I do think it is irresponsible as a reviewer to use the lack of support for a distribution to discount one of the major, most useful and effective video editing packages from review.
Posted Nov 22, 2006 12:47 UTC (Wed)
by Robin.Hill (subscriber, #4385)
[Link]
Posted Nov 22, 2006 12:57 UTC (Wed)
by carlabi (guest, #34248)
[Link]
Since Cinelerra has no problem editing raw dv, dvgrab fits my needs perfectly. I also don't recommend rendering MPEG before the editing process is over, to avoid lost of quality in the final product. I think that the Cinelerra CV team are planning to integrate the script to simplify this task.
Finally, Slackware 11 is NOT an obscure and aged distribution.
Carl (DrCurl@gmail.com)
Posted Nov 22, 2006 8:35 UTC (Wed)
by eru (subscriber, #2753)
[Link]
Posted Nov 22, 2006 10:47 UTC (Wed)
by ber (subscriber, #2142)
[Link] (1 responses)
Posted Nov 24, 2006 11:28 UTC (Fri)
by MarcinKostur (guest, #41864)
[Link]
At this stage I would not consider it as working video editing
Also, i have never undestood how i am supposed to work with
But it might be leading once - it is almost platform independent!
the best
Marcin
Posted Nov 22, 2006 13:52 UTC (Wed)
by job (guest, #670)
[Link] (2 responses)
Posted Nov 23, 2006 23:31 UTC (Thu)
by man_ls (guest, #15091)
[Link]
On the other hand, Cinelerra does non-destructive editing: effects are just piled on top of your original clips, they can be removed at any time, their order changed... Like Ardour for audio, or Aperture for raster images (for Mac OS X; I don't know of any program for non-destructive raster edition on Linux, sorry). This makes a huge difference with more sophisticated projects.
Posted Nov 24, 2006 11:25 UTC (Fri)
by MarcinKostur (guest, #41864)
[Link]
Also kino is DV editor, and cinelerra in Video editor.
The best
Marcin
Posted Nov 24, 2006 0:19 UTC (Fri)
by pmdumuid (guest, #41849)
[Link]
mknod /dev/raw1394 c 171 0
shouldn't be needed (either by using udev, or making those node's automatically)
I'm not a slackware user, so don't care, but suggest you file a bug report..
Posted Nov 24, 2006 11:21 UTC (Fri)
by MarcinKostur (guest, #41864)
[Link]
Since 2 years I am a cinelerra user. I spent probably few hundred
Another interesting feature is that it is not limited to DV. You can
Bad thing about cinelerra is that it cannot run on win32.
Also I have is very funny observation in OS: there is quite a big
the best
Marcin
Posted Nov 24, 2006 15:10 UTC (Fri)
by flavioflavio (guest, #41868)
[Link] (1 responses)
A note to it is that HDV is still missing, blender being used as editing/post-editing software is still missing and liveS as post-editing software is also missing. In the near future, we'll also add a separate chainline for audio treatment/sync to be seen in parallell to all that. Hope it can be useful!
The link: http://estudiolivre.org/tiki-index.php?page=Produzindo+V%...
flavio
Posted Nov 27, 2006 12:46 UTC (Mon)
by carlabi (guest, #34248)
[Link]
I'm glad to see that others have found similar solution. Too bad I can't read Portuguese :(
Carl
Posted Nov 27, 2006 5:56 UTC (Mon)
by jgsack@san.rr.com (guest, #33287)
[Link] (2 responses)
Regards,
Posted Nov 27, 2006 12:51 UTC (Mon)
by carlabi (guest, #34248)
[Link] (1 responses)
No, correct me if I'm wrong but, it looks like a retouching tool and not a video editor?
An interesting project anyway :)
Carl
Posted Dec 3, 2006 7:58 UTC (Sun)
by csamuel (✭ supporter ✭, #2624)
[Link]
Cinelerra does seem to be under-appreciated and I'd love to see more discussion about it in the mainstream Linux press.Video editing in Linux, it *is* possible
I'm very surprised you didn't take a proper look at Kino. All the extensive scripts you give just to render the result into an MPEG file are built-in options in Kino and work very nicely. Also having used both dvgrab and kino, I'd have to say I consider Kino by far the more capable and usuable capture tool of the two, offering a decent GUI to all the capture operations.Video editing in Linux, it *is* possible
While I'd agree with the core of your argument, I must point out that Slackware 11 is neither obscure nor aged. While not as popular in the press as SuSE, Redhat, Mandriva, Ubuntu, et al, it has a long heritage and is still going strong, with Slackware 11 released just over a month ago.Video editing in Linux, it *is* possible
Kino is indeed a superb capturing tool. I would not say that it is the most useful and effective video editing packages. It doesn't come close from Cinelerra capabilities in this area.Video editing in Linux, it *is* possible
Thanks for the article! It hopefully will help with the problem I have been recently wondering about: over the past year I have shot hours of DV tape of our baby's first year, and I have been looking for Linux tools that help edit them into something that other relatives besides us doting parents can bear to watch without yawning too much...
Video editing in Linux, it *is* possible
Do people have experience with http://www.jahshaka.org/ ?Jahshaka?
I am still trying to make use of this application, Jahshaka?
the recent version can even run reasonably long between crashes ;-)
system.
this system. It is very bizzare.
Kino isn't just a video grabber. It is a full non-linear video editing system, much like Cinelerra, not as advanced but easier to use.Video editing in Linux, it *is* possible
Kino does destructive editing, much like Photoshop or Audacity. Your original clips are not modified, but any intermediate states are lost as you continue editing. This is a real nightmare for any advanced image processing tricks, compositing, etc.
Non destructive editing
Kino is missing a multitrack timeline. I was unable to Video editing in Linux, it *is* possible
do anything with kino because of that fact.
consequences are - kino is very fast, but cinelerra
can edit anything.
I have no opinion concerning Slackware being an old distro or not, but I do think that if they are still maintaining a bug report system, that the following:Slackware an old distribution
mknod /dev/video1394 c 172 0
Dear LWN,Video editing in Linux, it *is* possible ... also in HDV
hours working with this software, editing my amateur clips with
free flying.
Cinelerra does very good job in DV editing. Recently it started to
do "compositing" in OpenGL hardware, which i think is a killer feature.
It makes possible to have real time playback of real time effects.
Apart of few bugs/hacks - you have to know about (e.g. is the export
should be better one exactly as described in this article),
cinelerra runs perfectly.
edit arbitrary video with cinelerra. For example, since 1month i edit
only HDV (1080x1440) video. It requires a lot of CPU, but is is
possible.Thus this article should be called "HDV editing in linux
is possible for few years" ;-)
Proof of principle can be found on my homepage with all videos
i edited (one in HDV): marcin.glidingcontest.org
It is a pity, but since it is writetn in qt, perhaps somebody
could think about making a port.... Once. ;-)
Cinelerra delivers the capabilities of ?000$ commercial applications,
but requires some polishing and the increase of user spectrum could
possibly spur the development. (as in blender case).
the interest in 3d modelling software: blender has huge community,
It is much bigger than video editing community. Why is that so?
Hi there. Nice article - you might have reasons now to completely discard your proprietary softwares, since we've been doing here in brazil. We've been using only free software for all kinds of multimedia use and have been gathering a nice documentation here: estudiolivre.org. You'll see there is a video section there and, on the following link, a fluxogram that sums the whole video chainline (click on the image) of video production, from its most common sources, most common softwares and most common destinations. way more than video and 'possible' ;)
Hi!,way more than video and 'possible' ;)
Have you looked at CinePaint (previously called Film gimp)Video editing in Linux, it *is* possible
..jim
Hi,Video editing in Linux, it *is* possible
That's correct, it's for frame-by-frame retouching.Video editing in Linux, it *is* possible
