3

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 1

8
gst-launch-1.0 filesrc location=stream.h264 ! video/x-h264 ! h264parse ! mp4mux ! filesink location=video.mp4
6
  • 1
    Ok, this gives me error from h264parse0: GStreamer encountered a general stream error. and streaming stopped, reason not-negotiated. Apr 27, 2013 at 23:36
  • 2
    gst-launch-1.0 filesrc location=stream.h264 ! video/x-h264 ! h264parse ! mp4mux ! filesink location=video.mp4
    – ensonic
    May 1, 2013 at 20:41
  • 1
    In 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.
    – ensonic
    Oct 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.