How do I get the size of a video?

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

How do I get the size of a video?

danielkun

Hello,

Videoscale doesn't scale the MPEG files correctly so I'd like to set the
ratio manually.
(480x480, 4:3 videos are displayed at 1:1. 352x480, 4:3 are displayed as
3:4...)

My pipeline looks like this:
(filesrc, mpegdemux, queue, mpeg2dec, videoscale, capsfilter,
ffmpegcolorspace, dfbvideosink)

How would I be able to get the ratio (size) of the video?

Thank you,

Daniel


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How do I get the size of a video?

Bastian Winkler
hello daniel,

you can connect to the 'notify::caps' signal on the videoscale's sink
pad and query for the negotiated caps via gst_pad_get_negotiated_caps
there you'll get width, height and pixel-aspect-ratio of the video.

:wq buz

On Tue, Mar 18, 2008 at 04:58:49AM -0700, [hidden email] wrote:

>
> Hello,
>
> Videoscale doesn't scale the MPEG files correctly so I'd like to set the
> ratio manually.
> (480x480, 4:3 videos are displayed at 1:1. 352x480, 4:3 are displayed as
> 3:4...)
>
> My pipeline looks like this:
> (filesrc, mpegdemux, queue, mpeg2dec, videoscale, capsfilter,
> ffmpegcolorspace, dfbvideosink)
>
> How would I be able to get the ratio (size) of the video?
>
> Thank you,
>
> Daniel
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
--
/* Nobody will ever see this message :-) */
panic("Cannot initialize video hardware\n");
        2.0.38 /usr/src/linux/arch/m68k/atari/atafb.c

GnuPG Fingerprint: 2FFF FC48 C7DF 1EA0 00A0  FD53 8C35 FD2E 6908 7B82

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How do I get the size of a video?

danielkun
In reply to this post by danielkun
Hello there Bastian,

Thank you very much!

I ended up adding a 'notify::caps' signal to the src of my decoder so
that I would be able to set the width/height properties of videoscale.

Thanks,
Daniel


> hello daniel,
>
> you can connect to the 'notify::caps' signal on the videoscale's sink
> pad and query for the negotiated caps via gst_pad_get_negotiated_caps
> there you'll get width, height and pixel-aspect-ratio of the video.
>
> :wq buz
>
> On Tue, Mar 18, 2008 at 04:58:49AM -0700, [hidden email] wrote:
> >
> > Hello,
> >
> > Videoscale doesn't scale the MPEG files correctly so I'd like to set the
> > ratio manually.
> > (480x480, 4:3 videos are displayed at 1:1. 352x480, 4:3 are displayed as
> > 3:4...)
> >
> > My pipeline looks like this:
> > (filesrc, mpegdemux, queue, mpeg2dec, videoscale, capsfilter,
> > ffmpegcolorspace, dfbvideosink)
> >
> > How would I be able to get the ratio (size) of the video?
> >
> > Thank you,
> >
> > Daniel
> >


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How do I get the size of a video?

Nie Jun
In reply to this post by Bastian Winkler
     You will be appreciated if you can answer my similiar question:
     If video scale element is not needed(we use hardware scale), what's the proper method to notify application the video width and height ratio, implement a signal in every decoder?
     If video size changes during playback, how should decoder notify videosink the new data caps, change buffer caps and pad caps directly?
     Thank you!

2008/3/18, Bastian Winkler <[hidden email]>:
hello daniel,

you can connect to the 'notify::caps' signal on the videoscale's sink
pad and query for the negotiated caps via gst_pad_get_negotiated_caps
there you'll get width, height and pixel-aspect-ratio of the video.

:wq buz


On Tue, Mar 18, 2008 at 04:58:49AM -0700, [hidden email] wrote:
>
> Hello,
>
> Videoscale doesn't scale the MPEG files correctly so I'd like to set the
> ratio manually.
> (480x480, 4:3 videos are displayed at 1:1. 352x480, 4:3 are displayed as
> 3:4...)
>
> My pipeline looks like this:
> (filesrc, mpegdemux, queue, mpeg2dec, videoscale, capsfilter,
> ffmpegcolorspace, dfbvideosink)
>
> How would I be able to get the ratio (size) of the video?
>
> Thank you,
>
> Daniel
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


--
/* Nobody will ever see this message :-) */
panic("Cannot initialize video hardware\n");
        2.0.38 /usr/src/linux/arch/m68k/atari/atafb.c

GnuPG Fingerprint: 2FFF FC48 C7DF 1EA0 00A0  FD53 8C35 FD2E 6908 7B82

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFH37TFjDX9LmkIe4IRAkN0AJ437xTR1jZmyrt+y48iF9sIMY8vUwCgsWAQ
Lj+pMt3/haIg8VrrJ3sTI40=
=Ynpd
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel