3pass audio sync problem
hi, wondering if anyone can help me out with a sync problem I am having. I am encoding files from dvd using 3 pass encoding, and the latest version of mplayer, 0.90. Can I also say firstly, that I am eternally grateful for mplayer, it has meant that I can use linux fulltime. I recommend it to everyone, it is one of the best pieces of software I have ever seen. Anyway, I use the following commands: mplayer -dumpstream -dvd 1 mencoder -ovc frameno -o frameno.avi -oac mp3lame -lameopts fast:preset=standard stream.dump mencoder -oac copy -o /dev/null -ovc lavc -lavcopts vcodec=mpeg4:vhq:aspect=4/3:vbitrate=540:vpass=1 -vop lavcdeint stream.dump mencoder -oac copy -o divx.avi -ovc lavc -lavcopts vcodec=mpeg4:vhq:aspect=4/3:vbitrate=540:vpass=2 -vop lavcdeint stream.dump Now the problem that I am having, is that every time I play a file created with these commands, the video and sound are slightly out of sync, enough so that I can notice it, but not enough to really be annoying. When I encode files with 2 pass encoding, using the following commands, I don't have the same problem. mencoder -o /dev/null -ovc lavc -lavcopts vcodec=mpeg4:vhq:aspect=4/3:vpass=1 -vop lavcdeint -oac copy stream.dump mencoder -o divx.avi -ovc lavc -lavcopts vcodec=mpeg4:vhq:aspect=4/3:vpass=2 -vop lavcdeint -oac copy stream.dump Can anyone enlighten me as to what I am doing wrong here, or is this a limitation of mplayer? thanks, Renai LeMay
Renai wrote:
When I encode files with 2 pass encoding, using the following commands, I don't have the same problem.
mencoder -o /dev/null -ovc lavc -lavcopts vcodec=mpeg4:vhq:aspect=4/3:vpass=1 -vop lavcdeint -oac copy stream.dump
mencoder -o divx.avi -ovc lavc -lavcopts vcodec=mpeg4:vhq:aspect=4/3:vpass=2 -vop lavcdeint -oac copy stream.dump
Can anyone enlighten me as to what I am doing wrong here, or is this a limitation of mplayer?
I think you've already solved the problem: just don't use the frameno thingy. I really don't know what it's useful for or how it's supposed to work. I've asked about it on mailing lists, but never gotten a straight answer. Also, it's always a good idea to specify "-ofps", at least for NTSC input. In particular, it's necessary if you are encoding film that has been telecined. If you don't have NTSC DVDs, you probably have no appreciation for what we have to deal with here in the US (count your blessings). Is it that you want to reencode audio instead of copying the audio stream from the original? You can just use "-oac pcm" for the first pass and "-oac mp3lame" for the second. Of course, you probably want to know what video bitrate to use beforehand in order to fit the final video into a certain size. You can know how big audio will be if you use CBR, but that won't give the best quality. You can encode the audio as a first step to find out how big it will be. Then, encode the two video passes using "-oac pcm", discarding the output from the first pass. I've been told that sync could be lost if you don't decode audio while encoding video. Finally, remultiplex the audio and video into the final target. I haven't tried this procedure with AVI, since I prefer to use Vorbis audio, which doesn't work well in AVI. I use either ogmmerge or mkvmerge to produce a final OGM or Matroska file. Read the encoding-tips.txt file in the DOCS directory. If you have MP3 audio and AVI video, you should be able to multiplex them into a final AVI using mencoder with the "-audiofile" option. I've heard bad things about VBR audio in AVIs, though, so you may want to use OGM or Matroska anyway, even if the audio is MP3. Jonathan Rogers
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jonathan Rogers wrote:
I think you've already solved the problem: just don't use the frameno thingy. I really don't know what it's useful for or how it's supposed to work. I've asked about it on mailing lists, but never gotten a straight answer. Also, it's always a good idea to specify "-ofps", at least for NTSC input. In particular, it's necessary if you are encoding film that has been telecined. If you don't have NTSC DVDs, you probably have no appreciation for what we have to deal with here in the US (count your blessings).
Well, over here the DVDs are all Mickeymoused up to 25fps. The 4% speedup is enough to be annoying if you know the original. I encode all PAL film sources into NTSC by now to get around this. (Fortunately with mplayer you can simply say -speed 0.96). - -- Linards Ticmanis The Master said, "The business of laying on the colors follows the preparation of the plain ground." -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE/AbAKpXWZ5wbYWboRArKzAKDOMrEjJNSIeth0SsL6FWFiHQxTsQCdEuFg FVSzyk74CmPtF2AEajzFJEc= =itlW -----END PGP SIGNATURE-----
Linards Ticmanis wrote:
Well, over here the DVDs are all Mickeymoused up to 25fps. The 4% speedup is enough to be annoying if you know the original. I encode all PAL film sources into NTSC by now to get around this.
(Fortunately with mplayer you can simply say -speed 0.96).
You can tell that the sound is slightly too fast and the frequency too high? Or does everyone just walk around a little too sprightfully? Jonathan Rogers
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jonathan Rogers wrote:
[Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html] Linards Ticmanis wrote:
Well, over here the DVDs are all Mickeymoused up to 25fps. The 4% speedup is enough to be annoying if you know the original. I encode all PAL film sources into NTSC by now to get around this.
(Fortunately with mplayer you can simply say -speed 0.96).
You can tell that the sound is slightly too fast and the frequency too high? Or does everyone just walk around a little too sprightfully?
The speaking just sounds a bit more breathless that way, and also there is the over-eagerness of movements you mention. To get the frequency difference as such you'd probably need "absolute hearing", which some great composers reputedly had, but I certainly don't. Also I heard sometimes a method is used which speeds the sound up without a frequency shift, like the "sox" stretch effect does. The one thing where absolute frequencies are important is the higher freqencies in vowels (fermants) as far as I know, since those determine which vowel we hear. But 4% is not enough to really make a big difference in this so many times the sound is obviously just pitched up. - -- Linards Ticmanis The Master said, "The business of laying on the colors follows the preparation of the plain ground." -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE/AfVEpXWZ5wbYWboRAlEKAKCUbwS6LRYrrCjCxzWNKzV11EDJMgCfR4en KfnAr4LuYyLhf76fYMQXO+I= =EqjE -----END PGP SIGNATURE-----
Linards Ticmanis wrote:
The speaking just sounds a bit more breathless that way, and also there is the over-eagerness of movements you mention. To get the frequency difference as such you'd probably need "absolute hearing", which some great composers reputedly had, but I certainly don't. Also I heard sometimes a method is used which speeds the sound up without a frequency shift, like the "sox" stretch effect does. The one thing where absolute frequencies are important is the higher freqencies in vowels (fermants) as far as I know, since those determine which vowel we hear. But 4% is not enough to really make a big difference in this so many times the sound is obviously just pitched up.
That's really interesting. I wouldn't have thought one could notice a speed up of 4%. Now, I'll have to try it (using MPlayer, of course) and see what it feels like. Next, we'll be hearing from someone who can tell the difference between the original 24 fps film and the telecined version at 23.976. :) Jonathan Rogers
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jonathan Rogers wrote:
That's really interesting. I wouldn't have thought one could notice a speed up of 4%. Now, I'll have to try it (using MPlayer, of course) and see what it feels like. Next, we'll be hearing from someone who can tell the difference between the original 24 fps film and the telecined version at 23.976. :)
LOL! ;-) - -- Linards Ticmanis The Master said, "The business of laying on the colors follows the preparation of the plain ground." -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE/AgXEpXWZ5wbYWboRAvDoAKC3mgoU/BZdCtXbFubGUyft1qBbhgCfQOBx Rxqs+5BpkQxqq1Eiz3inZws= =WgRr -----END PGP SIGNATURE-----
On Tue, Jul 01, 2003 at 04:27:20PM -0500, Jonathan Rogers wrote:
The speaking just sounds a bit more breathless that way ... Next, we'll be hearing from someone who can tell the difference between
Linards Ticmanis wrote: the original 24 fps film and the telecined version at 23.976. :)
I can certainly tell the difference. Not because of the speed difference (which is an approximately 0.1% drop), but because telecined video looks like shit! -- Matthew W. Miller <mwmiller@columbus.rr.com> A: No. Q: Should I include quotations after my reply?
Matthew W. Miller wrote:
I can certainly tell the difference. Not because of the speed difference (which is an approximately 0.1% drop), but because telecined video looks like shit!
Well, of course interlaced video looks horrible, but usually, telecining can be reversed automatically, rendering perfect progressive frames. I was talking about the speed difference. Jonathan Rogers
On Sun, 29 Jun 2003 10:35:20 +1000 Renai <rlem6983@mail.usyd.edu.au> wrote:
mplayer -dumpstream -dvd 1
mencoder -ovc frameno -o frameno.avi -oac mp3lame -lameopts fast:preset=standard stream.dump
It's generaly a bad idea to use the file created by -dumpstream as you loose a part of the information provided by the source. Rather try to encode directly from the dvd, as mencoder can read any source that mplayer can. ie: mencoder -ovc frameno -o frameno.avi -oac mp3lame -lameopts fast:preset=standard dvd://1 Attila Kinali -- Emacs ist für mich kein Editor. Für mich ist das genau das gleiche, als wenn ich nach einem Fahrrad (für die Sonntagbrötchen) frage und einen pangalaktischen Raumkreuzer mit 10 km Gesamtlänge bekomme. Ich weiß nicht, was ich damit soll. -- Frank Klemm, de.comp.os.unix.discussion
Attila Kinali wrote:
It's generaly a bad idea to use the file created by -dumpstream as you loose a part of the information provided by the source.
What is lost from the DVD's MPEG program stream? The IFOs aren't automatically copied, but that can be done manually and they only seem to be needed for subtitle rendering. I've always copied VOBs to a hard drive before encoding. I've used both tccat (from transcode) and mplayer with -dumpstream. I've never encountered any problems decoding them. Jonathan Rogers
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Attila Kinali wrote:
[Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html] On Sun, 29 Jun 2003 10:35:20 +1000 Renai <rlem6983@mail.usyd.edu.au> wrote:
mplayer -dumpstream -dvd 1
mencoder -ovc frameno -o frameno.avi -oac mp3lame -lameopts fast:preset=standard stream.dump
It's generaly a bad idea to use the file created by -dumpstream as you loose a part of the information provided by the source.
Rather try to encode directly from the dvd, as mencoder can read any source that mplayer can. ie:
mencoder -ovc frameno -o frameno.avi -oac mp3lame -lameopts fast:preset=standard dvd://1
Attila Kinali
I used to do that, but then I noticed the DVD would be spinning for 24 hours straight and the DVD would be very hot when I took it out. I thought it would be less stressful for the DVD to do it with -dumpstream (1 hour spinning) and the encode from hard disk. What information is lost when you do the dump? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) Comment: Using GnuPG with Netscape - http://enigmail.mozdev.org iD8DBQE+/1LOkzndl97WsggRAuZgAKC/hKWWny4xrbrPSVtgqBFrxzlCFgCgpelt hAr6ALV/a6osPaNd9DZ2Q4E= =SKZB -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ruben Garcia wrote, on 29/06/03 21:57:
I used to do that, but then I noticed the DVD would be spinning for 24 hours straight and the DVD would be very hot when I took it out. I thought it would be less stressful for the DVD to do it with -dumpstream (1 hour spinning) and the encode from hard disk.
Why not just dump the DVD with dd or readcd then work with the image file? WFM, and nothing is lost. - -- - ------------------------------------------------------------------------ begin GPG D694 FB76 12FC 94A7 4557 9951 8734 A4AC 7AA4 141E Ian Smith Worst . . . signature . . . ever ! -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE+//2GhzSkrHqkFB4RAh4rAJ47iNrpHK9UmO3aYEdwDALeDhstOgCgz7CK 1C2vik6RxMMGcxAGpthfdGY= =QIl2 -----END PGP SIGNATURE-----
On Sun, Jun 29, 2003 at 10:35:20AM +1000, Renai wrote:
[Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html] hi,
wondering if anyone can help me out with a sync problem I am having. I am encoding files from dvd using 3 pass encoding, and the latest version of mplayer, 0.90. Can I also say firstly, that I am eternally grateful for mplayer, it has meant that I can use linux fulltime. I recommend it to everyone, it is one of the best pieces of software I have ever seen.
Anyway, I use the following commands:
mplayer -dumpstream -dvd 1
mencoder -ovc frameno -o frameno.avi -oac mp3lame -lameopts fast:preset=standard stream.dump
mencoder -oac copy -o /dev/null -ovc lavc -lavcopts vcodec=mpeg4:vhq:aspect=4/3:vbitrate=540:vpass=1 -vop lavcdeint stream.dump
mencoder -oac copy -o divx.avi -ovc lavc -lavcopts vcodec=mpeg4:vhq:aspect=4/3:vbitrate=540:vpass=2 -vop lavcdeint stream.dump
Now the problem that I am having, is that every time I play a file created with these commands, the video and sound are slightly out of sync, enough so that I can notice it, but not enough to really be annoying.
When I encode files with 2 pass encoding, using the following commands, I don't have the same problem.
mencoder -o /dev/null -ovc lavc -lavcopts vcodec=mpeg4:vhq:aspect=4/3:vpass=1 -vop lavcdeint -oac copy stream.dump
mencoder -o divx.avi -ovc lavc -lavcopts vcodec=mpeg4:vhq:aspect=4/3:vpass=2 -vop lavcdeint -oac copy stream.dump
Can anyone enlighten me as to what I am doing wrong here, or is this a limitation of mplayer?
It's just that 3pass mode is a stupid hack that's bound to cause problems. Personally I advocate it's removal, or at least that it not be included in mplayer-g2's mencoder... Rich
participants (8)
-
Attila Kinali -
D Richard Felker III -
Ian -
Jonathan Rogers -
Linards Ticmanis -
Matthew W. Miller -
Renai -
Ruben Garcia