LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 12-12-2009, 08:42 PM   #1
jiobo
Member
 
Registered: Nov 2008
Posts: 180

Rep: Reputation: 36
Video DVD, ffmpeg ERRORS: ac3 and /dev/null; makemenu MPEG-2


In trying some DVD formats, I had some errors with ffmpeg preventing the creation of a Video DVD.

ffmpeg -codecs shows:
Code:
DEA ac3  ATSC A/52A  (AC-3)
This produces an error:
Code:
ffmpeg -i file.wav -ac 2 -ar 22050 -ab 282 -acodec ac3 -y file.ac3

No channel layout specified. The encoder will guess the layout, but it might be incorrect.
Error while opening encoder for output stream #0.0: maybe incorrect parameters such as bit rate, rate, width
This also produces an error:
(there is a typo in the title it should be /dev/zero)
Code:
ffmpeg -i /dev/zero -ac 2 -ar 22050 -ab 282 -acodec ac3 -y file.ac3

ERROR: /dev/zero unknown format
What libraries support ac3 encoding and decoding, and what ones are known to be fully functional with ffmpeg?

I also wanted to find out about using ffmpeg to recode the timestamps in separate MPEG-2 files so that they are sequential, but still separate files...without concatinating the files into one big file. For makemenu, it uses ac3 as the audio encoding for the DVD. Is ac3 considered the standard DVD audio format for NTSC Video DVDs so that it will play in any NTSC DVD player?

Last edited by jiobo; 12-12-2009 at 08:44 PM.
 
Old 12-13-2009, 08:28 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950
Acceptable ac3 parameters for DVD, according to wikipedia, are:
Quote:
AC-3: 48 kHz sampling rate, 1 to 5.1 (6) channels, up to 448 kbit/s
Meaning that your sample rate is much too low. You need to use "-ar 44800" if you want it to be dvd-video compatible.

pcm and mp2 audio formats are also acceptable, within certain ranges. Check the link.

Code:
Error while opening encoder for output stream #0.0: maybe incorrect parameters such as bit rate, rate, width
It seems that ffmpeg only accepts certain combinations of bitrates and samplerates for ac3. Your command works if I change the -ab to 192k or 256k, for example. But I can only set it to 384k if I increase the samplerate to 44100 or 48000. I don't know if this is a limitation of ac3 itself, or just ffmpeg.

Also, starting a couple of years ago, ffmpeg changed the reading of the bitrate parameter to be bits-per-second. You need to use "-ab 256k" to specify kilobits.

Code:
ffmpeg -i /dev/zero -ac 2 -ar 22050 -ab 282 -acodec ac3 -y file.ac3

ERROR: /dev/zero unknown format
FFmpeg doesn't know what the endless stream of zeros it's getting is supposed to represent. If you want to create a silent ac3, you need to specify the input parameters of the raw data. I believe you can use something like this:

Code:
ffmpeg -ar 48000 -ac 2 -f s16le -i /dev/zero -acodec ac3 -ab 64k -t 4 silence.ac3
The parameters of ffmpeg before the input file specify what format the input will be read as, while the ones following it specify what the output value will be (parameters not explictly stated will be the same as the input). In this case, we're telling it to treat /dev/zero as if it were in the 16-bit pcm format (little-endian), but I suppose any of the raw pcm formats would work. Finally, use -t to state the number of seconds to encode.
 
1 members found this post helpful.
Old 12-13-2009, 11:32 PM   #3
jiobo
Member
 
Registered: Nov 2008
Posts: 180

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by David the H. View Post
Acceptable ac3 parameters for DVD, according to wikipedia, are:
Thanks for that. It should really be in the man pages under the heading for acodecs and "ac3"!!! Same for the other acodecs as well!

I did manage to get what I was trying to do done...but it would have been MUCH easier if the man pages were more detailed!!!

Quote:
pcm and mp2 audio formats are also acceptable
Most DVD players will also play mp2 audio, but it is not part of the "DVD" standard pushed by the industry.

Quote:
It seems that ffmpeg only accepts certain combinations of bitrates and samplerates for ac3.
It would be good if the man pages could be updated with acceptable bitrates and sampling rates for the codecs, both acodec and vcodec!!!

Quote:
FFmpeg doesn't know what the endless stream of zeros it's getting is supposed to represent. If you want to create a silent ac3, you need to specify the input parameters of the raw data.
Thanks for that. I had thought so. I got that code fragment from a web page on DVD creation. They could have been using an earlier version of ffmpeg, or more likely, they just didn't try it to see if it works! They could have defined default parameters in a configuration file for ffmpeg and not mentioned that in the web page.

I did manage to successfully build a Video DVD using Linux tools, mostly ffmpeg. It was a lot of work, and the documenation was not very good. It would be great if Linux users who know how to do Video DVD creation would help out with the man pages and documentation for it!

When I try out your code samples to see that they work, I can post again....since I worked around it in another way and got it to work.
 
  


Reply

Tags
dvd, ffmpeg, mpeg2


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ffmpeg not decoding AC3 audio jroyce Linux - Software 3 11-23-2007 10:32 AM
Morphix remastering: chroot /dev/null errors evanw Linux - Software 6 01-02-2006 03:42 PM
write errors to log file, instead of /dev/null c_r2005 Linux - General 2 07-30-2005 09:34 AM
From Video-DVD to mpeg or avi. How? pepeq Linux - Software 0 02-13-2005 04:56 PM
MPEG -> Video DVD Riddick Linux - Software 2 12-18-2004 11:17 AM


All times are GMT -5. The time now is 06:40 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration