gstreamer splitmuxsink with matroskamux generating corrupt output
I have a simple gstreamer pipeline running on an IP camera (fixed to
gstreamer version 1.8.3, cannot change this). I have an h264 stream coming
through avc/au and I have a splitmuxsink using the default filesink but I've
set the muxer to a matroskamux element which is the generic one I haven't
set any properties on it. On the splitmuxsink I've set the "max-size-time"
field to 60s. I'm seeing a new file is being generated every 60s but the
file is only around 500 bytes in size so it's clearly on a proper mkv file.
Using the same pipeline but going to an appsink instead of splitmuxsink, I
can assemble the NAL units on the fly and generate a properly formed
playable file -- but I'd like to avoid this if I can and have gstreamer do
it since it seems this is exactly what splitmuxsink was intended to do.
Unfortunately the gstreamer that lives on the camera was configured without
the debug so I don't see any error output and all I have to go off of are
the short mkv files generated. Below is a hexdump of one of them if it
helps (523 bytes):
If I cat the file I of course see some gibberish but also other text such
as: GStreamer matroskamux version 1.8.3 GStreamer Matroska muxer
VideoV_MPEG4/ISO/AVC, I've stripped out the garbage but this is essentially
the only thing written to the file. Any ideas on how I can debug this? I
know for sure what is being fed to splitmuxsink is a valid h264 stream, the
only thing that could be off is the PTS and DTS don't use the same time base
and really it should be using just the PTS, I've looked through the code for
the splitmuxsink plugin and it looks like as long as the PTS is valid it
only uses the PTS so I'm not sure if this is the issue. Here is an example
of the PTS, DTS to show what I mean:
Finally -- we do NOT generate any B frames so PTS and DTS should be the same
anyway. An elementary h264 stream for example in the Annex B format does
not contain any time stamps anyway (not sure about mkv maybe it does) so I
suspect this is the problem.