LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 09-06-2009, 11:17 PM   #1
agrestic
Member
 
Registered: Jan 2009
Location: atlanta, ga, usa
Distribution: sabayon 5, slack64, Lenny, LFS 6.4 user # 20665
Posts: 61

Rep: Reputation: 16
Question 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

Can these options be part of the ffmpeg command?

TIA
 
Old 09-07-2009, 02:56 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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.
 
Old 09-07-2009, 04:29 PM   #3
agrestic
Member
 
Registered: Jan 2009
Location: atlanta, ga, usa
Distribution: sabayon 5, slack64, Lenny, LFS 6.4 user # 20665
Posts: 61

Original Poster
Rep: Reputation: 16
Talking 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
 
Old 09-08-2009, 07:46 AM   #4
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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.
 
Old 09-08-2009, 11:16 PM   #5
agrestic
Member
 
Registered: Jan 2009
Location: atlanta, ga, usa
Distribution: sabayon 5, slack64, Lenny, LFS 6.4 user # 20665
Posts: 61

Original Poster
Rep: Reputation: 16
Yep; found it. It's mpg, so "${f%.flv}.mpg".
 
Old 09-09-2009, 01:50 PM   #6
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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.
 
Old 10-18-2009, 11:05 PM   #7
ElvisPH
LQ Newbie
 
Registered: Oct 2009
Posts: 2

Rep: Reputation: 0
thanks, i'll try that for my problem.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ffmpeg ogg to flv conversion inquisitiveme Linux - Newbie 1 03-10-2009 02:52 PM
ffmpeg: howto convert dvd/mkv to avi? G00fy Linux - Software 2 01-14-2009 11:25 AM
Trying to convert mp4 animation to dvd video with ffmpeg, unsupported codec? newtovanilla Linux - Newbie 4 12-29-2008 12:10 PM
LXer: Convert .flv (Google Videos) to .mpg using ffmpeg LXer Syndicated Linux News 0 07-25-2007 06:31 AM
how do i convert wmv to flv using ffmpeg? farmerjoe Linux - Software 0 11-15-2005 02:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration