Hi, as I understand h264(AVC) format should be put into .mp4 container, but Freescales gstreamer plugin doesn't allow it. Using this command:
gst-launch -v --gst-debug=2 mfw_v4lsrc capture-width=640 capture-height=480 capture-mode=0 num-buffers=150 ! queue ! mfw_vpuencoder codec-type=2 bitrate=0 qp=30 gopsize=32000 ! queue ! mp4mux ! filesink location=codec2_muxmp4.mp4
I get error:
| 0:00:00.340959654 2036 | 0x8bd50 WARN | qtmux gstqtmux.c:3093:gst_qt_mux_video_sink_set_caps:<mp4mux0> no stream-format field in h264 caps |
| 0:00:00.341116779 2036 | 0x8bd50 WARN | qtmux gstqtmux.c:3251:gst_qt_mux_video_sink_set_caps:<mp4mux0> pad video_00 refused caps video/x-h264, height=(int)480, width=(int)640, framerate=(fraction)30/1 |
| 0:00:00.368152154 2036 | 0x8bdb0 ERROR | mfw_vpuencoder mfw_gst_vpu_encoder.c:1691:mfw_gst_vpuenc_send_buffer: >>VPU_ENC: Error -4 in Pushing the Output to Source Pad |
| 0:00:00.391161654 2036 | 0x8c0f0 WARN | basesrc gstbasesrc.c:2625:gst_base_src_loop:<mfwgstv4lsrc0> error: Internal data flow error. |
| 0:00:00.391305404 2036 | 0x8c0f0 WARN | basesrc gstbasesrc.c:2625:gst_base_src_loop:<mfwgstv4lsrc0> error: streaming task paused, reason not-negotiated (-4) |
ERROR: from element /GstPipeline:pipeline0/MFWGstV4LSrc:mfwgstv4lsrc0: Internal data flow error.
If I choose mpeg4 encoder, then it works.
gst-launch -v mfw_v4lsrc capture-width=640 capture-height=480 capture-mode=0 num-buffers=150 ! queue ! mfw_vpuencoder codec-type=0 bitrate=0 qp=30 gopsize=32000 ! queue ! mp4mux ! filesink location=codec0_muxmp4.mp4\
Why is that so?
Its important to use mp4, because I want to play these videos in browser using new HTML5 standard which allows mp4, ogg. I would like to use codec-type=2, because it gives better quality for the same size. Videos created with codec-type=0 can't be played via HTML5. I tried using qtmux too.
Can someone advise the right encoding parameters that would work out of the box or should I use avimux and then on server convert videos to the right format. Don't want to to this really because of extra converting and there is some information that h264 shouldn't be put in avi container.
Thank you.