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.

Linux/AM5728: About gstreamer command for Full HD H.264 Enc/Dec for AM5728 GP EVM

Part Number: AM5728
Other Parts Discussed in Thread: TEST2

Tool/software: Linux

Hi Champs,

Could you please let me know gstreamer commands for Full HD H.264 Enc/Dec for AM5728 GP EVM?
I'v read a web site below, but the commands are for HD 1280x720, not full HD. 

  o TI EP Wiki : Processor Training: Multimedia
    (processors.wiki.ti.com/.../Processor_Training:_Multimedia)

    - Running a gstreamer pipeline

Regards,
j-breeze

  • Hello,

    Here is example pipeline for full HD encoding:
    gst-launch-1.0 videotestsrc num-buffers=100 ! 'video/x-raw,format=(string)NV12,width=1920,height=1080,framerate=(fraction)60/1' ! ducatih264enc level=level-51 profile=high ! queue ! h264parse ! filesink location=test.h264

    You could use the Multimedia user guide just change the caps filter with resolution/fps.

    BR
    Margarita
  • Hi Margarita,

    Thank you for your information. Actually, I'd like to decode and encode a mp4 file and I've tried following GStreamer pipeline.

    gst-launch-1.0 -v filesrc location=/home/root/test.mp4 ! qtdemux ! h264parse ! ducatih264dec ! 'video/x-raw,format=(string)NV12,width=1920,height=1080,framerate=(fraction)60/1' ! ducatih264enc level=level-51 profile=baseline ! queue ! h264parse ! mp4mux ! filesink location=test2.mp4

    And then, I got an error below. Is there anything wrong in the pipeline?

    root@am57xx-evm:/# gst-launch-1.0 -v filesrc location=/home/root/test.mp4 ! qtdemux ! h264parse ! ducatih264dec ! 'video/x-raw,format=(string)NV12,width=1920,height=1080,framerate=(fraction)60/1' ! ducatih264enc level=level-51 profile=baseline ! queue ! h264parse ! mp4mux ! filesink location=test2.mp4
    Setting pipeline to PAUSED ...
    [ 2149.953570] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
    Pipeline is PREROLLING ...
    /GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ level\=\(string\)5.1\,\ profile\=\(string\)baseline\,\ codec_data\=\(buffer\)01428033ffe1000b27428033e5403c0113f2a001000528de01ae20\,\ width\=\(int\)1920\,\ height\=\(int\)1088\,\ framerate\=\(fraction\)60/1\,\ pixel-aspect-ratio\=\(fraction\)1/1"
    /GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ level\=\(string\)5.1\,\ profile\=\(string\)baseline\,\ width\=\(int\)1920\,\ height\=\(int\)1088\,\ framerate\=\(fraction\)60/1\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ parsed\=\(boolean\)true"
    /GstPipeline:pipeline0/GstDucatiH264Dec:ducatih264dec0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)2048\,\ height\=\(int\)1184\,\ framerate\=\(fraction\)60/1\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ drm_mem\=\(boolean\)true"
    /GstPipeline:pipeline0/GstDucatiH264Dec:ducatih264dec0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ level\=\(string\)5.1\,\ profile\=\(string\)baseline\,\ width\=\(int\)1920\,\ height\=\(int\)1088\,\ framerate\=\(fraction\)60/1\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ parsed\=\(boolean\)true"
    /GstPipeline:pipeline0/GstDucatiH264Dec:ducatih264dec0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)2048\,\ height\=\(int\)1184\,\ framerate\=\(fraction\)60/1\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ drm_mem\=\(boolean\)true\,\ max-ref-frames\=\(int\)18"
    ERROR: from element /GstPipeline:pipeline0/GstQTDemux:qtdemux0: GStreamer encountered a general stream error.
    Additional debug info:
    ../../../gst-plugins-good-1.8.3/gst/isomp4/qtdemux.c(5520): gst_qtdemux_loop (): /GstPipeline:pipeline0/GstQTDemux:qtdemux0:
    streaming stopped, reason not-negotiated
    ERROR: pipeline doesn't want to preroll.
    Setting pipeline to NULL ...
    /GstPipeline:pipeline0/GstDucatiH264Dec:ducatih264dec0.GstPad:src: caps = "NULL"
    /GstPipeline:pipeline0/GstDucatiH264Dec:ducatih264dec0.GstPad:sink: caps = "NULL"
    /GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = "NULL"
    /GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = "NULL"
    /GstPipeline:pipeline0/GstQTDemux:qtdemux0.GstPad:video_0: caps = "NULL"
    Freeing pipeline ...
    root@am57xx-evm:/

    Regards,
    j-breeze

  • Hello,

    Please try this:
    gst-launch-1.0 -v filesrc location=/home/root/test1.mov ! qtdemux ! h264parse ! ducatih264dec ! vpe ! 'video/x-raw,format=(string)NV12,width=1920,height=1080,framerate=(fraction)30/1' ! queue ! ducatih264enc level=level-51 profile=baseline ! queue ! h264parse ! mp4mux ! filesink location=test2.mp4

    This is working on my side.


    BR
    Margarita

  • Hi Margarita,

    Thank you for your prompt reply. The command you told me works.

    And I'd like to ask you one more thing. I've tried following GStreamer pipeline for RTP streaming. But it does not send a data to network.
    Is there anything wrong in it?

    …! ducatih264enc level=level-51 profile=baseline ! rtph264pay ! udpsink host=X.X.X.X

    Regards,
    j-breeze

  • Hi Margarita,

    Could you please give me some advice?

    Regards,
    j-breeze

  • Hello,

    Could you post full pipeline that you are using?

    I would recommend you to try something like:

    !  queue ! ducatih264enc <set properties> ! queue ! h264parse ! queue ! mpegtsmux ! udpsink port=x host=x.x.x.x  sync=false

    or

    !  queue ! ducatih264enc <set properties> ! queue ! h264parse ! queue ! rtph264pay  ! udpsink port=x host=x.x.x.x  sync=false

    In both cases I would recommend you to add parser after encoder.

    j-breeze said:
    But it does not send a data to network.
    Is there anything wrong in it?

    Do you see any errors ? If yes, could you post it.

    BR
    Margarita

  • Hi Margarita,

    The command below works. I appreciated your support.

    …! ducatih264enc level=level-51 profile=baseline ! mpegtsmux ! rtpmp2tpay ! udpsink host=X.X.X.X

    Regards,
    j-breeze

  • Hello,


    I am glad that this issue is solved.

    For the new issue/question please open a new topic. I am closing this one.

    BR
    Margarita