Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: sabayon 5, slack64, Lenny, LFS 6.4 user # 20665
Posts: 61
Rep:
Convert flv to dvd w/ ffmpeg
I've been batch converting flv to avi w/ a script, but the output sucks. The command is
Code:
for f in *.flv; do ffmpeg -i "$f" "${f%.flv}.avi"; done
So then I'd use avidemux's Auto option "DVD". I'd like to use those options in the script's ffmpeg command b/c the quality is pretty good. It will eliminate a BIG extra step in this process. (Of course if you'd like to share better settings, then many thanks.)
Avidemux set the video codec to DVD (lavc) & audio to mp2 (TwoLAME). The audio bitrate = 160. The Configuration for lavc is...
Encoding mode: Two pass - average bitrate
Avg Bitrate kb/s: 6000
Max bitrate: 8000
Min bitrate: 0
Use Xvid rate control (checked)
Buffer size: DVD 224 kB
Aspect Ratio: 16:9
Interlacing: Progressive
Matrices: Default
GOP Size: 12
ffmpeg basically IS lavc, that is, it's a frontend for the libav* series of codecs and format processors, as well as some external libraries. So yes, you should be able to pretty much pass all those options to it. Just read the man page carefully and build your command line up from there.
The command you've been using contains no setting information whatsover, just the input and output filenames, so ffmpeg is simply using its default settings, some of which are taken from the input file, and others that are built in. At the very least you probably need to set a higher bitrate for the output (I believe the default is a measly 200k), perhaps to 1500-2000k" or so. 6000k is probably much higher than necessary for an .flv input video, however, unless it's of really exceptional quality. It's a good setting for dvd conversions, but you quickly reach a point of diminishing returns when the input quality is limited.
Distribution: sabayon 5, slack64, Lenny, LFS 6.4 user # 20665
Posts: 61
Original Poster
Rep:
Thanks!!!
The basics of my little script are now complete; thanks David H.
This command gave much better results:
Code:
for f in *.flv; do ffmpeg -i "$f" -aspect 16:9 -s hd720 -r 29.97 -target ntsc-dvd "${f%.flv}.avi"; done
Now it's time to play around. The ffmpeg man page says about the -target option: "All the format options (bitrate, codecs, buffer sizes) are then set automatically." IDK what the defaults are for ntsc-dvd; maybe part of the command is redundant? I'll some more.
Thanks again.
Last edited by agrestic; 09-07-2009 at 04:35 PM.
Reason: oops
The "target" options are basically preset configurations. You can override any individual target setting simply by specifying it on the command line along with the target command. The output file information displayed when you run the command should tell you what settings are being used.
Ah, you wanted to know what the output format is for the filename? I might've noticed you were still using the .avi extension in your command if I'd been paying more attention.
But to be more specific, since that preset is for generating dvd-compatible video, that's what you're going to get, mpeg2 video and (usually) ac3 audio in an mpeg-ps container, which can be easily converted to a .vob container by most authoring programs.
BTW, running the "file" command on a multimedia file will also give you the basic file type, and for the more common formats you'll usually also get a few details like the exact codecs and bitrates used.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.