Linux.com

Feature

Become a digital video editing guru using Linux tools

By Alex Roitman on March 16, 2007 (7:00:00 AM)

Share    Print    Comments   

Shooting, editing, and producing video clips has been my passion for about 10 years. As a free software adept, I always tried to perform this process on Linux. This year I have finally found a set of tools that work for me. This article provides a brief tutorial on home video production.

The process consists of several steps. First, you transfer the video source material to your Linux machine (video grabbing). Next, you edit the video, possibly mixing it with other video and audio material, and then render it into an output video file. If your goal is to upload a file to the Web or share it with your computer-savvy friends, then this is the end. Sometimes, however, you want to create a DVD suitable for conventional DVD players. In those cases the final step is authoring the DVD.

Grabbing the video

Grabbing used to be a problem during the era of analog camcorders. If you are stuck with one of those, you may need to get a special card that can take analog video and digitize it. I'll assume that you have a regular DV camera supporting the IEEE-1394 (a.k.a. FireWire) standard. Such camcorders take care of digitizing video (and audio) and giving it to you in the raw DV format.

I have had luck using both Kino and dvgrab (developed by the same project) to download video over FireWire. I prefer dvgrab as it CLI-based. The following command starts the capturing, requesting the raw DV format (no compression), auto-splitting on changing scene or reaching the size limit, limiting the file size to 100MB, and using "source_" as the prefix of the captured files.

   # dvgrab --format raw --autosplit --size 100 source_

The files will be named source_001.dv, source_002.dv, and so on. Read the dvgrab(1) man page to learn more. If you have problems, consult the Capturing DV section of the Kino User Guide.

Approaching video editing

Once you have all your source files sitting in the capture folder, what's next? I use Cinelerra to edit the video material. It is not the most intuitive application to learn, but once you master it it will do wonders. The project provides detailed installation instructions for different distros, and excellent documentation. For a Debian user like me, installation is simple: I add the correct Cinelerra repository for my CPU, along with the Debian Multimedia repository, to my /etc/apt/sources.list file, then update and install Cinelerra.

Here is what I do. First, I start Cinelerra and create a new project ("New..." under File menu). I select the desired parameters (NTSC, but your mileage may vary) and then save this so-far empty project to a file. All your editing will be saved in this file, and none of the original source files will be modified (unless you specifically ask them to be). Cinelerra has crashed on me, but I've never had Cinelerra refuse to open the file afterward. Save your work frequently, and you will never lose much after a rare crash.

Next, I load all my source files for the project. In the load dialog, I select all the source files and set the "Create new resources only" option for the Insertion strategy. This will populate the Media section of the Resources window with the icons of your source files. Cinelerra will take some time to index the source files; wait until the status bar shows that this is done. If you plan to mix some additional audio into your project, load those files as well. They should show up as audio icons in your Resources window.

Combining the pieces

image1
Click to enlarge.

Now you should be ready to start editing. The Viewer window is helpful for previewing the sources and deciding what to take. You can either drag a source file from the Resources window onto the Viewer window, or you can right-click on the source and select View from the context menu. The Viewer window has controls that allow you to play, rewind, and so on. Once you decide what are good start and stop points (a.k.a. in and out points), mark them with "[" and "]" buttons, or use keyboard shortcuts with the square brackets. If you press "v" or click the Splice button in the Viewer window now, the portion between in and out points will appear at the insertion point in the Program window, which is probably the most important window in Cinelerra.

Cinelerra offers two main editing modes: drag-and-drop and cut-and-paste (the default). To enter drag-and-drop mode, click the arrow icon on the toolbar. To get back to cut-and-paste mode, click the cursor icon on the toolbar. In cut-and-paste mode, clicking on the time bar will set the insertion point to where you clicked. The insertion point is visualized by a large blinking cursor running across all tracks, perpendicular to the timeline. When you start a new project, the timeline is empty and the insertion point is at zero. If you do not move it manually, every splice operation from the Viewer window will insert the clip and move the insertion point to the end of that clip. You may want to repeat the sequence without explicitly moving the insertion point: view the source, mark in and out points, and splice. Once you have done it a few times you should see your inserted clips on the timeline.

