« July 2008 | Main | February 2009 »

November 27, 2008

audio has frames too ii

so it turns out the current release version of perian causes audio desync when playing an ffvhuff/pcm avi. moral of the story: if you're trying to resync something, for the love of god, make sure the instrument you are using to check sync is not itself causing desync. it turns out that the "skipping frame!" messages from mencoder were actually correct in that they were also skipping video frames to compensate for the mutilated ac3 input - which means that all along all i had to do was do a simple sync correction (albeit one i have to discover myself) to fix output from tiki's borked dvd recorder - assuming i first make nmf using mencoder e.g.:

mencoder -dvd-device /p/mm6 dvd://1 -fps 59.94 -vf-add tfields=0 -vf-add scale=320:240 -ofps 59.94 -ovc lavc -lavcopts vcodec=ffvhuff -oac pcm -o nmf.avi

dgindex, because it doesn't drop video frames to compensate for the bad ac3 ones, will cause randomly progressive desync. though i need to remember to use it for timing in cases when the in-game timer isn't used, such as this mm6 run (the release versions of such runs will actually be several seconds shorter than their official times indicate).

Posted by njahnke at 7:44 PM | Comments (0)

November 23, 2008

audio has frames too

tiki sent me his new mm6 run today in dvd format and i was dismayed to notice that it apparently had random audio desync after indexing using dgindex (with the audio leading the video). the vobs played fine in e.g. mplayer, so i wasn't sure whether his dvd recorder was making a new chapter and chopping up the audio every few minutes or what.

after several hours of playing around, my initial guess turned out nearly correct: the "Skipping frame!" messages i was seeing every few hundred frames from mencoder trying to transcode the file were because the audio was bad, not the video. actually, i should have known this from the start - if it had been the video, then the video would have been leading the audio, not vice versa as i initially observed at points. i had also forgotten that the term "frame" also applies to many audio formats. using mencoder's -noskip option together with the -mc 0 option seemed to restore a semblance of audio sync in an nmf - enough to carefully stretch the audio to correct the progressive desync to an acceptable level.

tiki has been advised of the situation. right now we are guessing it was because he used rf (from his nes). pal nes is known to generate a nonstandard signal (enough to cause massive frame droppage with more sensitive capture devices), so maybe the ntsc nes in combination with rf confused his dvd recorder? i'll post again as i learn more.

Posted by njahnke at 8:59 PM | Comments (0)