ffmpeg unable to parse matroska file with a large lace (250 frames)
|Reported by:||pkoshevoy||Owned by:|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
Per Matroska spec the absolute limit on the number of frames in a lace is 256 (max unsigned char + 1).
In my Matroska muxer I try to cram as many audio frames into the lace as I can before the next video frame comes along, then I start a new SimpleBlock? (and new lace obviously). However, when processing an audio only compression there are no video frames available to prevent the audio lace from growing too large. That is how I've made a 30 second MKA file with Vorbis audio, where 250 frames are stuffed into a single SimpleBlock? in a lace.
When I attempt to play this file with my ffmpeg based video player it sounds like a bunch of skips and pops and playback ends prematurely. Media Player Classic does the same.
Strangely, if I use MP3 codec instead of Vorbis the file plays fine, although you can't seek it because it has just one SimpleBlock? with 241 frames.
I understand that putting too many frames into a lace is bad for seeking. As a workaround on my end I limited my muxer to output at most 8 frames per SimpleBlock?, and this has fixed the problem for me.
However, I think ffmpeg needs to be robust enough to handle a file with large (yet valid) number of frames in a lace.