Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Linux, Mac OS X, & Co

Reply
 
Thread Tools Search this Thread Display Modes
Old 14th October 2009, 15:35   #1  |  Link
cameris
Registered User
 
Join Date: Oct 2009
Posts: 3
audio encoding with ffmpeg | sox | ffmpeg

Hi,

I have a problem to encode audio tracks in my encoding script. It uses ffmpeg to encode to aac and for 5.1 tracks also sox to get the channel order right. I have tested it on a couple of tv-series (longest was 45 min) and everything has worked great.
But now I have tested it on some full featured movies and on every 5.1 audio track it hangs aroung 80MB (output file, bitrate: 128k) and I dont have a clue why. It doesnt give a error message neither quits, it just stops doing anything.

The command for 5.1 looks like this:
Code:
ffmpeg -i $input -async 1 -vsync 1 -v 0 -map $map -vn -sn -ac 6 -acodec pcm_s16le -ar $afreq -f wav - | \
sox -t raw -s -2 -c 6 -r $afreq - -t wav - remix -m 6 5 1 2 3 4 | \
ffmpeg -i - -ac 6 -v 0 -y -acodec libfaac -ab $audioquality $audiofile
Has anybody has an idea why?
cameris is offline   Reply With Quote
Old 14th October 2009, 15:47   #2  |  Link
nm
Registered User
 
Join Date: Mar 2005
Location: Finland
Posts: 2,641
Does the same thing happen if you redirect WAV data from the first ffmpeg process or sox to a file? If not, what happens when you encode that file?

However, I'd recommend switching to neroAacEnc if you're on x86(-64). It's much better than FAAC.
nm is offline   Reply With Quote
Old 14th October 2009, 19:04   #3  |  Link
cameris
Registered User
 
Join Date: Oct 2009
Posts: 3
I have testet ffmpeg | sox -> wav, no error. But when encoding the wav to aac I've got
Code:
[pcm_s16le @ 0x9970d60]invalid PCM packet.3kbits/s
Error while decoding stream #0.0
I also tried a 6ch -> 2ch downmix without any problem.

Is nero really that much better? I thought the difference is only noticeable on bitrates below 128k.
If I try it, do I still need sox for channel ordering or does nero do the work?

Last edited by cameris; 14th October 2009 at 19:09.
cameris is offline   Reply With Quote
Old 14th October 2009, 19:53   #4  |  Link
nm
Registered User
 
Join Date: Mar 2005
Location: Finland
Posts: 2,641
Quote:
Originally Posted by cameris View Post
I have testet ffmpeg | sox -> wav, no error. But when encoding the wav to aac I've got
Code:
[pcm_s16le @ 0x9970d60]invalid PCM packet.3kbits/s
Error while decoding stream #0.0
Ok, I guess you're hitting the 4 GB WAV (RIFF) file size limit. I'm not sure if there's a workaround other than using raw PCM audio. NeroAACEnc has -ignorelength parameter that should allow you to read larger than 4 GB WAV files.

Quote:
Is nero really that much better? I thought the difference is only noticeable on bitrates below 128k.
Perhaps for stereo, but you're encoding 5.1-channel audio. 128 kbps is actually a pretty low bitrate for that -- especially when using FAAC.

Also, while I haven't done a listening test myself, I'd guess that FAAC loses badly to both Lame and neroAACEnc at 128kbps stereo.

Quote:
If I try it, do I still need sox for channel ordering or does nero do the work?
Nope, you'll probably need to order them first.
nm is offline   Reply With Quote
Old 15th October 2009, 13:26   #5  |  Link
cameris
Registered User
 
Join Date: Oct 2009
Posts: 3
Quote:
Originally Posted by nm View Post
Ok, I guess you're hitting the 4 GB WAV (RIFF) file size limit. I'm not sure if there's a workaround other than using raw PCM audio. NeroAACEnc has -ignorelength parameter that should allow you to read larger than 4 GB WAV files.
The WAV files had 3.8 GB, so I tried nero and it worked like a charm, only order had to be changed.

eventually my script is working . Many ...
cameris is offline   Reply With Quote
Old 15th October 2009, 13:49   #6  |  Link
nm
Registered User
 
Join Date: Mar 2005
Location: Finland
Posts: 2,641
Quote:
Originally Posted by cameris View Post
The WAV files had 3.8 GB
Ok, then there may be some lower limit between 2 GB and 4 GB in ffmpeg WAV demuxer.

Quote:
eventually my script is working . Many ...
Cheers!

Last edited by nm; 15th October 2009 at 13:54.
nm is offline   Reply With Quote
Old 14th October 2009, 20:43   #7  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
did you also try to use named pipes instead of | ?
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Reply

Tags
5.1, audio, encoding, ffmpeg, sox

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump


All times are GMT +1. The time now is 22:46.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.