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 h.264 encoding rtp application using gstreamer

Other Parts Discussed in Thread: AM5728

Tool/software: Linux

Hi All,

I am trying to make encoding application which useing the Appsrc with a camera that has a custom Api,and send H.264 output to pc by rtp on AM5728 evm.

Trying 352 * 288 image,it is very smooth.But change to 720 * 480, there is a error: "Error: Could not encode stream" from api "gst_message_parse_error"(190~194 lines in
ip_camera.c).
I try other resolution ratio:1920 * 1080、500 * 400,the error is still.I can not find the reason , so please help me to check my code.

thanks a lot !!!!

4062.ip_camera.c

  • Hi,

    This has been forwarded to the video experts. Feedback will be posted here.

    Best Regards,
    Yordan
  • What is the SDK version being used here?
    Share the error returned from encoder pluggin
  • thank you for your reply, sdk version is 3.00.00.04.

    If using command:

    gst-launch-1.0 -v -e videotestsrc pattern=ball ! queue ! 'video/x-raw,width=1920,height=1080,framerate=30/1' ! queue ! ducatih264enc ! queue ! h264parse ! queue ! rtph264pay 

    pt=96 ! queue ! udpsink host=192.168.1.111 port=5000 sync=false

    different resolution ratio include 1920 * 1080 and 720 * 480 is very smooth,and no error in h.264 encoding,

    so I am puzzled,Is these some bugs in "ducatih264enc"?


    Waiting for your reply, Thanks

     

  • DAZHI SUN said:
    different resolution ratio include 1920 * 1080 and 720 * 480 is very smooth,and no error in h.264 encoding,

    The statement is little confusing. Are you meaning to say that 1920*1080 and 720*480 resolution is working? What is not working? Share exact gstreamer pipeline that doesn't work. 

  • I am confusing too.

    If using command:

    gst-launch-1.0 -v -e videotestsrc pattern=ball ! queue ! 'video/x-raw,width=1920,height=1080,framerate=30/1' ! queue ! ducatih264enc ! queue ! h264parse ! queue ! rtph264pay

    pt=96 ! queue ! udpsink host=192.168.1.111 port=5000 sync=false

    different resolution ratio include 1920 * 1080 and 720 * 480 is very smooth,and no error in h.264 encoding.

    But coding below:

    3678.ip_camera.c

    Only 352 * 288 is  smooth, other resolution ratio(1920 * 1080、500 * 400), there is a error: "Error: Could not encode stream" from api "gst_message_parse_error",so what is different between command and code? or Is there some bug about  "ducatih264enc" api in SDK 3.00.00.04?

    Thanks!!!

  • There is no bug in ducatih264enc. You may not be setting some of the encoders parameters properly in your code. To see the difference in encoder settings, you can launch gst-launch with --gst-debug=ducatih264enc:4 option. This will print the encoder configuration for different resolution and you can check those against your code.
  • Thank you for your reply!

    I try your suggestion:

    Command:

    gst-launch-1.0 --gst-debug=ducatih264enc:4 -v -e videotestsrc pattern=ball ! queue ! 'video/x-raw,width=1920,height=1080,framerate=30/1' ! queue ! ducatih264enc ! queue ! h264parse ! queue ! rtph264pay  pt=96 ! queue ! udpsink host=192.168.1.111 port=5000 sync=false

    Print information:

    Setting pipeline to PAUSED ...
    Pipeline is PREROLLING ...
    /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
    /GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
    /GstPipeline:pipeline0/GstQueue:queue1.GstPad:sink: caps = video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
    /GstPipeline:pipeline0/GstQueue:queue1.GstPad:src: caps = video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
    /GstPipeline:pipeline0/GstDucatiH264Enc:ducatih264enc0.GstPad:sink: caps = video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
    /GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
    /GstPipeline:pipeline0/GstDucatiH264Enc:ducatih264enc0.GstPad:src: caps = video/x-h264, alignment=(string)au, stream-format=(string)byte-stream, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
    /GstPipeline:pipeline0/GstQueue:queue2.GstPad:sink: caps = video/x-h264, alignment=(string)au, stream-format=(string)byte-stream, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
    /GstPipeline:pipeline0/GstQueue:queue2.GstPad:src: caps = video/x-h264, alignment=(string)au, stream-format=(string)byte-stream, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
    /GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = video/x-h264, alignment=(string)au, stream-format=(string)byte-stream, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
    /GstPipeline:pipeline0/GstDucatiH264Enc:ducatih264enc0.GstPad:src: caps = video/x-h264, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, stream-format=(string)byte-stream, align=(string)au, num-reorder-frames=(int)3, profile=(string)high, level=(string)4
    /GstPipeline:pipeline0/GstQueue:queue2.GstPad:sink: caps = video/x-h264, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, stream-format=(string)byte-stream, align=(string)au, num-reorder-frames=(int)3, profile=(string)high, level=(string)4
    /GstPipeline:pipeline0/GstQueue:queue2.GstPad:sink: caps = video/x-h264, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, stream-format=(string)byte-stream, align=(string)au, num-reorder-frames=(int)3, profile=(string)high, level=(string)4
    /GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = video/x-h264, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, stream-format=(string)byte-stream, align=(string)au, num-reorder-frames=(int)3, profile=(string)high, level=(string)4
    /GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = video/x-h264, width=(int)1920, height=(int)1088, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, stream-format=(string)avc, align=(string)au, num-reorder-frames=(int)3, profile=(string)high, level=(string)4, parsed=(boolean)true, alignment=(string)au, codec_data=(buffer)01640028ffe1003e27640028ad84054562b8ac5471080a8ac57158a8e210248521393c9f27e4fe4fc9f279b9b34d081242909c9e4f93f27f27e4f93cdcd9a6cac0780227e54001000528de01ae2c
    /GstPipeline:pipeline0/GstQueue:queue3.GstPad:sink: caps = video/x-h264, width=(int)1920, height=(int)1088, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, stream-format=(string)avc, align=(string)au, num-reorder-frames=(int)3, profile=(string)high, level=(string)4, parsed=(boolean)true, alignment=(string)au, codec_data=(buffer)01640028ffe1003e27640028ad84054562b8ac5471080a8ac57158a8e210248521393c9f27e4fe4fc9f279b9b34d081242909c9e4f93f27f27e4f93cdcd9a6cac0780227e54001000528de01ae2c
    /GstPipeline:pipeline0/GstQueue:queue3.GstPad:sink: caps = video/x-h264, width=(int)1920, height=(int)1088, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, stream-format=(string)avc, align=(string)au, num-reorder-frames=(int)3, profile=(string)high, level=(string)4, parsed=(boolean)true, alignment=(string)au, codec_data=(buffer)01640028ffe1003e27640028ad84054562b8ac5471080a8ac57158a8e210248521393c9f27e4fe4fc9f279b9b34d081242909c9e4f93f27f27e4f93cdcd9a6cac0780227e54001000528de01ae2c
    /GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: timestamp = 3140155822
    /GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: seqnum = 49031
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock

    Compare the information with my code, I can nof find any difference, so can you tell me how to modify my code?

    Thank you!!!