splitmuxsink and timestamps

Nicolas Dufresne nicolas at ndufresne.ca
Fri Jun 1 01:17:04 UTC 2018


Le jeudi 31 mai 2018 à 13:40 +0200, Filip Štědronský a écrit :
> Hi all,
> 
> I'm trying to use splitmuxsink to split a video into several segments like
> this:
> 
>     gst-launch-1.0  -e filesrc location=input.mkv ! matroskademux ! h264parse     \
>                        ! splitmuxsink location=%02d.mkv max-size-time=15000000000 \
>                        muxer=matroskamux
> 
> The problem is that all the created segments keep the original
> timestamps. For example, the timestamps of the second segment
> start at 0:15 instead of 0:00:
> 
> 
>     $ mkvinfo -v 00.mkv
>     [...]
>     | + Duration: 00:00:14.540000000
>     [...]
>     |+ Cluster
>     | + Cluster timestamp: 00:00:00.000000000
>     | + Simple block: key, track number 1, 1 frame(s), timestamp 00:00:00.000000000
>     [...]
> 
> versus:
> 
>     $ mkvinfo -v 01.mkv
>     [...]
>     | + Duration: 00:00:13.964000000
>     [...]
>     |+ Cluster
>     | + Cluster timestamp: 00:00:14.580000000
>     | + Simple block: key, track number 1, 1 frame(s), timestamp 00:00:14.580000000
>     [...]
> 
> This causes problems with seeking e.g. in mpv.
> 
> Is this by design or a bug?

Good question, I doubt it will affect GStreamer much. Though, I wonder
if splitmuxsrc may be relying on that at the moment. The idea is that
the storage produce by splitmuxsink can be played as being 1 media by
splitmuxsrc.

> 
> Could a "reset timestamps at start of each segment" option be added?
> (akin to -reset_timestamps option in ffmpeg)
> 
> Is there some other way to fix the timestamps using other gstreamer
> elements? (googling hasn't yielded much)
> 
> The used test files are (but any mkv file will do):
>     http://regnarg.cz/tmp/input.mkv
>     http://regnarg.cz/tmp/00.mkv
>     http://regnarg.cz/tmp/01.mkv
> 
> Thanks for any pointers.
> 
> Filip Stedronsky
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


More information about the gstreamer-devel mailing list