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: Sending H.264 encoded stream via RTP

Part Number: AM5728

Tool/software: Linux

Hi

  I am in the development board to execute the following order to the network to send rtp package

   root@am57xx-evm:# gst-launch-1.0 -v -e videotestsrc  ! 'video/x-raw,width=1280,height=720,framerate=30/1' ! queue ! ducatih264enc ! queue ! h264parse ! queue ! rtph264pay ! queue ! udpsink host=192.168.0.42 port=5000 

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720, 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)1280, height=(int)720, 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)1280, height=(int)720, 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)1280, height=(int)720, 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)1280, height=(int)720, 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)1280, height=(int)720, 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)1280, height=(int)720, 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)1280, height=(int)720, 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)1280, height=(int)720, 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)1280, height=(int)720, 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)1280, height=(int)720, 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)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstDucatiH264Enc:ducatih264enc0.GstPad:src: caps = video/x-h264, width=(int)1280, height=(int)720, 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)1280, height=(int)720, 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)1280, height=(int)720, 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)1280, height=(int)720, 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)01640028ffe1003c27640028ad84054562b8ac5471080a8ac57158a8e210248521393c9f27e4fe4fc9f279b9b34d081242909c9e4f93f27f27e4f93cdcd9a6cac05005b901000528de01ae2c
/GstPipeline:pipeline0/GstQueue:queue3.GstPad:sink: caps = video/x-h264, width=(int)1280, height=(int)720, 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)01640028ffe1003c27640028ad84054562b8ac5471080a8ac57158a8e210248521393c9f27e4fe4fc9f279b9b34d081242909c9e4f93f27f27e4f93cdcd9a6cac05005b901000528de01ae2c
/GstPipeline:pipeline0/GstQueue:queue3.GstPad:src: caps = video/x-h264, width=(int)1280, height=(int)720, 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)01640028ffe1003c27640028ad84054562b8ac5471080a8ac57158a8e210248521393c9f27e4fe4fc9f279b9b34d081242909c9e4f93f27f27e4f93cdcd9a6cac05005b901000528de01ae2c
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)"J2QAKK2EBUViuKxUcQgKisVxWKjiECSFITk8nyfk/k/J8nm5s00IEkKQnJ5Pk/J/J+T5PNzZpsrAUAW5\,KN4Briw\=", payload=(int)96, ssrc=(uint)3840358017, timestamp-offset=(uint)4275585698, seqnum-offset=(uint)43137
/GstPipeline:pipeline0/GstQueue:queue4.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)"J2QAKK2EBUViuKxUcQgKisVxWKjiECSFITk8nyfk/k/J8nm5s00IEkKQnJ5Pk/J/J+T5PNzZpsrAUAW5\,KN4Briw\=", payload=(int)96, ssrc=(uint)3840358017, timestamp-offset=(uint)4275585698, seqnum-offset=(uint)43137
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:sink: caps = video/x-h264, width=(int)1280, height=(int)720, 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)01640028ffe1003c27640028ad84054562b8ac5471080a8ac57158a8e210248521393c9f27e4fe4fc9f279b9b34d081242909c9e4f93f27f27e4f93cdcd9a6cac05005b901000528de01ae2c
/GstPipeline:pipeline0/GstQueue:queue4.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)"J2QAKK2EBUViuKxUcQgKisVxWKjiECSFITk8nyfk/k/J8nm5s00IEkKQnJ5Pk/J/J+T5PNzZpsrAUAW5\,KN4Briw\=", payload=(int)96, ssrc=(uint)3840358017, timestamp-offset=(uint)4275585698, seqnum-offset=(uint)43137
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)"J2QAKK2EBUViuKxUcQgKisVxWKjiECSFITk8nyfk/k/J8nm5s00IEkKQnJ5Pk/J/J+T5PNzZpsrAUAW5\,KN4Briw\=", payload=(int)96, ssrc=(uint)3840358017, timestamp-offset=(uint)4275585698, seqnum-offset=(uint)43137
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: timestamp = 4275585698
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: seqnum = 43137
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
handling interrupt.
Interrupt: Stopping pipeline ...
EOS on shutdown enabled -- Forcing EOS on the pipeline
Waiting for EOS...
Got EOS from element "pipeline0".
EOS received - stopping pipeline...
Execution ended after 0:00:13.928886425
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

but when I try to receive the stream with vlc ,  I get nothing

vlc -vvv rtp://192.168.0.42:5000

 

 

  • Hello,

    The pipeline that you are using, it seems  you are streaming elementary stream.
    You could try to mux the stream before sending it.

    Please check these links regarding VLC and playing h264 elementary stream:
    reolink.com/.../
    forum.videolan.org/viewtopic.php
    You could search for more how h264 elementary stream could be played via VLC as well.

    BR
    Margarita

  • Hello:
    Can you provide an example of capture + h264 encoding + RTSP send?
  • Hello,

    Have you tried to add mux element?
    The pipeline will be something like :

    .........h264parse ! queue ! qtmux ! udpsink host=192.168.0.42 port=5000

    Please check this guide there are example pipelines:
    processors.wiki.ti.com/.../Processor_Training:_Multimedia

    Also check this link it could be helpful there is an example capture -> streaming, capture->save in the file and live preview and the same time.

    e2e.ti.com/.../2080383

    BR
    Margarita
  • Hello:

    I have used mux but vlc still can not play video?

    root@am57xx-evm:~# gst-launch-1.0 -v -e videotestsrc ! 'video/x-raw, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! queue ! ducatih264enc ! queue ! h264parse ! queue ! qtmux ! udpsink host=192.168.0.42 port=5000 sync=false
    Setting pipeline to PAUSED ...
    Pipeline is PREROLLING ...
    /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720, 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)1280, height=(int)720, 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)1280, height=(int)720, 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)1280, height=(int)720, 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)1280, height=(int)720, 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)1280, height=(int)720, 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)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
    /GstPipeline:pipeline0/GstQueue:queue1.GstPad:sink: caps = video/x-h264, alignment=(string)au, stream-format=(string)byte-stream, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
    /GstPipeline:pipeline0/GstQueue:queue1.GstPad:sink: caps = video/x-h264, alignment=(string)au, stream-format=(string)byte-stream, width=(int)1280, height=(int)720, 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)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
    /GstPipeline:pipeline0/GstDucatiH264Enc:ducatih264enc0.GstPad:src: caps = video/x-h264, width=(int)1280, height=(int)720, 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:queue1.GstPad:sink: caps = video/x-h264, width=(int)1280, height=(int)720, 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:queue1.GstPad:sink: caps = video/x-h264, width=(int)1280, height=(int)720, 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)1280, height=(int)720, 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)1280, height=(int)720, 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)01640028ffe1003c27640028ad84054562b8ac5471080a8ac57158a8e210248521393c9f27e4fe4fc9f279b9b34d081242909c9e4f93f27f27e4f93cdcd9a6cac05005b901000528de01ae2c
    /GstPipeline:pipeline0/GstQueue:queue2.GstPad:sink: caps = video/x-h264, width=(int)1280, height=(int)720, 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)01640028ffe1003c27640028ad84054562b8ac5471080a8ac57158a8e210248521393c9f27e4fe4fc9f279b9b34d081242909c9e4f93f27f27e4f93cdcd9a6cac05005b901000528de01ae2c
    /GstPipeline:pipeline0/GstQueue:queue2.GstPad:sink: caps = video/x-h264, width=(int)1280, height=(int)720, 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)01640028ffe1003c27640028ad84054562b8ac5471080a8ac57158a8e210248521393c9f27e4fe4fc9f279b9b34d081242909c9e4f93f27f27e4f93cdcd9a6cac05005b901000528de01ae2c
    /GstPipeline:pipeline0/GstQTMux:qtmux0.GstPad:src: caps = video/quicktime, variant=(string)apple
    /GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = video/quicktime, variant=(string)apple
    WARNING: from element /GstPipeline:pipeline0/GstQTMux:qtmux0: Downstream is not seekable and headers can't be rewritten
    Additional debug info:
    ../../../gst-plugins-good-1.2.3/gst/isomp4/gstqtmux.c(1658): gst_qt_mux_start_file (): /GstPipeline:pipeline0/GstQTMux:qtmux0
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock


    Here is my use of vlc error message:

  • Hello,

    Could you check the log for details as VLC "says"?
    On board site is seems all running.

    BR
    Margarita
  • Hello,

    Could you try by running VLC from command line?
    wiki.videolan.org/.../
    wiki.videolan.org/.../

    Let me know the result.

    BR
    Margarita
  • Hello:
    I tried using vlc on the PC to receive the rtp stream:
         vlc -vvv rtp://192.168.0.42:5000   
    vlc debug information is as follows:
    red part of the error message
    [0x7f29b80009b8] main input debug: Creating an input for 'rtp://192.168.0.42:5000'
    [0x7f29b80009b8] main input debug: using timeshift granularity of 50 MiB, in path '/tmp'
    [0x7f29b80009b8] main input debug: `rtp://192.168.0.42:5000' gives access `rtp' demux `' path `192.168.0.42:5000'
    [0x7f29b80009b8] main input debug: enforced demux ` h264'
    [0x7f29b80009b8] main input debug: creating demux: access='rtp' demux='h264' location='192.168.0.42:5000' file='(null)'
    [0x7f29bc000e28] main demux debug: looking for access_demux module matching "rtp": 20 candidates
    [0x7f29bc000e28] main demux debug: net: opening 192.168.0.42 datagram port 5000
    [0x7f29bc000e28] main demux error: socket bind error (Cannot assign requested address)
    [0x7f29bc000e28] main demux debug: no access_demux modules matched
    [0x7f29b80009b8] main input debug: creating access 'rtp' location='192.168.0.42:5000', path='(null)'
    [0x7f29bc0018f8] main access debug: looking for access module matching "rtp": 25 candidates
    [0x7f29bc0018f8] main access debug: no access modules matched
    [0x7f29b80009b8] main input error: open of `rtp://192.168.0.42:5000' failed
    [0x17a14a8] main playlist debug: dead input
    [0x17a14a8] main playlist debug: changing item without a request (current 0/1)
    [0x17a14a8] main playlist debug: nothing to play
    [0x178d068] main libvlc debug: exiting
    [0x178d068] main libvlc debug: removing all interfaces
    [0x178d068] main libvlc debug: exiting
    [0x17c3448] main interface debug: removing module "qt4"
    [0x17a14a8] main playlist debug: deactivating the playlist
    [0x1855f78] main audio output debug: removing module "pulse"
    [0x17c3448] qt4 interface debug: requesting exit...
    [0x17c3448] qt4 interface debug: waiting for UI thread...
    [0x17c3448] qt4 interface debug: QApp exec() finished
    [0x17c3448] qt4 interface debug: Video is not needed anymore
    [0x17c3448] qt4 interface debug: Killing extension dialog provider
    [0x17c3448] qt4 interface debug: ExtensionsDialogProvider is quitting...
    [0x7f29dc3dcdf8] main generic debug: removing module "lua"
    [0x7f29dc3dcdf8] lua generic debug: Deactivating all loaded extensions
    [0x7f29dc3dcdf8] lua generic debug: All extensions are now deactivated
    [0x17bf5e8] main interface debug: removing module "dbus"
    [0x17a8278] main interface debug: removing module "globalhotkeys"
    [0x17a90b8] main interface debug: removing module "hotkeys"
    [0x17a14a8] main playlist debug: destroying
    [0x17b9578] main playlist export debug: saving Media Library to file /home/wangnan/.local/share/vlc/ml.xspf
    [0x17b9578] main playlist export debug: looking for playlist export module matching "export-xspf": 4 candidates
    [0x17b9578] main playlist export debug: using playlist export module "export"
    [0x17b9578] main playlist export debug: removing module "export"
    [0x178d068] main libvlc debug: removing stats

    So I do not know whether the error is from my sending command or vlc receiving command?
  • Hello,

    Could you try to ping PC->board and board->PC.
    If you are using udpsink in gstreamer pipeline could you try :
    vlc -vvv udp://ip:port

    wiki.videolan.org/.../

    BR
    Margarita
  • Hello,

     

    user4205571 said:
     So I do not know whether the error is from my sending command or vlc receiving command?

    On your board it seems that gstreamer is running:


     

    user4205571 said:
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock 

    BR
    Margarita

  • Hello,

    In additional you could try to receive the video stream by using gstreamer on PC side instead of VLC.

    BR
    Margarita
  • Hello:
    Can you provide a detailed gstreamer command on PC side instead of VLC?
  • Hello,

    I am sorry for the delay.

    This depends on what is the gstreamer version that you have on PC.

    In case that you have installed gstreamer version 0.10 you could try with:
    gst-launch-0.10 udpsrc port=5000 ! 'application/x-rtp, media=(string)video, clock-rate=(int)90000, payload=(int)96' ! rtph264depay ! ffdec_h264 ! xvimagesink sync=false

    In case of gstreamer version 1.0:
    gst-launch-1.0 udpsrc port=5000 ! 'application/x-rtp, media=(string)video, clock-rate=(int)90000, payload=(int)96' ! rtph264depay ! avdec_h264 ! xvimagesink sync=false

    In both cases the video that you are streaming is mux in some format you should add demuxer in the pipeline on PC side.

    The pipelines above should decode elementary stream(the pipeline in your first post).

    Hope this helps.

    BR
    Margarita