This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM572x Decoding MP4 contents

Expert 2990 points
Other Parts Discussed in Thread: AM5728

HI All

Just Now We use the below command to decoding the mp4 contents:

Our sdk is 2.00.02.11

kernel is 4.1.18

The board is a custom board.

gst-launch-1.0 -v filesrc location=/usr/share/ti/video/TearOfSteel-AV-Short-720x420.mp4 ! qtdemux ! h264parse ! ducatih264dec ! vpe ! waylandsink

But it will failed because of some error like this:

root@am57xx-evm:~# gst-launch-1.0 -v filesrc location=/usr/share/ti/video/TearOfSteel-AV-Short-720x420.mp4 ! qtdemux ! h264parse ! ducatih264dec ! vpe ! waylandsink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstQTDemux:qtdemux0: GStreamer encountered a general stream error.
Additional debug info:
/home/gtbldadm/processor-sdk-linux-fido-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa15hf-vfp-neon-linux-gnueabi/gstreamer1.0-plugins-good/1.2.3-r0-arago1/gst-plugins-good-1.2.3/gst/isomp4/qtdemux.c(4402): gst_qtdemux_loop (): /GstPipeline:pipeline0/GstQTDemux:qtdemux0:
streaming stopped, reason not-linked
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
/GstPipeline:pipeline0/GstQTDemux:qtdemux0.GstPad:video_0: caps = NULL
/GstPipeline:pipeline0/GstQTDemux:qtdemux0.GstPad:audio_0: caps = NULL
Freeing pipeline ...

We have refered to this websit  processors.wiki.ti.com/.../Processor_Training:_Multimedia

and  try the command, but it also failed.

gst-launch-1.0 -v filesrc location=example_h264.mp4 ! qtdemux ! h264parse !   \

