gstreamer-opencv icon indicating copy to clipboard operation
gstreamer-opencv copied to clipboard

gst_app_src_push_buffer successfully but can no show video

Open ghost opened this issue 7 years ago • 3 comments

Hi , I have a problem of running your code demo about appsrc / appsink Here is my main pipleline

filesrc location=/usr/local/1080P.mp4 ! decodebin name=dec ! videoconvert ! appsink name="myappsink"
appsrc name="myappsrc" ! autovideosink

And I can make it work directly by filesrc location=/usr/local/1080P.mp4 ! decodebin name=dec ! videoconvert ! autovideosink But when running the code in

bool GstAppSrcPipeline::SendBUF(GstBuffer* buffer)
{
    boost::mutex::scoped_lock(pushBufferFlagMutex);
    if (!needsData) {
        std::cout << "CHANGED\n";
        return false;
    }

    if (buffer) {
        if (needsData){
            GstFlowReturn ret = gst_app_src_push_buffer((GstAppSrc*)appsrc, buffer); // buffer released automatically
            if(ret != GST_FLOW_OK){
            	std::cout << "GstFlowReturn no OK";
            }
        }

    }

    return true;
}

It show me that everytime I have successfully push buffer to the appsrc . But I can no visual the video . Any help would be appreciate ! Thanks .

ghost avatar Mar 31 '18 13:03 ghost

autovideosink换成具体的sink测试吧

wzyy2 avatar Mar 31 '18 17:03 wzyy2

具体的sink依然不行

ghost avatar Apr 01 '18 06:04 ghost

在autovideosink前加一个videoconvert就可以了。感谢

ghost avatar Apr 01 '18 08:04 ghost