G-streamer Transcoding on iMX8QuadMax

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

G-streamer Transcoding on iMX8QuadMax

1,159 Views
ottob
Contributor IV

Hello There !

 

This pipeline works 

gst-launch-1.0 -v filesrc location=/run/media/sda1/Big_Buck_Bunny_1080_10s_30MB.mp4 ! qtdemux ! h264parse ! v4l2h264dec ! imxvideoconvert_g2d ! v4l2convert ! v4l2h264enc ! filesink location=/tmp/test.mp4

But it uses a lot of CPU, which is likely due to it not using zero-copy DMA. Real time transcoding is not possible as it takes about twice as long as the duration of the video. 

I tried adding in the io-mode, as suggested in the NXP Gstreamer manual 

gst-launch-1.0 -v filesrc location=/run/media/sda1/Big_Buck_Bunny_1080_10s_30MB.mp4 ! qtdemux ! h264parse ! v4l2h264dec output-io-mode=dmabuf-import  ! imxvideoconvert_g2d ! v4l2convert ! v4l2h264enc capture-io-mode=dmabuf-import ! filesink location=/tmp/test.mp4

But that results in this error 

(gst-launch-1.0:1084): GStreamer-CRITICAL **: 00:11:27.573: gst_buffer_resize_range: assertion 'bufmax >= bufoffs + offset + size' failed
ERROR: from element /GstPipeline:pipeline0/GstQTDemux:qtdemux0: Internal data stream error.
Additional debug info:
../../../git/gst/isomp4/qtdemux.c(6605): gst_qtdemux_loop (): /GstPipeline:pipeline0/GstQTDemux:qtdemux0:

 

This is using 5.4.24-2 Kernel with gstreamer 1.16.1 

 

Any ideas on how to get around this problem ? 

 

Thanks in advance, 

/Otto

 

 

 

 

 

0 Kudos
4 Replies

1,133 Views
joanxie
NXP TechSupport
NXP TechSupport

could you send your file to me? let me reproduce this

0 Kudos

1,122 Views
ottob
Contributor IV

Hi Joanxie !

 

See attached. Thanks for looking into this 

 

/Otto

0 Kudos

1,016 Views
joanxie
NXP TechSupport
NXP TechSupport

I found a dam buffer command like this, you can refer to it:

$ gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=300 io-mode=dmabuf ! \
'video/x-raw,format=(string)NV12,width=1920,height=1080,framerate=(fraction)30/1' ! \
queue ! v4l2h264enc output-io-mode=dmabuf-import ! avimux ! filesink location=test.avi

 

0 Kudos

975 Views
ottob
Contributor IV

Hi There !

Thanks, although this does not transcode 

0 Kudos