Gstreamer multifilesrc PNG to MP4 with imxvpuenc_h264 error

cancel
Showing results for 
Search instead for 
Did you mean: 

Gstreamer multifilesrc PNG to MP4 with imxvpuenc_h264 error

Jump to solution
2,224 Views
alephbeth
Contributor I
Hej,
I'm trying to launch the following gstreamer pipeline on an IMX6 board to convert four png images to an mp4 movie using hardware accelerated encoding:
GST_DEBUG="*:2" gst-launch-1.0 -v -e multifilesrc location="image%05d.png" index=0 stop-index=3 caps="image/png,width=960,height=540,framerate=1/1" ! \
pngdec ! queue ! videoconvert ! imxvpuenc_h264 ! h264parse ! mp4mux ! filesink location=images.mp4
I obtain the output:
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
0:00:00.189972820 26707  0x12f0380 WARN                 basesrc gstbasesrc.c:2943:gst_base_src_loop:<multifilesrc0> error: Internal data flow error.
0:00:00.190759558 26707  0x12f0380 WARN                 basesrc gstbasesrc.c:2943:gst_base_src_loop:<multifilesrc0> error: streaming task paused, reason not-negotiated (-4)
ERROR: from element /GstPipeline:pipeline0/GstMultiFileSrc:multifilesrc0: Internal data flow error.
Additional debug info:
/path/to/yocto_guf/build-imx6guf/tmp/work/cortexa9hf-vfp-neon-guf-linux-gnueabi/gstreamer1.0/1.6.0-r0/gstreamer-1.6.0/libs/gst/base/gstbasesrc.c(2943): gst_base_src_loop (): /GstPipeline:pipeline0/GstMultiFileSrc:multifilesrc0:
streaming task paused, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
When investigating I found that the following successfully runs:
gst-launch-1.0 -v -e multifilesrc location="image%05d.png" index=0 stop-index=3 caps="image/png,width=960,height=540,framerate=1/1" ! \
pngdec ! queue ! videoconvert ! filesink location=foo
Also this works (could play the mp4 with playbin):
gst-launch-1.0 videotestsrc num-buffers=1 ! imxvpuenc_h264 ! h264parse ! mp4mux ! filesink location=i.mp4
Using GST_DEBUG="*:4" on the first command (full pipeline) reveals:
Pipeline is PREROLLING ...                                                                                                                                                          
0:00:00.263635740 29136   0xd931b0 INFO        GST_ELEMENT_PADS gstelement.c:894:gst_element_get_static_pad: no such pad 'sink' in element "multifilesrc0"                             
0:00:00.264714837 29136   0xd931b0 FIXME                default gstutils.c:3766:gst_pad_create_stream_id_internal:<multifilesrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:00.265199547 29136   0xd931b0 FIXME           videodecoder gstvideodecoder.c:1057:gst_video_decoder_drain_out:<pngdec0> Sub-class should implement drain()        
0:00:00.267156057 29136   0xd931b0 WARN                 basesrc gstbasesrc.c:2943:gst_base_src_loop:<multifilesrc0> error: Internal data flow error.                                         
0:00:00.267523090 29136   0xd931b0 WARN                 basesrc gstbasesrc.c:2943:gst_base_src_loop:<multifilesrc0> error: streaming task paused, reason not-negotiated (-4)

0:00:00.267856120 29136   0xd931b0 INFO        GST_ERROR_SYSTEM gstelement.c:1837:gst_element_message_full:<multifilesrc0> posting message: Internal data flow error.     
I'm happy about any suggestions on how to fix this. Thanks in advance.
Regards, Beth
Labels (1)
0 Kudos
1 Solution
800 Views
alephbeth
Contributor I

Thanks for your reply. I could fix this, the error was the invalid image height (540, not a multiple of 8).

Anyway, the working (and cleaned-up; videoconvert is redundant, as well as mp4mux) pipeline now reads:

GST_DEBUG="*:2" gst-launch-1.0 -v -e multifilesrc location="image%05d.png" index=0 stop-index=3 caps="image/png,width=960,height=540,framerate=1/1" ! \
pngdec ! 'video/x-raw,format=i420' ! \
imxvpuenc_h264 ! filesink location=images.mp4

View solution in original post

0 Kudos
2 Replies
801 Views
alephbeth
Contributor I

Thanks for your reply. I could fix this, the error was the invalid image height (540, not a multiple of 8).

Anyway, the working (and cleaned-up; videoconvert is redundant, as well as mp4mux) pipeline now reads:

GST_DEBUG="*:2" gst-launch-1.0 -v -e multifilesrc location="image%05d.png" index=0 stop-index=3 caps="image/png,width=960,height=540,framerate=1/1" ! \
pngdec ! 'video/x-raw,format=i420' ! \
imxvpuenc_h264 ! filesink location=images.mp4

View solution in original post

0 Kudos
800 Views
igorpadykov
NXP TechSupport
NXP TechSupport

HI Aleph

 gstreamer-imx is used on the case, which is not supported by nxp,

please check maintainer of gstreamer-imx plugins mentioned on
https://community.nxp.com/thread/445732

Alternatively one can try nxp nxp gstreamer plugins described in Linux Guide

in documentation

http://www.nxp.com/webapp/Download?colCode=L4.1.15_2.0.0-LINUX-DOCS&Parent_nodeId=133769948107170617... 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos