Trouble getting fully valid files with matroskamux
Sebastian Dröge
sebastian at centricular.com
Sun Jan 5 01:27:39 PST 2014
On Fr, 2014-01-03 at 19:02 +0000, Pedro Côrte-Real wrote:
> On Thu, Jan 2, 2014 at 5:21 PM, Pedro Côrte-Real <pedro at pedrocr.net> wrote:
> > My guess is that something is introducing an EOS marker in the h264
> > stream itself. My pipeline is matroskademux ! matroskamux so maybe
> > matroskademux outputs some form of an EOF marker on the stream itself
> > before it sends EOS to the pipeline?
>
> The problem was simpler than this. matroskamux will use whatever
> timestamp the pipeline is using, which will be the wrong one when I
> swap files. The solution was to alter the timestamps in the data probe
> to be consistent between file changes.
>
> Working code for file split and file join is here:
>
> https://github.com/pedrocr/camerasink/blob/66be9cad5c279689b37b56e8b378e2b858da3824/bin/testread.c
> https://github.com/pedrocr/camerasink/blob/edbe35e11a935fd0ab2c4eab82372c2d03790501/bin/testsave.c
After the bugs mentioned below are fixed, the cleaner solution would be
to just adjust the segment that the muxer gets, and let the muxer
convert the buffer timestamps to the correct running time itself.
But at least in your case when you probe every single buffer anyway it
doesn't matter much ;)
Note that in your code you need to make sure that the buffer is writable
before changing the timestamp:
GST_PAD_PROBE_INFO_BUFFER (info) = gst_buffer_make_writable (GST_PAD_PROBE_INFO_BUFFER (info))
Also there might be a problem because you take the start timestamps of
buffers only. After a buffer is handled, the running time is usually the
one of the end timestamp (i.e. timestamp + duration, see matroskamux
commit).
> While looking at this with slomo on IRC we also discovered two bugs:
>
> 1) matroskamux uses timestamps directly instead of converting to
> running time (for this slomo produced a patch)
> 2) negative pad offsets don't actually work
> (https://bugzilla.gnome.org/show_bug.cgi?id=721422)
This is the matroskamux fix btw:
http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=b3aa8755fe07639f22e4104f4932d769d6c9075a
--
Sebastian Dröge, Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140105/1260bc5f/attachment-0001.pgp>
More information about the gstreamer-devel
mailing list