libvlc_video_get_size

This forum is about all development around libVLC.
sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

libvlc_video_get_size

Postby sherington » 29 Jun 2010 20:41

Hi,

I can see from the latest source code (src/control/video.c) that libvlc_video_get_size, and consequently the deprecated get width/height functions that call it, never return video dimensions any more. It seems this was explicitly disabled with a commit log comment "Disable invalid access of internal vout fields.", here http://git.videolan.org/?p=vlc.git;a=co ... e2c51fb468.

I also spotted this ticket http://trac.videolan.org/vlc/ticket/3679.

Is there some other 'correct' way to now query libvlc for the video dimensions, or is it simply not possible at the moment?

Thanks!

Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: libvlc_video_get_size

Postby Rémi Denis-Courmont » 30 Jun 2010 12:44

In the development version, no. That's not a problem in releases though.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

laszloj
New Cone
New Cone
Posts: 9
Joined: 28 Jun 2010 10:04

Re: libvlc_video_get_size

Postby laszloj » 30 Jun 2010 13:34

Hi,

Well, I think it just does not work at all. I am using release 1.1.0 dll-s and calling libvlc_video_get_size function
always returns -1;

Code: Select all

/* Create a media player playing environement */ mp = libvlc_media_player_new_from_media (m); int x; unsigned w,h; x = libvlc_video_get_size(mp,1,&w,&h);
x is always -1. Any comment on this?

jozsef

Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: libvlc_video_get_size

Postby Rémi Denis-Courmont » 30 Jun 2010 14:53

You're probably requesting the size before the video stream started
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: libvlc_video_get_size

Postby sherington » 30 Jun 2010 17:13

1.1.0 definitely works for me.

Thanks, Remi, for the info re development versions.

d3x0r
Blank Cone
Blank Cone
Posts: 38
Joined: 01 Dec 2008 22:38

Re: libvlc_video_get_size

Postby d3x0r » 16 Sep 2010 03:18

It works for you when? After you're already up? Because it returns the size you passed in setformat

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: libvlc_video_get_size

Postby sherington » 16 Sep 2010 16:55

It works for me when I request the size after the video stream started, like Remi said above.

setformat is not relevant in this instance since I don't use it.

xdenser
Blank Cone
Blank Cone
Posts: 23
Joined: 30 Aug 2010 23:39
Contact:

Re: libvlc_video_get_size

Postby xdenser » 17 Sep 2010 12:23

I... Because it returns the size you passed in setformat..
no it returns video size of frames in video
not what you have passed to setformat

d3x0r
Blank Cone
Blank Cone
Posts: 38
Joined: 01 Dec 2008 22:38

Re: libvlc_video_get_size

Postby d3x0r » 18 Sep 2010 03:33

uhh no, the movie i was playing was 352x240, and it returns 640,480 which is the size I passed to setformat. I know what the documentation says... but that's not what I get back. I guess duing the first frame lock I can get the size, but, again, it's the size of setformat not the original stream source. And I haven't yet tried to setformat after the stream has started... even if I did something complex like during the first lock scheduled an event to stop, resize and start... (schedule an event because calling stop during lock is a deadlock)... think it still wouldn't work - maybe schedule creating a new instance

Christian88
New Cone
New Cone
Posts: 3
Joined: 16 Sep 2010 15:08

Re: libvlc_video_get_size

Postby Christian88 » 20 Sep 2010 16:03

I have a another question about libvlc_video_get_size.

I want to render the current frame in my own buffer and therefor i'm using libvlc_video_set_callbacks and libvlc_video_set_format:

Code: Select all

libvlc_video_set_callbacks (m_pMediaPlayer, lock, unlock, display, m_pContext); libvlc_video_set_format (m_pMediaPlayer, "RV32", 1600, 1200, 1600 * 4);
video width and height are hard coded.

But now i want to make my program more flexible about different video sizes.

At the point of calling libvlc_video_set_format the stream still hasn't started.

If i can't get the video size before the stream started,
how can i set the video format (width and height)?

xdenser
Blank Cone
Blank Cone
Posts: 23
Joined: 30 Aug 2010 23:39
Contact:

Re: libvlc_video_get_size

Postby xdenser » 20 Sep 2010 20:19

uhh no...
but for me it returns native video size
may be it depends on decoder used
I've tried with udp streaming and mpeg2/4 streams


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 9 guests