2

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'.

Ajith
  • 613
  • 1
  • 15
  • 32
  • If you have one decoder with one set of parameters and another decoder with other set of parameters - then you've got two decoders, right? Put tee after appsrc and use two h264_decoder. – Velkan Aug 28 '17 at 06:14
  • @Velkan What I am trying to do is decode once, but get one frame from that to put into a file. So I thought of putting a tee after the decoder and the first branch would just display the decoded frames as a normal decode display pipeline, but the second branch would store just one of the frames to file. – Ajith Aug 29 '17 at 01:58

1 Answers1

4

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
Ahresse
  • 497
  • 4
  • 17
  • Now I get it, the capability has to be handled by some element, avdec_h264 does not handle this. Thanks, this works for me. – Ajith Sep 08 '17 at 03:27