Log in

View Full Version : Unstable number of frames DGAVCIndex,FFVideoSource+Avisynth


infoeater
5th December 2011, 20:18
I am using Avisynth, VirtualDub and MeGUI (+ plugins).

When I indexed 00004.MTS file with DGAVCIndex index file informed me about 7470 frames. However then I am using following script in Avisynth:

LoadPlugin("C:\Documents and Settings\Toshiba\Desktop\VirtualDubMod_1_5_10_2_All_inclusive\MeGUI_2050_x86\tools\dgavcindex\DGAVCDecode.dll")
AVCSource("C:\00004.dga").AssumeFPS(60000,1001)

I receive only 7468 frames. How it's possible, and what's the correct number of frames?

When I muxed h264 video with AC3 audio in MP4, the result mp4 file had 7470 Frames (at last when using FFVideoSource). However frames 0, 1 and 2 were exactly the same, and the same (sometimes different when watching them first time after reloading script) as in Avisynth AVCSource frame 0. Last 7469 frame was equal to Avisynth frame 7465, and Avisynth AVCSource frames 7466 and 7467 were lost.
Generally when I play with FFVideoSource remuxed to mkv or mp4 MTS files (to mp4 only if without audio) Avisynth warns me about decoder returning empty frames.

AC3 audio duration is about 124,640s (duration of 7470,929 video frames). After adjusting for reported delay -33ms it will be 124,607 (duration of 7468,951 video frames).

How to extract from such MTS files video and audio streams with the same duration for editing? How to edit them frame-accurately in Avisynth?


EDIT:
Different files have various delays between muxed (and opened by FFVideoSource) and original version (opened by AVCSource). Sometimes demuxed version contain earlier frames than original one. H264 streams demuxed by eac3to are shorter than streams demuxed by DGAVCIndex. Both however after muxing in mkv or mp4 are not working correctly (MKVs are making empty frame errors, mp4s are making empty frame errors, or copying frames at the beginning if I use audio.) with FFVideoSource.

Link to some problematic files:
http://www.mediafire.com/?bg9v76d12h47ldi,qz4bjufn0nq6k61,7ihldkp3c1uhcdo,dqkqq54jp4asdh1,kh3kt83beeb4ft8
I attached dga file.