Encode YUV420 buffer with appsrc

Nicolas Dufresne nicolas at ndufresne.ca
Thu Oct 5 13:02:07 UTC 2017


Le jeudi 05 octobre 2017 à 02:22 -0700, pchaurasia a écrit :
> Is there a way to specify 'pitch' in caps ? in my cv::Mat image width
> and
> pitch are different.

GStreamer calls the pitch a stride, and it's in bytes. It's not
specific using caps, but by adding GstVideoMeta. See function
gst_buffer_add_video_meta_full (). Be aware that offset is from a
GstBuffer perspective, if you have multiple GstMemory object, you need
to include the side of the previous GstMemory as needed.

>  
> 
> For example 
> 
> cv::Mat imgY ; // width = 1920, pitch = 2048.
> cv::Mat imgU ; // width = 960, pitch = 1024
> 
> These cv::Mats are created from output of GPU and I am able to
> imshow()
> them.
> 
> 
> Thanks,
> 
> 
> 
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


More information about the gstreamer-devel mailing list