video playback with gstreamer is choppy / laggy on raspberry pi 4

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

video playback with gstreamer is choppy / laggy on raspberry pi 4

GStreamer-devel mailing list
Hello, I am trying to use gstreamer to play a 1080p H264 video. When I play the video, the playback is slightly choppy / laggy.

Here is how I installed gstreamer and the required plugins:
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-good gstreamer1.0-plugins-bad
I have a test video which you may download here: https://www.dropbox.com/s/ayeb8816wii6d ... t.mp4?dl=0

Here we can see the test video is indeed 1080p h264 format:
% ffprobe audio_video_sync_test.mp4
...
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 295 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
...
And finally, I play the video with gstreamer:
% gst-launch-1.0 -e -vvv filesrc location=audio_video_sync_test.mp4 ! qtdemux ! h264parse ! v4l2h264dec ! kmssink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstKMSSink:kmssink0: display-width = 640
/GstPipeline:pipeline0/GstKMSSink:kmssink0: display-height = 480
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)4, profile=(string)high, codec_data=(buffer)01640028ffe1001e67640028acd100780227e5c05a808080a0000003002000000781e306224001000468ebef2c, width=(int)1920, height=(int)1080, framerate=(fraction)30/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)4, profile=(string)high, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true
/GstPipeline:pipeline0/v4l2h264dec:v4l2h264dec0.GstPad:sink: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, level=(string)4, profile=(string)high, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true
/GstPipeline:pipeline0/v4l2h264dec:v4l2h264dec0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)1920, height=(int)1080, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2, colorimetry=(string)bt709, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstKMSSink:kmssink0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)1920, height=(int)1080, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2, colorimetry=(string)bt709, framerate=(fraction)30/1
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
The playback is mostly ok, but as you can see it is occasionally a bit laggy. The same video plays without any lag with vlc or omxplayer. Playback with gstreamer uses only about 4% CPU, so I figure it must be using hardware decoding. Any idea what the issue is?

Here is info about my OS in case it is helpful (I'm just using the default OS)
% uname -a
Linux piwall2 5.4.83-v7l+ #1379 SMP Mon Dec 14 13:11:54 GMT 2020 armv7l GNU/Linux
Thanks for looking!

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: video playback with gstreamer is choppy / laggy on raspberry pi 4

GStreamer-devel mailing list
Try to put a "queue" element after demuxer and decoder elements.




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: video playback with gstreamer is choppy / laggy on raspberry pi 4

GStreamer-devel mailing list
I have tried putting a queue or queue2 element in my pipeline, but it did not
help.

Here is what I tried:

gst-launch-1.0 -e -vvv filesrc location=audio_video_sync_test.mp4 ! qtdemux
! queue ! h264parse ! v4l2h264dec ! queue ! kmssink

I tried putting a queue or queue2 element after either the qtdemux or
v4l2h264dec elements, and also after both elements.

I also tried using "v4l2h264dec capture-io-mode=4" as recommended in one
forum post: https://www.raspberrypi.org/forums/viewtopic.php?f=67&t=240274

Here is a video of the graphics glitches that are occurring for me, in case
it is enlightening for anyone: https://photos.app.goo.gl/b6FPuphAbMKdCgTMA

The glitches start happening at timestamp 0:42 and continue until the end of
the video. The time at which the glitches occur appears to be fairly random.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel