i.MX8M Plus gstreamer deconder encoder issues

cancel
Showing results for 
Search instead for 
Did you mean: 

i.MX8M Plus gstreamer deconder encoder issues

116 Views
Oleh
Contributor II

Hello, i.MX community!
I'm examining i.MX8M Plus SoC for our project and try to run basic GStreamer tests.

I've demo video file with the following parameters:

Stream #0:0(eng): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv), 1920x1080, 36173 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 29 tbc (default)

Which successfully processed by this command on my PC:

$ gst-launch-1.0 filesrc location=demo_with_text.mp4 ! decodebin ! textoverlay font-desc="Sans 20" text="Hello world!" shaded-background=false ! x264enc ! mp4mux name=mp4mux ! filesink location=demo_with_text.mp4

But on i.MX8M Plus I have very weird issues:

$ gst-launch-1.0 filesrc location=demo.mp4 ! decodebin ! textoverlay font-desc="Sans 20" text="Hello world!" shaded-background=false ! vpuenc_h264 ! mp4mux name=mp4mux ! filesink location=demo_with_text.mp4
Setting pipeline to PAUSED ...
====== VPUENC: 4.7.0 build on May 20 2022 06:51:21. ======
wrapper: 3.0.0 (VPUWRAPPER_ARM64_LINUX Build on Jun 2 2022 08:51:59)
vpulib: 1.1.1
firmware: 1.1.1.43690
Pipeline is PREROLLING ...

====== AIUR: 4.7.0 build on May 20 2022 06:51:21. ======
Core: MPEG4PARSER_06.20.06 build on May 7 2022 07:52:31
file: /usr/lib/imx-mm/parser/lib_mp4_parser_arm_elinux.so.3.2
------------------------
Track 00 [video_0] Enabled
Duration: 0:11:24.684000000
Language: und
Mime:
video/x-h265, parsed=(boolean)true, alignment=(string)au, stream-format=(string)hev1, width=(int)1920, height=(int)1080, framerate=(fraction)30000/1001, codec_data=(buffer)01014000000080000000000078f000fcfdf8f800000f03200001002240010c01ffff014000000300800000030000030078ac0c00000fa00001c52200fa28210001002a420101014000000300800000030000030078a003c08010e7fa2eec9577a25d581000003e800007148c4022000100074401c1adf01364
------------------------
====== VPUDEC: 4.7.0 build on May 20 2022 06:51:21. ======
wrapper: 3.0.0 (VPUWRAPPER_ARM64_LINUX Build on Jun 2 2022 08:51:59)
vpulib: 1.1.1
firmware: 1.1.1.65535
VCEncCheckCfg: Invalid frameRateNum
VCEncInit: ERROR Invalid configuration

ERROR: from element /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstAiurDemux:aiurdemux0: GStreamer encountered a general stream error.
Additional debug info:
../git/plugins/aiurdemux/aiurdemux.c(1139): aiurdemux_pull_task (): /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstAiurDemux:aiurdemux0:
streaming stopped, reason error, state 3
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

I've converted my video to these parameters:

Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1088 [SAR 136:135 DAR 16:9], 1121 kb/s, 29.97 fps, 29.97 tbr, 2997 tbn, 59.94 tbc (default)

And GStreamer results are weird, the output file was 595 bytes!

$ gst-launch-1.0 filesrc location=demo.mp4 ! decodebin ! videoscale ! video/x-raw, format=NV12, width=640, height=480 ! textoverlay font-desc="Sans 20" text="Hello world!" shaded-background=false ! vpuenc_h264 ! mp4mux name=mp4mux ! filesink location=demo_with_text.mp4
Setting pipeline to PAUSED ...
====== VPUENC: 4.7.0 build on May 20 2022 06:51:21. ======
wrapper: 3.0.0 (VPUWRAPPER_ARM64_LINUX Build on Jun 2 2022 08:51:59)
vpulib: 1.1.1
firmware: 1.1.1.43690
Pipeline is PREROLLING ...

====== AIUR: 4.7.0 build on May 20 2022 06:51:21. ======
Core: MPEG4PARSER_06.20.06 build on May 7 2022 07:52:31
file: /usr/lib/imx-mm/parser/lib_mp4_parser_arm_elinux.so.3.2
------------------------
Track 00 [video_0] Enabled
Duration: 0:11:24.684017000
Language: eng
Mime:
video/x-h264, parsed=(boolean)true, alignment=(string)au, stream-format=(string)avc, width=(int)1920, height=(int)1088, framerate=(fraction)333/11, codec_data=(buffer)01640828ffe1002067640828acd940780226ffc0220021da808080a000007d20001d4c11e30632c001000568ebecb22c
------------------------
====== VPUDEC: 4.7.0 build on May 20 2022 06:51:21. ======
wrapper: 3.0.0 (VPUWRAPPER_ARM64_LINUX Build on Jun 2 2022 08:51:59)
vpulib: 1.1.1
firmware: 1.1.1.65535

Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
Redistribute latency...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:00:00.001104000
Setting pipeline to NULL ...
Freeing pipeline ...

 

0 Kudos
2 Replies

82 Views
malik_cisse
Contributor V

Hi,

Could it be that you forgot to add the parser before mp4mux like this:

vpuenc_h264 ! h264parse ! mp4mux ...
0 Kudos

98 Views
Oleh
Contributor II

Somehow, I can run it only for video 1920x1088

0 Kudos