FFMS / ffms2

An FFmpeg based source library and Avisynth/VapourSynth plugin for easy frame accurate access
Other
582 stars 105 forks source link

Certain video streams are always reindexed #179

Closed normann1974 closed 9 years ago

normann1974 commented 10 years ago

I've been using FFMS2 with AviSynth to crop and reencode files from my Blu-ray discs. I use DGAVCDecode to demux everything to elementary streams so that FFMS2 will work, but I have seen a very strange behavior which I'll explain below.

By default, when DGAVCDecode demuxes a file, e.g. 00001.m2ts containing H.264 video, it'll demux the video into 00001.demuxed.264.

If I use FFMS2 in AviSynth to open the video, e.g.

FFVideoSource("00001.demuxed.264")

and open the .avs in e.g. VirtualDub, FFD2 will (as expected) index the video stream immediately and put the created index in

00001.demuxed.264.ffindex

BUT, if I reload the .avs file, the video is indexed again (rendering is delayed and my hard drive works like crazy) although the index file doesn't seem to bew touched by this operation (it still has the same timestamp as it had before). I cannot make FFMS2 re-use the index file, even if I specify

FFVideoSource("00001.demuxed.264", cacheFile="00001.demuxed.264.ffindex")

Changing the index file doesn't change anything either:

FFVideoSource("00001.demuxed.264", cacheFile="00001.ffindex")

The video stream is still reindexed every time it's opened by FFVideoSource.

tgoyne commented 10 years ago

Please upload a sample which has this problem.

normann1974 commented 10 years ago

Due to the nature of this issue, I can't proove anything a small sized stream. To actually be able to notice that there's a delay in rendering the .avs on every load, I'd have to upload (copyrighted) material of a pretty large size, probably more than half a GB. Is that a good idea?

dwbuiten commented 9 years ago

Without looking, this may be due to the way H.264 elementary streams are handled in libavformat. That is, they aren't handled at all... it passes them directly to libavcodec.

I suggest you (re)mux to an actual container.

qyot27 commented 9 years ago

Their starting methodology is flawed: do not use DGAVCDecode. That's the very first mistake. It was discontinued 6 years ago, for a reason. And it offered no real advantage over FFMS2 back then beyond the TS parsing, since its decoder was libavcodec (which, again, is a build of libavcodec that hasn't been updated in nearly 7 years - yes, 7, the last version used a build from August 2008).

Also, #183 addresses a significant part of this issue as casual users experience it, so the problems they have with not setting -m lavf when indexing will be a moot point, and outputting to a different container probably won't be needed anymore.

myrsloik commented 9 years ago

Can't reproduce without a sample