[Libav-user] directshow resolution

Don Moir donmoir at comcast.net
Wed Oct 9 02:53:37 CEST 2013

----- Original Message ----- 
From: "Novák, Attila" <novak.attila at itvprojekt.hu>
To: <libav-user at ffmpeg.org>
Sent: Tuesday, October 08, 2013 7:51 AM
Subject: Re: [Libav-user] directshow resolution

On 8 October 2013 13:01, Novák, Attila <novak.attila at itvprojekt.hu> wrote:
> Hi,
> I have a Leadtek capture card that provides DirectShow output. I managed to record video in multiple resolutions using the command 
> line ffmpeg tool by providing the "-s widthXheight" option. Unfortunately I could not replicate the results from code: it always 
> captures with the default 320x200 resolution. I tried calling av_opt_set_image_size() & av_opt_set() with the "image_size" option 
> on the input format context struct before & after opening the codec, but it didn't work.
> I couldn't find any documentation whatsoever on this feature. Does anyone know how this supposed to work?
> (I'm on WinXP with Visual Studio 2010, the card is a Leadtek WinFast VC100)
> Thank you in advance,
> -Attila

    AVDictionary* pOptions = NULL;

    char videoSize [] = "640x480"; // whatever size or sizes your camera supports
    av_dict_set (&pOptions,"video_size",videoSize,0);

Getting the resolutions for a camera is not well supported in ffmpeg. You can do something like parsing the av_log callback but this 
is silly. I think there are structures in place for better camera feedback but I don't think it's implemented. I currently do this 
internal to my own app. 

More information about the Libav-user mailing list