how can I wrap pure h.264 stream into mp4 using Gstreamer so that I can seek to specific location in video? Gstreamer is used because of it's licence requirements, so please do not offer ffmpeg!
1 Answer
gst-launch-1.0 filesrc location=stream.h264 ! video/x-h264 ! h264parse ! mp4mux ! filesink location=video.mp4
-
1Ok, this gives me error from
h264parse0: GStreamer encountered a general stream error.
andstreaming stopped, reason not-negotiated
. Apr 27, 2013 at 23:36 -
2gst-launch-1.0 filesrc location=stream.h264 ! video/x-h264 ! h264parse ! mp4mux ! filesink location=video.mp4– ensonicMay 1, 2013 at 20:41
-
1In gstreamer 1.16 this gives "ERROR: from element /GstPipeline:pipeline0/GstMP4Mux:mp4mux0: Could not multiplex stream." Sep 18, 2019 at 17:47
-
@user1145922 see previous comment (and now updated example). From gst-inspect-1.0 for both h264parse and mp4mux you can see that the pad templates are compatible. If it does not work for you please post a gist with the fiull log output.– ensonicOct 20, 2019 at 18:57
-
@ensonic I think the problem I was having was caused by the file I was using not actually being a .h264 file even though it was labeled as such. It was really a MPEG-2 TS with a h264 stream in it. Oct 21, 2019 at 19:22