GNOME Bugzilla – Bug 728771
Mp4 files created are not in playable format
Last modified: 2014-04-23 07:14:30 UTC
I tried creating multiple mp4 files with index incremented when file size has reached to 1GB using multifilesink. But I am not able to play the mp4 files created using multifilesink. Command used gst-launch-0.10 -e rtspsrc location=rtsp://XYZ name=rtsp ! queue ! rtph264depay ! video/x-h264, width=1920, height=1080, framerate=30/1 ! mp4mux name=mp4 ! multifilesink location=%ds.mp4 next-file=4 max-file-size=1073741824 I tried the same with videotestsrc too, but files created are not in playable state. Command used gst-launch-0.10 -e videotestsrc ! x264enc ! video/x-h264, width=1920, height=1080, framerate=30/1 ! mp4mux name=mp4 ! multifilesink location=%ds.avi next-file=4 max-file-size=1073741824 I have seen people facing similar issue in the GStreamer community. Is there a fix for the same ?
multifilesink and mp4mux won't work together this way. MP4 files can't just be cut in the middle, the two resulting files won't be playable on their own... and also mp4mux needs to finalise files after writing before they're actually usable (i.e. after receiving the EOS event mp4mux is going to rewrite headers of the file). For what you want to do you'll have to create a new mp4mux and filesink for every file part yourself, and before switching from one part to another you need to send an EOS event to the old part and wait until you get the EOS message from the filesink before shutting it down. Re-linking pads during PLAYING requires you to use blocking pad probes on the srcpad in front of the muxer. Also for all of this it's much easier to use 1.x than 0.10.