Getting video resolution from plugins before recording

Josh Doe josh at joshdoe.com
Tue Nov 25 13:38:26 PST 2014


On Tue, Nov 25, 2014 at 1:48 PM, Faraz Sherwani <farazsherwani at gmail.com> wrote:
> I am using gstreamer for python to record videos. I am using "v4l2src" and
> "ximagesrc" as video source plugins. I am not setting the video resolution,
> so the output resolution is determined by the input resolution. At what
> point can I find out what that resolution is and what is the correct way of
> getting the resolution (width and height)? I have looked through the
> documentation and know it has something to do with pads or caps but have
> tried and not succeeded in finding the resolution unless I set it myself.

You seem to be using 0.10 and the old Python bindings. You'll want to
add a buffer pad probe to the src pad of your video source and examine
a passing buffer, from which you can get the caps and parse them to
give you dimensions. In 1.0 caps aren't attached to buffers but are
transmitted with events, so you'd do an event pad probe instead. I'd
give you code snippets but I'm using 1.0 only for some time now.


More information about the gstreamer-devel mailing list