Command line media editing
- 2007-02-05
-
Write a full post in response to this!
This last week I’ve been trying my hand at a bit of DVD authoring and I thought I’d pass on everything that I’ve found out! A couple of the most useful tools are command line based, hence the title, but I’m also going to talk about a fantastic GUI that brings these bits and pieces together. To my horror, just as I sat down to write this I discovered Mitch Meyran had just posted a very similar blog entry! This post, however, is a bit more command line based and HOWTO-like in structure.
I think the tool I’ve found to be most useful so far is ffmpeg. If you install this package through your package manager and then run it with no options in a terminal, you’ll see just how flexible it is as your screen fills up with line after line of options! Don’t let this overwhelm you though, I’ve been using it to convert one file format to another and stream recording and have found I needed to know very few options. Imagine you have an MPG file you want converted to an OGG:
ffmpeg -i /path/to/yourinputfile.mpg -sameq /path/to/youroutputfile.ogg
The -i option always has to come before your input file; the output file, however, does not require any options. In this example, I used the -sameq output option, which forces the output to be of the same quality of the input.
Another input option I’ve found to be very useful is -ss which takes a time argument in the form of hh:mm:ss. It forces the encoding to start from a specific point in the video (or audio) file (it’s useful for clipping of the beginning of some files). The other output option I’ve found very useful is -r which lets you change the frames per second of the encoding – for PAL televisions use 25 and for NTSC use 29 (I believe these numbers are correct).
Sox and soxmix are very similar to ffmpeg: the difference is that they deal specifically with audio files. Sox can be used for converting one audio type to another, or it can also be used for concatenating two audio files together; soxmix can be used for mixing two audio files together to form one. I didn’t actually use soxmix in this current project, but I have used it in my podcast for mixing the two sides of the conversations into one file. To achieve this you simply use the following command:
soxmix /path/to/input1 /path/to/input2 /path/to/output
There are a lot of options that can be applied here; for example reduce the volume of one of the files as it is mixed in with the other, but that is the subject of another post… Sox has very similar syntax to Soxmix. However, when you give sox two input files they will not be mixed, but concatenated. To convert one audio type to another with sox you can use a command similar to this:
sox /path/to/input.mp3 /path/to/output.ogg
Next up on the command line is DVD-Slideshow. Used in conjunction with dir2slideshow you can create photo slideshows that will play back on any DVD player. Start of by using dir2slideshow to produce an input file for DVD-Slideshow:
dir2slideshow -n 'name goes here' -t 5 /path/to/photo/folder
The -n option gives the slideshow a name and the -t option sets how many seconds each picture should be displayed for. This produces an output file name.txt; we then use the following command to have DVD-Sideshow format our pictures for a DVD player:
dvd-slideshow -n 'name goes here' -f name.txt -a 'any background music file here'
The -f option lets us specify the file we created with dir2slideshow and the -a option lets you specify some kind of background music to have playing while you watch your photos. If you’d like more information on DVD-slideshow their website is a great wiki and has brilliant documentation. I think that’s everything I want to talk about from the command line! My apologies for the simplistic examples, I can only hope they’ll prove useful to some people…
Earlier, I mentioned GUI programs. If you’re wanting to produce a DVD I haven’t managed to find anything better, or more straight-forward, than ManDVD. It doesn’t accept all file formats as input and its own editing abilities are limited – which is why all the command line tools are useful – but it is a great program for producing menus, has a good graphical front end for DVD-Slideshow. It will create all the VOB files for you and also an ISO which you can burn to as many discs as you like. It’s a KDE app but it’s running brilliantly on my Fedora Core 6 Gnome desktop so I don’t think that is an issue for anyone. The only problem I can think is that I haven’t seen it in any repository, but the dependencies are clearly presented on the site and easy to find. To run it, you simply extract the tarball and either double click the executable or run ./mandvd from the command line. Saying all that, I will soon have to take a look at Mitch’s post about video editing that I mentioned, maybe some of those applications will prove useful to me as well.
Write a full post in response to this!
Similar articles
Do you like this post?
Vote for it!
Copyright information
This entry is (C) Copyright by its author, 2004-2008. Unless a different license is specified in the entry's body, the following license applies: "Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved and appropriate attribution information (author, original site, original URL) is included".
Biography
Jonathan Roberts: Currently a gap year student! I have a huge interest in Free Software which seems to keep growing. I run the Questions Please... podcast which can be found at questionsplease.org. On an unrelated note I'm reading theology at Exeter next year.
- Jonathan Roberts's posts
- Login or register to post comments
- 7316 reads
- Printer friendly version (unavailable!)




Best voted contents
-
Google App Engine: Is it evil?
Terry Hancock, 2008-04-24 -
The Bizarre Cathedral - 3
Ryan Cartwright, 2008-05-05 -
Free Software Magazine Awards 2008
Tony Mobily, 2008-04-22 -
The Bizarre Cathedral - 2
Ryan Cartwright, 2008-04-27
Similar entries
Buzz authors
All news
From the FSM staff...
- The Top 10 Everything (Dave). The good, the bad and the ugly.
- Free Software news (Dave & Bridget). A site about short stories and writing.
- Book Reviews: Illiterarty (Bridget). Book reviews, blogs, and short stories.
Hot topics - last 60 days
-
Installing an all-in-one printer device in Debian
Ryan Cartwright, 2008-05-05 -
What is the free software community?
Tony Mobily, 2008-03-29 -
Things you miss with GNU/Linux
Ryan Cartwright, 2008-05-01 -
Why Microsoft should not lose (and free software will still win)
Ryan Cartwright, 2008-04-21 -
Beyond Synaptic - using apt for better package management
Ryan Cartwright, 2008-04-03
Dedicated server
NTSC frame rate
Submitted by Anonymous visitor on Thu, 2007-02-08 22:51.
Vote!Yes, ffmpeg is a pretty useful tool. Just a note, the -r value for NTSC is 29.97, not 29.
Is Soxmix packaged with Sox?
Submitted by Anonymous visitor on Thu, 2007-03-15 07:31.
Vote!I downloaded Sox from sourceforge, configured and made it, but it doesn't seem to include soxmix.
Is there a special configuration flag that needs to be set in order to enable soxmix?
I'm trying to find a command-line tool that can mix two MP3s, and soxmix seems to be a perfect fit.