You can press the Home key to reposition the insertion point to the beginning of the timeline. Press the space bar and you should see the preview of your project in the Compositor window. Don't worry if the playback quality is suboptimal. This preview is assembled on the fly and the eventual output should have much better quality than the preview. As you watch the preview, you may realize that some clips did not have their in/out points set just right. You can adjust that in the timeline by dragging the edges of each fragment.

The Interface tab of the Configuration dialog allows you to set different editing options on different mouse buttons. By default, using the first mouse button (left for the right-handed mouse) will move the in/out point inside the clip and adjust all the subsequent edits accordingly. So if your first fragment runs a bit too long, you point your mouse on it and then approach its right edge from the left. Once you see the pointer change its shape to become a handle, you press the mouse button and drag the mouse a bit to the left. The fragment should become shorter, and all next fragments should shift leftward so that there is no gap. If you see that the second fragment's in point is too late in its source and you want to show a bit more of the immediately preceding video, approach the beginning of the fragment from the right. Once the pointer changed into the handle, drag it leftward. The fragment should become longer, without changing its starting place on the time line. All subsequent fragments should shift rightward accordingly. Once you practice with different types of such editing it becomes very easy.

Tracks, transitions and effects

A newly created NTSC project has one video and two audio tracks. You can add any number of audio and video tracks to it. Tracks can be armed or disarmed, which determines whether the track is affected by your editing operations. If you have two video tracks and only one of them is armed, any pasting or splicing will take effect only in the armed track. To change the armed status, click on the red dot icon in the control area (patch-bay) of the track.

image2
Click to enlarge.

Separate from arming is the play track property. Tracks without the play status will not appear in the rendered output. Tracks with the play status will all be overlayed during preview and rendering. You can adjust how this is done separately for audio and video tracks. Video tracks behave like layers in the GIMP: the top is seen first, unless it is completely transparent, and so on.

You can insert transitions between your clips by dragging them from the Video Transitions section of the Resources window onto the border between clips. In Cinelerra, the transition starts at the end of the first clip and continues into the second clip. Keeping this in mind, you would probably want to allow for at least one extra second when selecting the out point in each clip. You can adjust the parameters of the transition by right-clicking on the brown transition icon and selecting from the context menu. The most common transition is the Dissolve, whose single parameter is the length.

Finally, you can add effects to your video and audio. Video effects can modify your material or add to it. A good example of an additive effect is a title. To add titles, double-click on the portion of your track that you want to add titles to, or select the desired time portion by clicking, dragging, and releasing the mouse button in the program window. Next, drag the Title icon from the Video Effects section of the Resources window onto your selection. Then click on the magnifying glass on the brown effect icon to set the parameters.

Rendering the result

Once you are happy with your project and its preview, you can get your results rendered into a single output file by using the "Render..." item under the File menu. Depending on your end goal, you may select different parameters. For making an MPEG file for subsequent DVD authoring, I recommend following this recipe. However, if all you want is the video file for watching on the computer, you may render both video and audio into the same file using Ogg Theora, QuickTime for Linux, or Microsoft AVI. Click on the wrench icon to adjust the parameters for both video and audio components. Rendering will take a while; watch the status bar to know when it is done.

video3
Click to watch.

Authoring DVD

If you want to send your video to someone with a slow computer or low-bandwidth network connection, you can send a full-blown DVD. I use DVDStyler for authoring DVDs, which in turn uses dvdauthor. With DVDStyler you get to set up the titles, menus, and buttons for your DVD in a visual way. The result is saved into an XML file, so you can open and change it later. For details, see the project's operation manual.

I usually use DVDStyler to produce the image of a final DVD. I then use the growisofs program from the dvd+rw-tools package to burn it on the actual disk, as many times as I need it:

   # growisofs -dvd-compat -speed=2 -Z /dev/hdc=result.iso

I tend to be on the conservative side and use 2x speed, just in case my recipient's player is not top-notch and might have trouble playing a disk burned at higher speed. You may need to substitute your actual DVD writer device in place of /dev/hdc and use the real filename of the DVD image.

Summary

The whole process is not quick, and the software puts heavy demands on the CPU, RAM, and disk space. However, none of these problems is specific to Linux.

As far as convenience goes, Linux may present a sharper learning curve, but this learning curve is worth the trouble. Once you find your way around all the steps, you will feel comfortable using the whole chain. The stability and predictability of the free software, as well as the active community of users and developers, is a huge asset.

Alex Roitman is a free software enthusiast and the member of the GRAMPS development team. He has been involved with the GRAMPS project since 2002.

Alex Roitman is a free software enthusiast and the member of the GRAMPS development team. He has been involved with the GRAMPS project since 2002.

Share    Print    Comments   

Comments

on Become a digital video editing guru using Linux tools

Note: Comments are owned by the poster. We are not responsible for their content.

Re:Complimentary piece

Posted by: roblimo on March 18, 2007 09:08 PM
Our video editing objectives and styles are very different. I edited this one in about 20 minutes, including a loop in the music track and blending natural sound in and out: <a href="http://www.roblimo.com/node/200" title="roblimo.com">Stick Out Your Can</a roblimo.com>.

I use this video as a fair comparison because it, like yours, was shot "on the fly" (and in my case on the spur of the moment) with a hand-held camera, and has simple, static titling.

Some of what I do is much more involved. Mixing multiple sound tracks takes time. Ditto creating animated titles. And remember, clarity of rendered output is important, too, and is an area where Cinelerra -- at least for me -- consistently falls short compared to the professional-quality video tools I use, although it is about as good as most consumer video editing programs. We won't even talk about chroma-key and other compositing tasks. That's a whole separate reality. Let's not go there.<nobr> <wbr></nobr>:)

Note that I happily use open source software for everything I do aside from video, including The GIMP for graphics work and OpenOffice.org for all my document-handling, spreadsheets, and slide presentations.

You and I have different video production objectives. Cinelerra is fine for what you do, but needs a *lot* of work (and not just on the interface) to do what I need.

- Robin

#

Re:Complimentary piece

Posted by: Administrator on March 19, 2007 07:15 AM
I agree that we have different goals. My article was mainly about the amateur home editing, I never sought to give professional advice<nobr> <wbr></nobr>:-)

The funny thing is, my article submission did not have a guru word, it was added by the editor. All I wanted to say is that it's possible and quite easy to edit your home videos on Linux. Something like this was not possible or exceedingly hard just a few years ago.

#

Deinterlacing the material would help

Posted by: Anonymous Coward on March 17, 2007 02:09 AM
Hi,
I have only seen the start of your result and it looks like deinterlacing would help a lot here. Although you shouldn't deinterlace for DVDs, it looks much better when the result for the Internet or other computer related demonstration is properly deinterlaced.

By the way, thank you for proving that Linux is a usable environment for multimedia as there were several articles on how useless Linux is for video editing.

#

Re:Deinterlacing the material would help

Posted by: Administrator on March 17, 2007 01:50 PM
It shows up fine on my monitors. I have started the project using true NTSC values, but then switched into half-NTSC (half-size, no interlacing). So as far as I understand de-interlasing the sources would not help, would it?

I am still an amateur, so if you can enlighten me please do<nobr> <wbr></nobr>:-)

#

Summer of Code

Posted by: Anonymous Coward on March 17, 2007 05:04 AM
Would be cool if some open source Linux video editing software got improved in the upcoming Summer of Code event held by Google.

Or if some company ports some famous full-fledged professional video editing software to Linux.

#

Re:Summer of Code

Posted by: Anonymous Coward on March 18, 2007 04:30 AM
Hey, great article. I never really got into video editing when using Windows, but I needed to do some video editing for work, so I downloaded Cinerella and found it to be really easy to use.

I totally agree with this comment, I think a term in the SOC would be great for these video editing packages.

#

Re:Summer of Code

Posted by: Anonymous Coward on March 22, 2007 08:56 AM
Hi, I am the main developer of LiVES (<a href="http://lives.sourceforge.net./" title="lives.sourceforge.net">http://lives.sourceforge.net./</a lives.sourceforge.net> I have already asked Google about this, and they told me their summer of code program is only available for students. So those of us developers who are actually trying to make a living from FOSS are left out. It doesn't seem very fair to me, but there you go.

- Salsaman.

#

Complimentary piece

Posted by: Anonymous Coward on March 17, 2007 04:57 PM
Hi Alex + co!

This article is a good compliment to the video editing article I wrote not too long ago entitled 'Easy video creation using entirely FOSS tools'

<a href="http://applications.linux.com/article.pl?sid=06/11/13/2129256&tid=39" title="linux.com">http://applications.linux.com/article.pl?sid=06/1<nobr>1<wbr></nobr> /13/2129256&tid=39</a linux.com>

This article above is more like a mini-guide to Cinelerra whereas mine (linked) covered a few more tasks such as how to capture analogue video under Linux and how to get video off the web and DVDs.

#

Re:Complimentary piece

Posted by: Administrator on March 17, 2007 05:22 PM

Yes, mine focused primarily on Cinelerra. I have found the editing per se the hardest part of the chain. More than once in the past, I tried Cinelerra and just could not get used to the UI. It took me some serious doc reading to really understand the details of trimming. After that everything else is downhill<nobr> <wbr></nobr>:-)



Ironically, when I submitted the article, Robin 'Roblimo' Miller told me that he tried Cinelerra and it is a pain. It took me about 10 minutes to make the 40 sec example video, so I hope to have proven my point that it is not.

#

Cinelerra is awesome, but...

Posted by: Anonymous Coward on March 17, 2007 06:08 PM
Just wanted to point out that with Cinelerra it is a good idea to save after _every_ step since it crashes a lot (it does do well on recovery though, it is really quick), especially on 32 bit machines.

Cinelerra is very powerful, but with its high demand on resources it might not be usable for someone with a little older computer. It would be nice to have a less demanding solution for Linux.

To sum up: It would be nice to have a more intuitive, less demanding and especially more stable consumer video editing software for Linux, but for the time being Cinelerra will probably do the job for those who really need a video editing solution for Linux.

#

Re:Cinelerra is awesome, but...

Posted by: Administrator on March 17, 2007 09:10 PM
How's video editing suitable for someone with slow hardware with any software? I don't think Cinelerra is particularly slow for what it does. Just let it index all the sources you are loading and then it's fast enough.

The rendering is indeed slow (depending on the format), but this again has almost nothing to do with the application or the OS, does it?

#

Re(1):Cinelerra is awesome, but...

Posted by: Anonymous [ip: 75.74.157.22] on September 04, 2007 08:17 PM
What would you consider a good hardware configuration for video editing in Linux?

#

Re:Deinterlacing the material would help

Posted by: Anonymous Coward on March 18, 2007 04:15 PM
Hi,

you should add deinterlace filter before downsizing. This is the way to do it and that's why you got "mouse teeth" effect where the movement occurs. It is obviously seen (at least for me<nobr> <wbr></nobr>:). You can read more about the joy of deinterlacing at <a href="http://www.100fps.com/" title="100fps.com">http://www.100fps.com/</a 100fps.com>

Hope I have helped you.

#

Re:Deinterlacing the material would help

Posted by: Administrator on March 18, 2007 05:09 PM
Yes, a very informative site, thanks!

I had a misconception that the digital camcorders do the same interlacing as the analog ones, and that each frame just has half the lines. Now that I read that site it all makes sense! BTW, Cinelerra has quite a selection of deinterlacing options.

Once we are at it, could you also enlighten me how e.g. NTSC has size of 720x480 and yet it shows 640x480 on a normal 3:4 TV? The media players call the normal 4:3 NTSC files as "720x480 with 4:3 aspect ratio" which sounds strange to me<nobr> <wbr></nobr>:-)

#

And GNU/Linux just keeps getting better!

Posted by: Anonymous Coward on March 19, 2007 10:39 AM
For those who think that GNU/Linux isn't ready for film editing, you'd better check out Disney's animation labs. I saw one; it was all GNU/Linux and KDE. What apps they were running, I couldn't tell. But if GNU/Linux is good enough for an outfit like Disney, obviously it's good enough for us.<nobr> <wbr></nobr>:-)

lker@cmosnetworks.com

#

Re:And GNU/Linux just keeps getting better!

