Thanks a lot Xin

It works well  , now my code detects webcam .

Regards
Ajay

----- Original Message ----- From: "Cai, Xin" <[email protected]> To: "Libav* user questions and discussions" <[email protected]>; "Libav* user questions and discussions" <[email protected]>
Sent: Wednesday, May 06, 2009 2:06 PM
Subject: Re: [libav-user] How to capture video from webcam


FFmpeg does support a way to do this for windows. It is similar to getting video from a usb camera in linux, only difference is that the input codec type for linux is "video4linux2" input url is "/dev/video0". For windows the input codec type is "vfwcap" and input url is "0". look at sample code blow.

 .
 .
 .
 /* Same as video4linux code */
 // Register all formats and codecs
 av_register_all();

 //----------------------------------------------------------
 //code for the video input initialization
 //----------------------------------------------------------
 pInfmt = av_find_input_format("vfwcap");
 if( !pInfmt ){
   fprintf(stderr,"Unknown input format:mjpeg\n");
   return -1;
 }

 // Open video file
 if(av_open_input_file(&pInFormatCtx, "0", pInfmt, 0, NULL)!=0)
   return -1; // Couldn't open file

 /* Same as video4linux code*/
 .
 .
 .

Also keep in mind that vfwcap only support certain type of usb webcam, I have made modifications to the vfwcap.c file to support more but I haven't had the chance to check it in yet. So for now get a

-----Original Message-----
From: [email protected] on behalf of Rapsey
Sent: Wed 5/6/2009 1:23 AM
To: Libav* user questions and discussions
Subject: Re: [libav-user] How to capture video from webcam

If it does, I'm pretty sure it only works in linux.


Sergej

On Wed, May 6, 2009 at 9:09 AM, Ajay <[email protected]> wrote:

it means  ffplay also uses direct show for this ?
ffmpeg does not provide any support for capturing video ?

Regards
Ajay

----------------------------------------
From: "Rapsey" <[email protected]>
Sent: Wednesday, May 06, 2009 12:15 PM
To: "Libav* user questions and discussions" <[email protected]>
Subject: Re: [libav-user] How to capture video from webcam

On Wed, May 6, 2009 at 7:40 AM, Ajay  wrote:

> Hi,
>
> I want to write an application for capturing live video using web cam
for
> windows platform.
>
> i am not getting from where to start , how to open webcam , etc....
> which set of APIs are available for this job ?
>
> Is there any tutorial available  for this , if not please let me know
which
> set of APIs need to be call in right order.
>
> Regards
> Ajay
>
>
> _______________________________________________
> libav-user mailing list
> [email protected]
> https://lists.mplayerhq.hu/mailman/listinfo/libav-user
>

hi,

You need to use DirectShow for that.

Sergej
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user


_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to