Use of capsfilter

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Use of capsfilter

deeps8us
Hi , I am really confused about the use of capsfilter in a pipeline. I understand it is for setting some properties.

gst-launch filesrc location=sample.ac3 ! ac3parse ! myaudio   ---> will work.

gst-launch filesrc location=sample.mp4! ac3parse ! myaudio   ---> will give error saying "Failed to parse stream"

gst-launch filesrc location=sample.mp4!  capsfilter caps="audio/x-ac3" ! ac3parse ! myaudio   ---> (Using caps filter) will give me same error itself

Anyways the pipeline wont allow us to set unmatched properties to next element right.? Then what is the specific use of capsfilter?




Reply | Threaded
Open this post in threaded view
|

Re: Use of capsfilter

bamboosso

You should use caps on media stream. Filesrc well give you raw file bytes. For mp4 use qtdemux.

... filesrc ... ! qtdemux name=demux  demux.audio_00 ! capsfilter ... ! ...sink

Some thing like this.

29-11-2012 07:00, "deepthips" <[hidden email]> napisał(a):
Hi , I am really confused about the use of capsfilter in a pipeline. I
understand it is for setting some properties.

gst-launch filesrc location=sample.ac3 ! ac3parse ! myaudio   ---> will
work.

gst-launch filesrc location=sample.mp4! ac3parse ! myaudio   ---> will give
error saying "Failed to parse stream"

gst-launch filesrc location=sample.mp4!  capsfilter caps="audio/x-ac3" !
ac3parse ! myaudio   ---> (Using caps filter) will give me same error itself

Anyways the pipeline wont allow us to set unmatched properties to next
element right.? Then what is the specific use of capsfilter?








--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Use-of-capsfilter-tp4657112.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Use of capsfilter

deeps8us
In reply to this post by deeps8us
To add to above question, the following difference in caps  tried in gst-launch makes no difference in my video output. where qtdemux have following caps:

SINK template: 'sink'
    Availability: Always
    Capabilities:
      video/quicktime
      video/mj2
      audio/x-m4a
      application/x-3gp

gst-launch filesrc location=IceAge.mp4 ! capsfilter caps="video/mj2,format=(fourcc)AYUV" ! qtdemux name=myqtdemux myqtdemux.! queue ! myvideo ! mydisplaysink myqtdemux.! queue ! myaudio

gst-launch filesrc location=IceAge.mp4 ! capsfilter caps="video/quicktime,format=GRAY8" ! qtdemux name=myqtdemux myqtdemux.! queue ! myvideo ! mydisplaysink myqtdemux.! queue ! myaudio

gst-launch filesrc location=IceAge.mp4 ! capsfilter caps="video/quicktime,width=320,height=240" ! qtdemux name=myqtdemux myqtdemux.! queue ! myvideo ! mydisplaysink myqtdemux.! queue ! myaudio

gst-launch filesrc location=IceAge.mp4 ! capsfilter caps="video/quicktime,width=320,height=240" ! qtdemux name=myqtdemux myqtdemux.! queue ! myvideo ! mydisplaysink myqtdemux.! queue ! myaudio
Reply | Threaded
Open this post in threaded view
|

Re: Use of capsfilter

bamboosso

Capsfilter after qtdemux.

29-11-2012 08:27, "deepthips" <[hidden email]> napisał(a):
To add to above question, the following difference in caps  tried in
gst-launch makes no difference in my video output. where qtdemux have
following caps:

SINK template: 'sink'
    Availability: Always
    Capabilities:
      video/quicktime
      video/mj2
      audio/x-m4a
      application/x-3gp

gst-launch filesrc location=IceAge.mp4 ! capsfilter
caps="video/mj2,format=(fourcc)AYUV" ! qtdemux name=myqtdemux myqtdemux.!
queue ! myvideo ! mydisplaysink myqtdemux.! queue ! myaudio

gst-launch filesrc location=IceAge.mp4 ! capsfilter
caps="video/quicktime,format=GRAY8" ! qtdemux name=myqtdemux myqtdemux.!
queue ! myvideo ! mydisplaysink myqtdemux.! queue ! myaudio

gst-launch filesrc location=IceAge.mp4 ! capsfilter
caps="video/quicktime,width=320,height=240" ! qtdemux name=myqtdemux
myqtdemux.! queue ! myvideo ! mydisplaysink myqtdemux.! queue ! myaudio

gst-launch filesrc location=IceAge.mp4 ! capsfilter
caps="video/quicktime,width=320,height=240" ! qtdemux name=myqtdemux
myqtdemux.! queue ! myvideo ! mydisplaysink myqtdemux.! queue ! myaudio



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Use-of-capsfilter-tp4657112p4657114.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Use of capsfilter

deeps8us
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


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 ]
Reply | Threaded
Open this post in threaded view
|

Re: Use of capsfilter

deeps8us
Even on setting width and height to capsfilter, it is setting default values itself.


gst-launch -v filesrc location=sample.mp4 ! qtdemux name=myqtdemux ! myvideo ! capsfilter caps="video/x-fake-yuv,width=200,height=150" ! mydisplaysink


GstPad:src: caps = video/x-fake-yuv, width=(int)1024, height=(int)576, video-fd=(int)6, framerate=(fraction)2997/125
Reply | Threaded
Open this post in threaded view
|

Re: Use of capsfilter

Tim-Philipp Müller-2
In reply to this post by deeps8us
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 ]


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel