record H264 stream use multifilesink

Nicolas Dufresne nicolas at ndufresne.ca
Wed Oct 11 14:11:37 UTC 2017


Le mardi 10 octobre 2017 à 22:20 -0700, Michelle Guo a écrit :
> The pipeline I used like this: 
> gst-launch-1.0 rtpbin name=rtpbin latency=100 \ 
>  udpsrc
> caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264,payload=(int)96"
> port=5000 ! queue ! rtpbin.recv_rtp_sink_0  rtpbin. ! rtph264depay \ 
> ! tee name=teevideo teevideo. ! queue ! vpudec ! overlaysink \ 
> teevideo. ! queue !
> "video/x-h264,width=1024,height=768,framerate=(fraction)25/1" ! matroskamux
> name=mux mux. ! multifilesink location="/home/root/save%d.mkv" next-file=4
> post-messages=TRUE max-files=300 max-file-size=10485760 
> 
> I receive H264 stream from udpsrc, then play video and record H264 data into
> several files. 
> 
> The problem is described like this: 
> The pipeline works well, but, the files saved in the disk is not playable. 
> 1. The first one save0.mkv can be played by VLC, but can not query duration,
> so VLC can not fast forward and rewind. 
> 2. The other files excepet the first one(save1.mkv, save2.mkv...) can not
> play by VLC;
> 
> Can anybody give me some help?

May I suggest you to have a look into splitmuxsink instead. This is a
muxer friendly stream splitter, that will let you split with fixed
duration. Each output file will be a valid stream. At least MKV and MOV
have been tested. To play the result in a gapless fashion with
GStreamer, you can use splitmuxsrc.

regards,
Nicolas

p.s. What you have in hand, is a "streamable" mkv, whithout an index.
These MKV are only playable from start to end, normal speed on most
player. In GStreamer, we implement binary search for this case, but
it's not very efficient, neither it is very precise. That's for the
first file, all the other file are randomly split, hence being detected
as corrupted files, unplayable by any player really.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20171011/8f6bfe47/attachment-0001.sig>


More information about the gstreamer-devel mailing list