You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been doing some experimenting trying to get to the bottom of some audio seeking issues using the AviSynth plugin and it seems to me that there may be a problem with indexing audio in MKV files.
What I was seeing was a delay when jumping (in VirtualDub) from some point in the timeline to a later point in the timeline. This is only the case when audio was involved (either playing audio, or using VirtualDub's waveform display or the AviSynth Waveform plugin).
Using the following as a test script:
a = ffmpegsource2("<source_filename>", atrack = 1) # this should index video and audio on first run, right?
a
trim(a.framecount - 1, a.framecount - 1) # return the last frame of the clip only to induce the audio-seek delay
waveform # paint the waveform on the clip (forces GetAudio on GetFrame)
...I found that opening this script with a previously indexed file as the source takes around the same time as indexing the file in the first place (around 30s for each of the ~45m Blu-ray rips I'm working with). Whereas opening without the trim, to the true first frame, takes just a couple of seconds.
Running the script immediately on following occasions reduces this delay to just 2-3s, which I suspect is due to the OS having cached the entire file in RAM. If I change to another source, whether indexed or not, the same ~30s delay returns (again only on the first sequential run with that source).
So it seems to me like it's having to rebuild an index for the whole file up to the requested point in time, each time (not reading it from the index file, if it's in there). Once audio for a certain point has been fetched, seeking to previous points is fast. Seeking to later points still has a delay which seems to be proportional to the size of the forward jump.
I've tested this with other MKV sources, with AC3, E-AC3, DTS, DTS XLL and AAC audio tracks, and it's the same each time. I also reverted to 2.23.1 and the issue was still present (although indexing and the related delay was somewhat faster for some files).
If I remux my MKV to MP4, or try existing MP4s, then there is no delay other than initial indexing.
I've been doing some experimenting trying to get to the bottom of some audio seeking issues using the AviSynth plugin and it seems to me that there may be a problem with indexing audio in MKV files.
What I was seeing was a delay when jumping (in VirtualDub) from some point in the timeline to a later point in the timeline. This is only the case when audio was involved (either playing audio, or using VirtualDub's waveform display or the AviSynth Waveform plugin).
Using the following as a test script:
...I found that opening this script with a previously indexed file as the source takes around the same time as indexing the file in the first place (around 30s for each of the ~45m Blu-ray rips I'm working with). Whereas opening without the trim, to the true first frame, takes just a couple of seconds.
Running the script immediately on following occasions reduces this delay to just 2-3s, which I suspect is due to the OS having cached the entire file in RAM. If I change to another source, whether indexed or not, the same ~30s delay returns (again only on the first sequential run with that source).
So it seems to me like it's having to rebuild an index for the whole file up to the requested point in time, each time (not reading it from the index file, if it's in there). Once audio for a certain point has been fetched, seeking to previous points is fast. Seeking to later points still has a delay which seems to be proportional to the size of the forward jump.
I've tested this with other MKV sources, with AC3, E-AC3, DTS, DTS XLL and AAC audio tracks, and it's the same each time. I also reverted to 2.23.1 and the issue was still present (although indexing and the related delay was somewhat faster for some files).
If I remux my MKV to MP4, or try existing MP4s, then there is no delay other than initial indexing.
Here's one of my .ffindex files: 03 - The Unquiet Dead.mkv.zip
The text was updated successfully, but these errors were encountered: