Use of capsfilter
Tim-Philipp Müller
t.i.m at zen.co.uk
Thu Nov 29 02:36:04 PST 2012
On Thu, 2012-11-29 at 00:39 -0800, deepthips wrote:
Hi,
> Thanks for the reply.. I changed capsfilter to be after qtdemux. But that
> also didnt show any change. Tried with a video pipeline without audio.
>
> gst-launch filesrc location=IceAge.mp4 ! qtdemux name=myqtdemux ! myvideo !
> capsfilter caps="video/x-fake-yuv,width=320,height=240" ! mydisplaysink
> ------- I expected video to show different resolution
>
> AND
>
> gst-launch filesrc location=IceAge.mp4 ! qtdemux name=myqtdemux ! myvideo !
> capsfilter caps="video/x-fake-yuv,blue_mask=(int)0xFFFFF000" ! mydisplaysink
> ---------------- I expected screen to be blue color
What you're doing with capsfilters doesn't really seem to make sense to
me. What are you trying to achieve here?
Capsfilters are useful in two scenarios:
a) You have a stream that does not have caps set on it yet, and want to
set caps on it. More often than not you will want to do that using a
typefind element instead though, or the source element's "caps"
property. (A more exotic variant of this scenario is where you know the
caps and want to add an extra field to the caps that's not there yet)
b) You have an element whose output does not depend only on its input,
and you want to force it to output things in a specific way
(exclusively, or optionally/preferably), examples:
v4l2src !
video/x-raw-yuv,width=640,height=480;video/x-raw-rgb,width=640,height=480 ! ...
... ! videoconvert ! videoscale !
video/x-raw-rgb,depth=24,bpp=24,width=640,height=480 ! ...
... ! x264enc ! video/x-h264,profile=main,stream-format=byte-stream !
filesink location=foo.h264
Putting a capsfilter behind a video decoder is rarely useful, as usually
a decoder has little choice what to output. In that case you will get a
not-negotiated flow error.
In your first e-mail you were feeding non-AC3 data (qt) to ac3parse,
forced AC3 caps on that data, and then seemed surprised that ac3parse
errors out telling you that it can't parse that stream. What did you
expect to happen there exactly?
Cheers
-Tim
>
> Video played normally.
>
> gst-inspect mydisplaysink:
>
> Pad Templates:
> SINK template: 'sink'
> Availability: Always
> Capabilities:
> video/x-fake-yuv
> video/x-raw-rgb
> bpp: 32
> depth: 32
> red_mask: 65280
> green_mask: 16711680
> blue_mask: -16777216
> endianness: 4321
> width: [ 1, 1280 ]
> height: [ 1, 720 ]
> framerate: [ 0/1, 100/1 ]
> video/x-raw-rgb
> bpp: 32
> depth: 32
> red_mask: -16777216
> green_mask: 16711680
> blue_mask: 65280
> endianness: 4321
> width: [ 1, 1280 ]
> height: [ 1, 720 ]
> framerate: [ 0/1, 100/1 ]
More information about the gstreamer-devel
mailing list