08-19-2020 01:31 AM
I use Petalinux to build the system run on ZCU102 board. I have played .webm video format sucessfully, but when I try to play a .mp4 video format I met an error:
The error is shown below:
root@xilinx-zcu102-2020_1:~/honglc_samples/segmentation# gst-launch-1.0 filesrc location=./video/traffic.mp4 ! qtdemux name=demux demux.video_0 ! h264parse ! omxh264dec ! queue max-size-bytes=0 ! kmssink bus-id=fd4a0000.zynqmp-display fullscreen-overlay=1
Setting pipeline to PAUSED ...
[2020-08-19 05:02:20.494530490] [omx_core.cpp:181] [OMX_GetHandle] Couldnt allocate dma allocator (tried using /dev/allegroDecodeIP)
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstOMXH264Dec-omxh264dec:omxh264dec-omxh264dec0: Could not initialize supporting library.
Additional debug info:
../../../../git/gst-libs/gst/video/gstvideodecoder.c(2614): gst_video_decoder_change_state (): /GstPipeline:pipeline0/GstOMXH264Dec-omxh264dec:omxh264dec-omxh264dec0:
Failed to open decoder
Setting pipeline to NULL ...
Freeing pipeline ...
I have installed the H264 enc/dec libaries, but can not fix the error:
root@xilinx-zcu102-2020_1:~/honglc_samples/segmentation# gst-inspect-1.0 | grep h264
typefindfunctions: video/x-h264: h264, x264, 264
rtp: rtph264depay: RTP H264 depayloader
rtp: rtph264pay: RTP H264 payloader
uvch264: uvch264mjpgdemux: UVC H264 MJPG Demuxer
uvch264: uvch264src: UVC H264 Source
omx: omxh264enc: OpenMAX H.264 Video Encoder
omx: omxh264dec: OpenMAX H.264 Video Decoder
videoparsersbad: h264parse: H.264 parser
Could you help me on this?
08-26-2020 07:21 AM
The ZCU102 does not include the Video Codec Unit (VCU) which allows to encode/decode H264/H265 video files. Thus there is no HW to do the decoding. I guess this is the issue you are facing.
You need to use a board which has a ZU-EV part as the ZCU104 or ZCU106.
08-26-2020 02:45 PM - edited 08-26-2020 02:45 PM
Would you share the followings to investigate the route cause ?
- Boot log message
=> Make sure whether some IPs are properly initialized or not.
- debug log with gst-debug-level
=> Run the following command to output debug message. Make sure how to launch gstreamer's pipeline.
gst-launch-1.0 --gst-debug-level=3 filesrc location=./video/traffic.mp4 ! qtdemux name=demux demux.video_0 ! h264parse ! omxh264dec ! queue max-size-bytes=0 ! kmssink bus-id=fd4a0000.zynqmp-display fullscreen-overlay=1
- make sure file information of "traffic.mp4" to set properly caps. on gstreamer's pipeline. (=> I guess it's the route cause.)
=> Run the following to make sure file information by ffmpeg
ffmpeg -i traffic.mp4
08-27-2020 08:31 PM
Thank you for your replying, I have fixed this error.
The solution is we need to install the avdec_h264 plugin for GStreamer.
By the way in the file petalinux_project_dir/project-spec/meta-user/conf; we need to add following lines:
PACKAGECONFIG_append_pn-gstreamer1.0-plugins-ugly = " x264"
08-27-2020 09:02 PM
Thank you for sharing your solution.
Oh, I forgot the device on ZCU102 is ZCU9EG. Not EV series.
So, you can't use omxh264dec...
>By the way in the file petalinux_project_dir/project-spec/meta-user/conf; we need to add following lines:
>PACKAGECONFIG_append_pn-gstreamer1.0-plugins-ugly = " x264"
Yes. You need software decoder for H.264. So, you need to add "x264" (software decoder element) on "gstreamer1.0-plugins-ugly".
I hope it helps.
02-15-2021 09:42 PM
I have the same problem and I need to add the avdec_h264 plugin. However, when I added PACKAGECONFIG_append_pn-gstreamer1.0-plugins-ugly = " x264" to the path:
After building the petalinux project, there was still no avdec_h264 plugin.
I use petalinux2020.1 and ZCU104. Is there something I forgot when I added this plugin?