Encode YUV420 buffer with appsrc

pchaurasia pchaurasia at gameloreinc.com
Wed Oct 4 14:37:03 UTC 2017


Hi Folks

I am looking to dump my opencv output to encoder - for creation of
compressed bitstream. THis is how I am looking to do this ...


    VideoWriter m_videoWriter;

    m_videoWriter.open("appsrc ! autovideoconvert ! omxh265enc ! matroskamux
! filesink location=test.mkv ", 0, (double)30, cv::Size(1920, 1080), true);


This looks syntatically correct and generates a bitstream for me. However,
my data is in YUV420 format, and it resides in three individual cv::Mat
(each for Y, U and V - size of U and V cv::Mat is half of cv:Mat for Y).
Could someone please help in adapting the VideoWriter above to encode data
from my matrices - cv::Mat imgY, imgU, imgV ?


Furthermore, I looked around previous posts
(http://gstreamer-devel.966125.n4.nabble.com/appsrc-to-filesink-td970865.html)
but I am unable to comprehend how to tell element after appsrc that data
given out by appsrc will be YUV420 ? Is there a way to set 'format' property
of appsrc to YUV420 ?


Thanks






--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list