Mencoder AC3 problems
Hello!
I'm trying to convert a bunch of matroska-files to avi (to be able to watch them on my xbox 360). However i can't get ac3-audio to work with mencoder, it always ends up being out of sync and behaving really wierd. Here is an example file i have been playing with: Code:
[maggot@~/video] ffmpeg -i testfile.mkv Code:
[maggot@~/video] mencoder -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=10000 -oac lavc -lavcopts acodec=ac3:abitrate=640 -channels 2 testfile.mkv -o testfile.avi The command line in mplayer looks wierd too, the audio frame count is a lot higher than the video frame count, here is after a couple of seconds playing: Code:
[maggot@~/video] mplayer testfile.avi Anyone know why this is happening? I have tried a bunch of different files with mp3, vorbis, dts, ac3 and so on audio, same problem all the way... seems to be a problem with lavc/ac3 encoding audio? Any help would be greatly appreciated. Regards MagooT |
I would use the most recent version of ffmpeg, and the '-async' option. I don't know of a way to stop a/v desync with mencoder :(
You could try with mencoder using '-oac copy', which would copy the original audio, that might work ... possibly. But if not... Here's the commands I would run (2 pass): Code:
ffmpeg -i input.mkv -vcodec libxvid -qscale 5 -s 624x352 -r 23.976 -aspect 39:22 -g 240 -bf 2 -acodec ac3 -ab 160k -ar 24000 -async 24000 -ac 2 -pass 1 -an -f rawvideo -y /dev/null |
Thanks a lot, that seems to work really well. Have tried it on a couple of 1080p and 720p trailers, and after tweaking the parameters a bit i'm very pleased :)
-qscale 5 seems to produce a file only slightly larger than the input file, and the quality is pretty decent in my opinion, i tried -qscale 2 which produced a file 4 times as big as the input file, with about identical quality, i'm gonna keep playing a bit and see what i get. A question about encoding generally, i tried: -acodec ac3 -ab 640k -ar 48000 -async 48000 for the audio, which caused the audio to slowly go out of sync along the clip, it plays just a bit faster (or was it slower?) than the video. Just out of curiosity, why is this? Is it a problem to encode audio with higher bitrate than the original audio track? I don't know so much about these things, just learning as I go :) |
Well, I've only gotten slight a/v desync with ffmpeg if you don't use the original sampling frequency, for example I think it's 24000 in this case. The bitrate shouldn't matter as much, unless it's really really high. Anyway, I usually use mp3 with 160k or 128k (plus original sampling rate) and I have not noticed any a/v desync.
|
Ok, i tried lowering the bitrate to 192k and that worked for the particular file i was trying to convert.
However now i ran into another bump in the road when running the second pass on this file: Code:
Seems stream 0 codec frame rate differs from container frame rate: 47.95 (27956/583) -> 23.98 (24000/1001) Any way around this or do i have to wait until support is added? 5.1 would be nice to have. |
Well, I never tried 6 -> 6 channel. But I know that 6 -> 2 works fine. Still even this did not work until I got the latest version of ffmpeg, so before you couldn't even do 6 -> 2. Maybe they'll add support at some point. Have you tried different output audio codecs ?
|
I just updated to FFmpeg version SVN-r20787 from debian-multimedia.org's sid-repository. Started another run at the same file with 2 channels this time to see if that works... (6 channels didn't work, at least i couldn't run the second pass with this version either).
I have only tried AC3 and MP3 so far, my Xbox 360 seems a bit picky with the formats so i have just kept trying AC3 because i know that works... any suggestions on codecs that support 6 channels i could try out? |
I'm not sure, I don't have a sample video to try it out with.
I would say you might wanna try aften: Code:
git clone git://aften.git.sourceforge.net/gitroot/aften/aften Don't worry, development is not dead, it's been updated just a few days ago. So I would try to dump the audio to something aften can convert, then mux the result back in with the video. |
So I use Divx web player quite a lot to watch videos and usually I have issues with either video or audio but sometimes no audio at all.
I think it's when I play videos with AC3 Support that I get no audio. I have Perian installed, but their support page says the following: "Please consider removing obsolete QuickTime Components: FFusion, Xvid Delegate, 3ivX, DivX, DivX Decoder, XviD, msmpeg4v1, msmpeg4v2, AviImporter, EX_M4S2, Casio AVI Importer, AC3 Codec, and MatroskaQT. Now, in my QT folder (library/quicktime/) I used to have an AC3 filter file, which I deleted, nothing happened. The only file in there is Perian.component" Is there somewhere else I should look or is that not the issue? Please help |
All times are GMT -5. The time now is 06:38 PM. |