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.

gstreamer caps in client always shows framerate as 25.

Hi,

We are using EZSDK 5_05_02_00 version for a high resolution camera project based on DM8168. We have implemented a usecase which stream H264 encoded video stream to a client with specific IP and port.

We have different framerates as input from camera and  gstreamer pipeline in server side is configured with these framerates, but for all cases, we are getting 'caps' of client side as 25Fps itself.


Is there any special parameter in encoder side is to be set to get the correct fps value at client side.?

Please help us to solve this issue.

  • Hi ABEESH,

       1) Could you share the pipeline that you are using?
       2) Are you using RTP, RTSP, UDP?
       3) Who is the client? VLC or another gstreamer pipeline?

    -David

  • Hi David,

       1) Could you share the pipeline that you are using?

    gst-launch omx_camera output-buffers=10 ! "video/x-raw-yuv, format=(fourcc)NV12, width=1920, height=1080, framerate=60/1, buffer-count-requested=2"  ! omx_h264enc input-buffers=1 output-buffers=2 force-idr-period=4 i-period=4 bitrate=28000000 profile=1 framerate=60 ! "video/x-h264, width=1920,height=1080, framerate=60/1, stream-format=byte-stream, alignment=au" ! gstperf print-fps=true print-arm-load=true ! rtph264pay ! queue !udpsink sync=false host=192.168.1.12 port=5000

    2) Are you using RTP, RTSP, UDP?

    RTP over udp.

    3) Who is the client? VLC or another gstreamer pipeline?

    Gstreamer Pipeline.

    gst-launch-0.10 udpsrc port=5000 caps=application/x-rtp,media=video,clock-rate=90000,encoding-name=H264,sprop-parameter-sets=\"J0KAKouVAPAET8qAAA\\=\\=\\,KN4BriAA\",payload=96,ssrc=1701772738,clock-base=2031560221,seqnum-base=31484 ! rtph264depay ! queue ! ffdec_h264 ! xvimagesink sync=false -v

     

     

  • Hi ABEESH,

    I tried your pipelines and I have the following comments:

    • Using output-buffers=2 in omx_h264enc plugin I could only get 55fps, so I increased the output buffers to 4 (output-buffers=4) and I was able to reach 60fps.
    • On the client site, you can use fpsdisplaysink instead of xvimagesink to see the real framerate that the pipeline is giving you. By this way I was able to check that the pipeline is displaying the video at 60fps, although the framerate reported in caps is 25fps.
    • Activating the gtreamer debugger (adding the argument --gst-debug=*ffmpeg*:4 to the pipeline) you can find a debug message like this one: 

    0:00:00.178686588 11013  0x1b4c540  DEBUG  ffmpeg gstffmpegdec.c:781:gst_ffmpegdec_setcaps:<ffdec_h2640> forcing 25/1 framerate

    That means that the ffdec_h264 plugin internally is forcing the framerate on caps to be 25/1, but really it is decoding the incoming stream at 60fps and the way to prove this is by using fpsdisplaysink that reports us the rendered and dropped frames as well as the current and average framerate.

    As summary, you can ignore the framerate reported on caps and use other tools like fpsdisplaysink to check the real framerate on the client site.

    Regards,

    Carlos

  • Hi Carios,


    Thanks for your valuable time.

    I am also getting same behaviour as you mentioned with fpsdisplaysink.

    Let me add some more observation here,

    • When we take rtsp stream over VLC player we are not getting any framerate field in codec-type tab of tools->Code Information.

    • We have also recodred the H264video using the pipeline,

    gst-launch omx_camera output-buffers=10 ! "video/x-raw-yuv, format=(fourcc)NV12, width=1920, height=1080, framerate=60/1, buffer-count-requested=2"  ! omx_h264enc input-buffers=1 output-buffers=2 force-idr-period=4 i-period=4 bitrate=15000000 profile=1 framerate=60 ! "video/x-h264, width=1920,height=1080, framerate=60/1, stream-format=byte-stream, alignment=au" ! filesink location=test.h264


    and while playing the file in VLC player it playing in slow motion, that means it takes file in low FPS.But when we are using Gstreamer pipeline "gst-launch-0.10 filesrc location = test1.h264 !  h264parse  !  "video/x-h264,stream-format=byte-stream" ! ffdec_h264 ! fpsdisplaysink sync=false " we are getting 60 fps in fpsdisplaysink.

    • Using Codevisa( A tool to analyse h264 videos), we have analysed this file and it shows POC type as 0.But when we take h264 video of another IP camera based on DM368, it shows POC type as 2. Is there any significance of this on framerate?

    Thanks,

    Abeesh.

  • Hi ABEESH,

           The encoder doesn't put the framerate information in the H264 stream as you can see here:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/337862/1180232.aspx#1180232

           So you need to parse the H264 stream and save it in a container, so VLC will play it at the correct rate. Something like:

    gst-launch -e omx_camera output-buffers=10 skip-frames=1 !  video/x-raw-yuv, format=\(fourcc\)NV12, width=1920, height=1080, framerate=\(fraction\)30/1, buffer-count-requested=10  ! omx_tvp ! gstperf print-arm-load=true print-fps=true ! omx_h264enc bitrate=10000000 profile=1 ! queue ! h264parse output-format=0 ! mp4mux dts-method=0 ! filesink location=test.mp4

    To parse the H264 stream gstreamer does some memory copies, in our version (rr_h264parse) those memcpy are avoided

    https://developer.ridgerun.com/wiki/index.php/Gstreamer_pipelines_for_DM816x_and_DM814x#Video_Encoding_MJPEG_1080.4030fps_.28on_M3_coprocessor.29

    -David