Hi everyone,
Release: L4.14.98_2.0.0_ga_images_MX8MMEVK.zip
Board: i.MX8MM EVK
I found that adding imxvideoconvert_g2d element to GStreamer will cause frame loss. Here are some tests I did using the official GStreamer RTSP Demo.
Test conditions:
Input source: /dev/video0 1080p 60fps uyvy format
Player: liveplayer (bin) 20170408
rtsp demo code:https://github.com/GStreamer/gst-rtsp-server/blob/master/examples/test-launch.c
1.Do not add imxvideoconvert_g2d element, direct transmission after encoding
Enter command:
./test-launch -p 554 "v4l2src device=/dev/video0 ! video/x-raw,format=UYVY,width=1920,height=1080 ! queue ! vpuenc_h264 bitrate=4096 ! rtph264pay name=pay0 pt=96"
Test results:
It is normal that the input source is 60fps and it is still 60fps after transmission
2.Add imxvideoconvert_g2d element, transmission after encoding
Enter command:
./test-launch -p 554 "v4l2src device=/dev/video0 ! video/x-raw,format=UYVY,width=1920,height=1080 ! queue ! imxvideoconvert_g2d ! video/x-raw,width=1920,height=1080 ! videorate ! video/x-raw,framerate=(fraction)60/1 ! vpuenc_h264 bitrate=4096 ! rtph264pay name=pay0 pt=96"
Test results:
The input source is 60fps. After transmission, it becomes 52 ~ 54fps, so the frame is lost. Moreover, the 4m code rate was originally set, but the player displays only about 3.8m code rate.
3.Add imxvideoconvert_g2d element, add a videorate element to set the frame rate, and then transmit after encoding
Enter command:
./test-launch -p 554 "v4l2src device=/dev/video0 ! video/x-raw,format=UYVY,width=1920,height=1080 ! queue ! imxvideoconvert_g2d ! video/x-raw,width=1920,height=1080 ! videorate ! video/x-raw,framerate=(fraction)60/1 ! vpuenc_h264 bitrate=4096 ! rtph264pay name=pay0 pt=96"
Test results:
The input source is 60fps, and it is still 60fps after transmission, but the delay will add about 60ms. It is possible to use the video rate element to copy frames until 60fps is met. Therefore, the delay is too large.
My current imxvideoconvert_g2d element version:
My current videorate element version:
My current vpuenc_h264 element version:
My question:
Hi Peng
L4.14.98_2.0.0 is old release, may be recommended to try with latest L5.10.52_2.1.0
and imx-gst1.0-plugin version
https://source.codeaurora.org/external/imx/imx-gst1.0-plugin/tree/?h=MM_04.06.03_2110_L5.10.y
Best regards
igor