ducatih264dec ! vpe ! 'video/x-raw, format=(string)NV12, width=(int)720, height=(int)480' ! kmssink

  • I will ask the software team to look at this.
  • OK, Thanks very much
  • Hello,

    What about if you try to play it with playbin element(check the wiki for an example)?

    You could try to add --gst-debug = 3 for more debug prints.

    It seems that the qtdemux is not linked. Are you sure that you are playing h264 stream not mpeg4 or else?

    BR
    Margarita

  • Hi Margarita
    Thanks for your reply, Please see the below

    root@am57xx-evm:~# gst-launch-1.0 --gst-debug=3 -v filesrc location=/usr/share/ti/video/TearOfSteel-AV-Short-720x420.mp4 ! qtdemux ! h264parse ! ducatih264dec ! vpe ! waylandsinkSetting pipeline to PAUSED ...
    0:00:00.124246589 1153 0x136a40 ERROR ducati gstducatividdec.c:242:codec_create:<ducatih264dec0> failed XDM_GETVERSION
    Pipeline is PREROLLING ...
    0:00:00.127409317 1153 0x1316f0 WARN qtdemux /home/gtbldadm/processor-sdk-linux-fido-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa15hf-vfp-neon-linux-gnueabi/gstreamer1.0-plugins-good/1.2.3-r0-arago1/gst-plugins-good-1.2.3/gst/isomp4/qtdemux.c:7975:qtdemux_parse_trak:<qtdemux0> unknown version 00000000
    0:00:00.130221173 1153 0x1316f0 WARN qtdemux /home/gtbldadm/processor-sdk-linux-fido-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa15hf-vfp-neon-linux-gnueabi/gstreamer1.0-plugins-good/1.2.3-r0-arago1/gst-plugins-good-1.2.3/gst/isomp4/qtdemux.c:4402:gst_qtdemux_loop:<qtdemux0> error: streaming stopped, reason not-linked
    ERROR: from element /GstPipeline:pipeline0/GstQTDemux:qtdemux0: GStreamer encountered a general stream error.
    Additional debug info:
    /home/gtbldadm/processor-sdk-linux-fido-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa15hf-vfp-neon-linux-gnueabi/gstreamer1.0-plugins-good/1.2.3-r0-arago1/gst-plugins-good-1.2.3/gst/isomp4/qtdemux.c(4402): gst_qtdemux_loop (): /GstPipeline:pipeline0/GstQTDemux:qtdemux0:
    streaming stopped, reason not-linked
    ERROR: pipeline doesn't want to preroll.
    Setting pipeline to NULL ...
    /GstPipeline:pipeline0/GstQTDemux:qtdemux0.GstPad:video_0: caps = NULL
    /GstPipeline:pipeline0/GstQTDemux:qtdemux0.GstPad:audio_0: caps = NULL
    Freeing pipeline ...
  • Hello,

    Please, verify that you are playing h264 video stream(not mpeg4), that is why I recommend you to try with playbin.

    BR
    Margarita
  • Hi Margarita
    When we run the command ,it will success
    gst-launch-1.0 --gst-debug=3 -v playbin uri=file:///usr/share/ti/video/TearOfSteel-Short-720x420.264 video-sink=waylandsink
    gst-launch-1.0 --gst-debug=3 -v playbin uri=file:///usr/share/ti/video/HistoryOfTIAV-480p.mp4 video-sink=waylandsink

    Thanks
  • Hi Margarita
    When we run the command ,it also will success
    gst-launch-1.0 -v filesrc location=/usr/share/ti/video/TearOfSteel-Short-720x420.264 ! queue ! h264parse ! ducatih264dec ! waylandsink
    thanks
  • Hello,

    When you are playing video with playbin element you could check which elements are create and link.

    The video TearOfSteel-AV-Short-720x420.mp4 seems mpeg4 encoded.


    BR
    Margarita
  • you are write, it is mpeg4 formate, thanks

    we use anther mp4,which can work,

    but we found  a issue, it is not very fluent.

    the mp4 is 1080p 30

  • Hi Quan Wang,

    The problem you had is caused by incompatible gstreamer elements with the video source file. The TearOfSteel-AV-Short-720x420.mp4 video is MPEG-4 encoded, so you can not decode it with the ducatih264dec element. If you want to use a hardware accelerated MPEG-4 decoder, you have to use the ducatimpeg4dec element.

    This a functional pipeline that I test with your same source video:
    gst-launch-1.0 filesrc location= TearOfSteel-AV-Short-720x420.mp4 ! qtdemux name=demux demux.video_0 ! queue ! mpeg4videoparse ! ducatimpeg4dec ! kmssink scale=false connector=30 -e

    Below you could find the output log of the pipeline, so you can take a look to the CAPS:
    Setting pipeline to PAUSED ...
    [ 986.691342] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
    Pipeline is PREROLLING ...
    /GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = "video/mpeg\,\ mpegversion\=\(int\)4\,\ systemstream\=\(boolean\)false\,\ profile\=\(string\)simple\,\ level\=\(string\)1\,\ codec_data\=\(buffer\)000001b001000001b58913000001000000012000c48d8800c51684349443000001b24c61766335352e36362e313030\,\ width\=\(int\)720\,\ height\=\(int\)420\,\ framerate\=\(fraction\)24/1\,\ pixel-aspect-ratio\=\(fraction\)1/1"
    /GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = "video/mpeg\,\ mpegversion\=\(int\)4\,\ systemstream\=\(boolean\)false\,\ profile\=\(string\)simple\,\ level\=\(string\)1\,\ codec_data\=\(buffer\)000001b001000001b58913000001000000012000c48d8800c51684349443000001b24c61766335352e36362e313030\,\ width\=\(int\)720\,\ height\=\(int\)420\,\ framerate\=\(fraction\)24/1\,\ pixel-aspect-ratio\=\(fraction\)1/1"
    /GstPipeline:pipeline0/GstMpeg4VParse:mpeg4vparse0.GstPad:sink: caps = "video/mpeg\,\ mpegversion\=\(int\)4\,\ systemstream\=\(boolean\)false\,\ profile\=\(string\)simple\,\ level\=\(string\)1\,\ codec_data\=\(buffer\)000001b001000001b58913000001000000012000c48d8800c51684349443000001b24c61766335352e36362e313030\,\ width\=\(int\)720\,\ height\=\(int\)420\,\ framerate\=\(fraction\)24/1\,\ pixel-aspect-ratio\=\(fraction\)1/1"
    /GstPipeline:pipeline0/GstMpeg4VParse:mpeg4vparse0.GstPad:src: caps = "video/mpeg\,\ mpegversion\=\(int\)4\,\ systemstream\=\(boolean\)false\,\ profile\=\(string\)simple\,\ level\=\(string\)1\,\ codec_data\=\(buffer\)000001b001000001b58913000001000000012000c48d8800c51684349443000001b24c61766335352e36362e313030\,\ width\=\(int\)720\,\ height\=\(int\)420\,\ framerate\=\(fraction\)24/1\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ parsed\=\(boolean\)true"
    /GstPipeline:pipeline0/GstDucatiMpeg4Dec:ducatimpeg4dec0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)768\,\ height\=\(int\)464\,\ framerate\=\(fraction\)24/1\,\ pixel-aspect-ratio\=\(fraction\)1/1"
    /GstPipeline:pipeline0/GstKMSSink:kmssink0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)768\,\ height\=\(int\)464\,\ framerate\=\(fraction\)24/1\,\ pixel-aspect-ratio\=\(fraction\)1/1"
    /GstPipeline:pipeline0/GstDucatiMpeg4Dec:ducatimpeg4dec0.GstPad:sink: caps = "video/mpeg\,\ mpegversion\=\(int\)4\,\ systemstream\=\(boolean\)false\,\ profile\=\(string\)simple\,\ level\=\(string\)1\,\ codec_data\=\(buffer\)000001b001000001b58913000001000000012000c48d8800c51684349443000001b24c61766335352e36362e313030\,\ width\=\(int\)720\,\ height\=\(int\)420\,\ framerate\=\(fraction\)24/1\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ parsed\=\(boolean\)true"
    /GstPipeline:pipeline0/GstDucatiMpeg4Dec:ducatimpeg4dec0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)768\,\ height\=\(int\)464\,\ framerate\=\(fraction\)24/1\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ max-ref-frames\=\(int\)2"
    /GstPipeline:pipeline0/GstKMSSink:kmssink0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)768\,\ height\=\(int\)464\,\ framerate\=\(fraction\)24/1\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ max-ref-frames\=\(int\)2"
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    Got EOS from element "pipeline0".
    Execution ended after 0:00:21.041521639
    Setting pipeline to PAUSED ...
    Setting pipeline to READY ...
    Setting pipeline to NULL ...
    Freeing pipeline ...


    In this link you could find a very useful guide of gstreamer pipelines fully tested on the AM5728. There you can find a link to download the same sample videos used with the pipelines. This guide is focused in hardware accelerated pipelines using GST-PLUGINS-DUCATI and GST-PLUGINS-VPE.
    LINK: developer.ridgerun.com/.../index.php

    Also, if you are interested in the multimedia performance of the AM5728 running enconde/decode pipelines of different video format streams, you could follow this link: https://developer.ridgerun.com/wiki/index.php?title=AM5728_Multimedia_Performance_Testbench


    I hope this could help you.

    Best regards,
    Eng. Daniel Garbanzo Hidalgo
    Embedded Software Developer Engineer
    RidgeRun Engineering Limitada
    www.ridgerun.com