I have a simple pipeline to split video files using splitmuxsink with matroskamux. When loading the files in VLC Player I cannot seek to different points within the generated files this makes it hard to find content. I’ve set matroska muxer property offset-to-zero=true (thread) but that doesn’t seem to help.
Is this a bug?
Is there a way to split files to mkv and still be able to seek?
Do you have the same problem if you don’t use splitmuxsink and just use matroskamux ! filesink location=video.mkv directly?
(Also, are you saving raw video frames on purpose? If not, you might want to add an encoder before the muxer somewhere, e.g. x264enc tune=zerolatency or somesuch)
matroskamux doesn’t have max-size-time= property so it can’t split. The issue is only with split files. The first file generated by split is seekable. The subsequesnt files all aren’t seekable. The start time of each subsequent split file is not starting from 0 but it’s running time. See the attached screen shot of VLC timeline (only seek in first file works).
Yes the above pipeline is saving raw frames but that’s not the issue as it’s a test pipeline one can use to reproduce the issue. My actual pipeline does use compressed h264 frames.
This sounds like a known bug in VLC when timestamps don’t start at 0 (which is perfectly fine, since Matroska is a streaming format).
However, I don’t know why the timestamps in subsequent split files don’t actually start at 0. It sounds like the offset-to-zero=true doesn’t actually get applied or isn’t working as it should?
Good catch on the async-finalize=true and your pipeline works.
Any reasons why one might not want to set splitmuxsink async-finalize=true by default? I does seem to also solve the issue in my pipeline. I’m trying to be caustious for future use.
Also, you mentioned bug in VLC, is there another player that can play the mkv files with seek that don’t have async-finalize=true?