gstreamerteegst-launch

Gstreamer Tee with different capabilities on each branch


I have a gstreamer pipeline similar to this.

                              Queue -> videoscale -> videosink
                             /
appsrc -> h264_decoder -> Tee 
                             \ 
                              Queue -> jpegenc -> multifilesink

How does Tee work with regard to capabilities on the decoder pad? Is it possible to set different capabilities on the two branches?

Specifically, is it possible to set two different framerate? Filesink stores at 1 fps, and videosink displays at 30 fps.

I am using the following command line to test.

gst-launch-1.0 -e \
    filesrc location=${1} ! queue ! qtdemux name=d d.video_0 ! h264parse ! avdec_h264 ! tee name=t \
                       t. ! queue ! videoscale ! 'video/x-raw,width=(int)960,height=(int)540' ! autovideosink \
                       t. ! queue ! 'video/x-raw,framerate=1/1' ! jpegenc ! multifilesink location=out/img1_%03d.jpeg

But I get an 'Internal data flow error' and 'reason not-linked'.


Solution

  • The problem is that you're asking different framerates on each branches of your pipeline.

    You forgot to instantiate an element that provides you a framerate of 1/1 as expected by your recording branch. videorate does that job.

    Here is the working pipeline I propose:

    gst-launch-1.0 -e \
        filesrc location=${1} ! queue ! qtdemux name=d d.video_0 ! h264parse ! avdec_h264 ! tee name=t \
                           t. ! queue ! videoscale ! 'video/x-raw,width=(int)960,height=(int)540' ! autovideosink \
                           t. ! queue ! videorate ! 'video/x-raw,framerate=1/1' ! jpegenc ! multifilesink location=out/img1_%03d.jpeg