Posted by: Anonymous Coward on March 19, 2007 01:32 PM
I believe that they are using something like Maya, the open source equivalent of which is Blender. The goal of these programs and Cinelerra are very different. You may want to check the following movie, which was made with Blender: <a href="http://orange.blender.org/press" title="blender.org">http://orange.blender.org/press</a blender.org>

On the following site you can download a series showing how Hollywood uses Linux: <a href="http://www.go-opensource.org/go_open/news/download_go_open/" title="go-opensource.org">http://www.go-opensource.org/go_open/news/downloa<nobr>d<wbr></nobr> _go_open/</a go-opensource.org>
(check Episode 1, if I am not mistaken)

Unfortunately, I think video editing with Linux has a long way to go...

#

Re:And GNU/Linux just keeps getting better!

Posted by: Anonymous Coward on April 19, 2007 03:01 AM
Studio Users

Studios such as Sony Pictures Imageworks and many smaller studios use CinePaint. Disney, DreamWorks, and Pixar funded Crossover (Wine) to make Adobe Photoshop for Windows run nicely on Linux and that's what they use. Some studios use proprietary or internally developed tools. CinePaint is open source software. Nobody is obligated to tell us they use it. Studios use many Linux motion picture applications, not just CinePaint. This list of studios using CinePaint is just some we know about.

* Amalgamated Pixels
Elf, Looney Tunes
* Computer Cafe
League of Extraordinary Gentlemen
* Flash Film Works
Duplex, The Last Samurai
* Hammerhead
Showtime, Blue Crush, 2 Fast, 2 Furious
* Rhythm & Hues
Harry Potter, Cats & Dogs, Dr. Dolittle 2, Little Nicky, Grinch, Sixth Day, Stuart Little, Planet of the Apes
* Sony Pictures Imageworks
Stuart Little II, Spider-Man

What's Special about CinePaint?

CinePaint is fundamentally different from other painting tools because it handles high fidelity image formats such as Kodak Cineon, SMPTE DPX, and ILM-NVIDIA OpenEXR. To do that properly requires a 32-bit per channel color engine core so that data isn't crushed into 8-bit color channels. The CinePaint core is 8-bit, 16-bit, and 32-bit as needed. It's different from GraphicsMagick which also supports different color depths but only as a compile-time switch. (GraphicsMagick has better support for film industry file formats than ImageMagick.)

Ref: "http://cinepaint.org/

#

Re:Edit without transcoding?

Posted by: Anonymous Coward on March 20, 2007 03:32 AM
MythTV does this when splitting commercials from the stream. I would like to see this functionality in a separate program, as it has worked VERY well for the 150+ shows I have done in the past couple months.

#

Re:Edit without transcoding?

Posted by: Anonymous Coward on March 20, 2007 11:11 PM
Editing without transcoding is useful when your source and target formats are the same (editing down an existing video, such as cutting commercials out), but not so useful if you do a lot of effects or transitions (color correction, sharpening, deinterlacing, wipes, fades), or your target format differs from your source format (input is DV from a camcorder, and target is MPEG for a DVD). While it would be a nice feature to have, it is difficult/annoying to implement, especially if the start and end of the data blocks and the frames don't match up.

Cheers!

#

translation

Posted by: Anonymous Coward on March 21, 2007 07:46 AM
I translate this document in italian, is it possible to post the translation on my blog to share it with other italian video developer?
You can find my blog at <a href="http://xenos.altervista.org/blogs/" title="altervista.org">http://xenos.altervista.org/blogs/</a altervista.org>

#

Re:translation

Posted by: Anonymous Coward on March 22, 2007 06:33 AM
unfortunatly I can't find any suggestion in the about page or on this site in what to do for this case, soon I'll publish my translation i think<nobr> <wbr></nobr>..

furester

#

Re:translation

Posted by: Administrator on March 22, 2007 09:55 PM
I have no problem with publishing your translation, as long as you give credit. Check with the editors@ostg.com whether they allow it.

#

Re:Deinterlacing the material would help

Posted by: Anonymous Coward on March 22, 2007 01:37 AM
I think it is caused by the deviations of the receivers and displays. You can read about that more at <a href="http://en.wikipedia.org/wiki/Overscan" title="wikipedia.org">http://en.wikipedia.org/wiki/Overscan</a wikipedia.org>.

