ffmpegwindowsavisynth

Difference between DirectShowSource() and FFmpegSource2() in AviSynth


For non .avi A/V sources (as .mp3, .mp4, etc.) there are (at least) 2 possibilities for reading those media files in AviSynth (in Windows):

What are advantages and disadvantages of them?
Which is more reliable, frame / sample accurate, etc.?


Solution

  • DirectShowSource() uses codecs currently installed and enabled for the particular file type in your system. Usually that means the same codecs that fire up when you open that video file in your media player, including the audiostream. If you have some special post-processing options enabled there they will be in effect too.

    FFmpegSource2(), as you mentioned, is not dependent on system codecs and instead uses FFmpeg. By default, it also ignores the audio, even if it's present in the source container.

    A notable difference is that DirectShowSource() does not have frame-accurate seeking, which becomes critical if you're trying to do some trimming with per-frame precision or, say, mix two recording of the same event so that every frame would match. FFMPEG has the option to generate .ffindex files for improved seeking capabilities (it's on by default).

    However, in my experience when opening some interlaced HDTV streams encoded in H264, FFmpegSource2 produces double frame rate, so you might need to watch out for that.

    There is also an external plugin named DSS2 that fixes the frame-inaccurate issue of the original.

    Personally, I usually use DirectShow/DSS2 unless I need frame-accurate seeking, since it might take some time for FFMS to do the indexing during first launch.