Hi,I want to do the following: transcode vob files (from dvd) to h264/aac so I can watch them (a.o.) on my playstation 3. I also need to have the subtitles of one track. As no application/device other than mplayer can play out-of-band subtitles from mp4, I guess I need to have the subtitles hardcoded :-(
At the moment I do have a more or less working setup but it has the problem that is looses a/v sync due to demuxing. This is what I do, I use mplayer with -vo yuv4mpeg and -ao pcm, which make mplayer render the subtitles as well. The yuv4mpeg stream is then fed to x264, the pcm (wav) stream is fed to faac. The streams are then muxed using MP4Box.
This works well, except that a/v sync is lost. I have tested a similar setup where the vob is remuxed using ProjectX first, this solves the a/v sync problem, but it raises another problem: ProjectX keeps timestamps very (overly) tight together when demuxing, so it inserts and drops video frames all of the time to keep the timestamps happy. This can be seen as stuttering in panning scenes. Also for various reasons I'd rather not use a java application here.
My next approach is to try to sync the result myself, by dropping audio frames at the start and assuming once a/v sync is good, it stays correct (which is afaik a valid assumption for 25 fps DVD's). Using manually tested values this works fairly well, but of course this needs to be automated to be useful.
I was under the impression that the following approach would yield a valid value to be used for dropping the necessary audio frames: scan the first x pes-headers containing video (where x ~ gop size) for pts values and keep the smallest. Also find the first pes packet that includes audio of the desired track and remember that value. Now subtract both values and you should have the a/v sync difference, right? This value multiplied by 90000 and divided by 48000 should give the amount of 48000 khz lpcm samples to be dropped (or inserted).
My problem is that I can't find a tool that reliably gives these pts values. FFmpeg gives a pts value for each input stream but it's completely unclear to me which pts this is. Tcprobe also gives pts values, for each separate stream, but these differ from the ones given by ffmpeg. Any combination of differences of pts'es obtained this way does not give a correct amount of audio samples to be dropped/inserted.
So now the simple questions ;-)- does anyone know of a program with functionality similar to ProjectX (demuxing while keeping a/v sync), which is written in C(++) and has options to tweak the algorithm? - does anyone know of a program that just dumps pts'es from a vob (with or without pes headers) - a program (not a script!) that does it all (see subject) would be awsome, but I don't count it ;-))
Thx!
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