Moreover, you can easily see that safe area using this tool: <a href="http://cvs.cinelerra.org/docs/wiki/doku.php?id=english_manual:cinelerra_cv_en_7#safe_regions_tool" title="cinelerra.org">http://cvs.cinelerra.org/docs/wiki/doku.php?id=en<nobr>g<wbr></nobr> lish_manual:cinelerra_cv_en_7#safe_regions_tool</a cinelerra.org>. This way one can almost certainly be sure that the titles will not be cut off.

#

Re:Deinterlacing the material would help

Posted by: Anonymous Coward on March 22, 2007 02:23 AM
Read up on Pixel Aspect Ratio: <a href="http://lipas.uwasa.fi/~f76998/video/conversion/" title="uwasa.fi">http://lipas.uwasa.fi/~f76998/video/conversion/</a uwasa.fi>

#

Why no mention of LiVES ?

Posted by: Anonymous Coward on March 22, 2007 08:58 AM
You wrote an article about Linux video editing, but no mention of LiVES (<a href="http://lives.sourceforge.net./" title="lives.sourceforge.net">http://lives.sourceforge.net./</a lives.sourceforge.net>

- Salsaman.

#

Re:Why no mention of LiVES ?

Posted by: Administrator on March 22, 2007 09:51 PM
Because I've never managed to use it without problems. I wrote about the tools that I use, and LiVES is not one of them.

#

Re:translation

Posted by: Anonymous Coward on March 23, 2007 12:38 AM
Thanks, I'll wait for an answer from the editors then<nobr> <wbr></nobr>.. In the meantime I add some infos for Archlinux users near your infos for Debian based distros users<nobr> <wbr></nobr>..

#

Re:Why no mention of LiVES ?

Posted by: Anonymous Coward on March 27, 2007 11:22 AM
If you have problems with it then there are plenty of options. You could email me personally (my email is on the site), or you could send a message to the mailing list, or you could submit a bug report on sourceforge. I am always happy to help, but I can't help you if I don't know what your problems are.

-- Salsaman.
<a href="http://lives.sourceforge.net/" title="sourceforge.net">http://lives.sourceforge.net/</a sourceforge.net>

#

Edit without transcoding?

Posted by: Administrator on March 17, 2007 12:00 PM
One of my few holdovers from Windows is a great little program, Womble MPEG2VCR (<a href="http://womble.com/products/vcr.html" title="womble.com">http://womble.com/products/vcr.html</a womble.com>). It's not a full-featured editor like Cinelerra, but it does one thing very well---it edits with minimal transcoding. Consider an MPEG stream---many pictures each followed by a number of changes to those pictures. Theoretically, a cut from the stream only needs to re-encode the changes immediately preceding and following it, with no loss of quality of the rest of the stream. That's something that MPEG2VCR can do. Because there's so little transcoding involved, it's quite fast. I'd love to find something for Linux with this capability---does anyone have any ideas?

#

Become a digital video editing guru using Linux tools

Posted by: Anonymous [ip: 59.184.137.16] on September 24, 2007 08:27 AM
I am new to linux & was wondering if Cinelerra is compatible with mandriva 2007 linux? If yes then how to download the same.
I have tried various windows video editing softwares but all of them are resource hungry and consume a lot of time rendering.
I wish to try out video editing in linux.
Please advice.

#

compatibility with mandriva 2007?

Posted by: Anonymous [ip: 59.184.137.16] on September 24, 2007 08:29 AM
I am new to linux & was wondering if Cinelerra is compatible with mandriva 2007 linux? If yes then how to download the same. I have tried various windows video editing softwares but all of them are resource hungry and consume a lot of time rendering. I wish to try out video editing in linux. Please advice.

#

Become a digital video editing guru using Linux tools

Posted by: Anonymous [ip: 216.239.89.26] on February 06, 2008 12:29 AM
Helpful article, except I'm stuck on step 1. My video camera (Hitachi) records in vro format on its hard drive. Kino doesn't know what to do with this. Thus I can't import the video to do the editing.

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya