How to sync rtspsrc, appsrc and filesink

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

How to sync rtspsrc, appsrc and filesink

Hi. Thanks in advance.
I want to record a video from an rtsp video camera and at the same time process the video frame obtained from appsink throught  new-sample signal. Then, in a separate application I read the video and show the information related to the frames.

I have this pipeline:
rtspsrc location=rtsp:// latency=100 ! rtph264depay ! tee name=t
 ! queue ! vaapidecodebin ! vaapipostproc format=rgba  !  appsink name=appsink t.
 ! queue ! h264parse ! mp4mux ! filesink sync=false name=filer location=/home/VideoDB/2017-09-04_16:33:46.mp4

GstFlowReturn GstVideoSourcePrivate::newSample(GstAppSink* sink, gpointer user_data)
        GstSample* sinkSample = gst_app_sink_pull_sample(GST_APP_SINK(sink));
        if (sinkSample) {
            GstBuffer* buffer = gst_sample_get_buffer(sinkSample);
            // I need this position to be the same as the recorded video
            GstClockTime pos;
            gst_element_query_position(self->pipeline(), GST_FORMAT_TIME, &pos);

gstreamer-devel mailing list
[hidden email]