Appsrc encoded video playback

Jon Lovewell jon at csoftware.co.uk
Thu Nov 14 10:24:50 UTC 2019


Hello everyone,

I have a system that provides me with raw encoded video frames on demand, current encodings are H264, MJPEG and H265.

I am creating a buffer for each frame and using Appsrc as the entry point into a pipeline to render them.  The pipelines are created in code but their launch line equivalents are shown below

appsrc caps="video/x-h264" format=time block=true is-live=true | queue | h264parse | avdec_h264 | autovideosink

appsrc caps="image/jpeg" format=time block=true is-live=true | queue | jpegdec | autovideosink

appsrc caps="video/x-h265" format=time block=true is-live=true | queue | h265parse | avdec_h265 | autovideosink

In addition to the video data the application also provides a couple of timestamps, one for the current frame and one for the next.

>From this information, I can determine the duration of each frame and add this to the buffer that I push into Appsrc (code snippet below)

Using GstSharp V1.16.0 with gstreamer v1.16.0 (code based on the appsrc example in the Application Development Manual, from the Pipeline Manipulation section)

                buffer.PTS = _timestamp;

                var duration = Gst.Util.Uint64Scale(durationInMs, Gst.Constants.SECOND, 1000);

                buffer.duration = duration;

                _timestamp += duration

                var flowReturn = appsrc.PushBuffer(buffer)

This all works fine when pushing h264 and mjpeg frames but I am having no luck with H265, video appears frozen for long periods interspersed with brief playback of a few frames.

Any help or information would be appreciated.

Kind Regards

Jon

PS

I have found that H265 works if I let appsrc do the timestamping.  However, this breaks h264 and mjpeg, they appear to play as fast as the frames can be delivered

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20191114/f947a069/attachment.html>


More information about the gstreamer-devel mailing list