Video Capture documentation

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

Video Capture documentation

Gustavo Felisberto-4
I have been reading the documentation available at:
http://www.inb.uni-luebeck.de/~boehme/libavcodec_update.html  and I was
trying to do video capture from a video4linux2 device.

The code there is very outdated and I was unable to find information on
how to do the capture. Can someone point me to the right direction?

--
Gustavo Felisberto
(HumpBack)
Web: http://dev.gentoo.org/~humpback
Blog: http://blog.felisberto.net/

_______________________________________________
libav-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: Video Capture documentation

Luca Abeni
Gustavo Felisberto wrote:
> I have been reading the documentation available at:
> http://www.inb.uni-luebeck.de/~boehme/libavcodec_update.html  and I was
> trying to do video capture from a video4linux2 device.
>
> The code there is very outdated and I was unable to find information on
> how to do the capture. Can someone point me to the right direction?

Just open the "/dev/video" (or the correct device file used by your card's
driver) file using the video4linux2 format (see av_open_input_file()).
Do not forget to set the image size and pixel format in AVFormatParameters
before calling av_open_input_file().


                                Luca

_______________________________________________
libav-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: Video Capture documentation

Gustavo Felisberto-4
Luca Abeni escreveu:

> Gustavo Felisberto wrote:
>  
>> I have been reading the documentation available at:
>> http://www.inb.uni-luebeck.de/~boehme/libavcodec_update.html  and I was
>> trying to do video capture from a video4linux2 device.
>>
>> The code there is very outdated and I was unable to find information on
>> how to do the capture. Can someone point me to the right direction?
>>    
>
> Just open the "/dev/video" (or the correct device file used by your card's
> driver) file using the video4linux2 format (see av_open_input_file()).
> Do not forget to set the image size and pixel format in AVFormatParameters
> before calling av_open_input_file().
>
>
>  
Thanks for the update Luca. I was trying the
AVFormatParameters formatParams;
formatParams.device = "/dev/video0";

that no longer exists, much easyer now.

// Register all formats and codecs
  av_register_all();

  //Register all devices
  avdevice_register_all();

  AVFormatParameters formatParams;
  AVInputFormat *iformat;

  formatParams.channel = 0;
  formatParams.standard = NULL;
  formatParams.width = 640;
  formatParams.height = 480;

  iformat = av_find_input_format("video4linux2");

  av_open_input_file(&pFormatCtx,
                   "/dev/video1", iformat, 0, &formatParams);

My questions now are:

1- How to query to know if a device is video4linux2 or video4linux?
2- How to get the name for a particular device: as in "UVC Camera"
"Pixart PAC207-BCA"
3- How to know the device capabilites in terms of video size?

--
Gustavo Felisberto
(HumpBack)
Web: http://dev.gentoo.org/~humpback
Blog: http://blog.felisberto.net/


_______________________________________________
libav-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: Video Capture documentation

Luca Abeni
Gustavo Felisberto wrote:
[...]
> My questions now are:
>
> 1- How to query to know if a device is video4linux2 or video4linux?

You can try to open the file with the video4linux2 format first, and
if it fails you can fall back to video4linux.


> 2- How to get the name for a particular device: as in "UVC Camera"
> "Pixart PAC207-BCA"
> 3- How to know the device capabilites in terms of video size?

This is currently not supported (mainly because I do not know how
to return these information using the libavformat API).
Some of these information are available to the video4linux2 input
format (see libavdevice/v4l2.c:device_open(): the "cap" structure
should contain most of the information you are looking for); maybe
some AVFormatContext fields can be used to return them...
But I am not sure.


                        Luca
_______________________________________________
libav-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

m4v duration

Locutus
Does anyone know how to get the duration of an MPEG4 elementary stream (m4v
format)?  I've tried av_open_input_file followed by a call to
av_find_stream_info, but I get 0x8000000000000000 for the duration.

Thanks greatly...

_______________________________________________
libav-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: Video Capture documentation

Roberto Garrido Martín
In reply to this post by Gustavo Felisberto-4

El 23/07/2008, a las 13:45, Gustavo Felisberto escribió:

> Luca Abeni escreveu:
>> Gustavo Felisberto wrote:
>>
>>> I have been reading the documentation available at:
>>> http://www.inb.uni-luebeck.de/~boehme/libavcodec_update.html  and  
>>> I was
>>> trying to do video capture from a video4linux2 device.
>>>
>>> The code there is very outdated and I was unable to find  
>>> information on
>>> how to do the capture. Can someone point me to the right direction?
>>>
>>
>> Just open the "/dev/video" (or the correct device file used by your  
>> card's
>> driver) file using the video4linux2 format (see  
>> av_open_input_file()).
>> Do not forget to set the image size and pixel format in  
>> AVFormatParameters
>> before calling av_open_input_file().
>>
>>
>>
> Thanks for the update Luca. I was trying the
> AVFormatParameters formatParams;
> formatParams.device = "/dev/video0";
>
> that no longer exists, much easyer now.
>
> // Register all formats and codecs
>  av_register_all();
>
>  //Register all devices
>  avdevice_register_all();
>
>  AVFormatParameters formatParams;
>  AVInputFormat *iformat;
>
>  formatParams.channel = 0;
>  formatParams.standard = NULL;
>  formatParams.width = 640;
>  formatParams.height = 480;
>
>  iformat = av_find_input_format("video4linux2");
>
>  av_open_input_file(&pFormatCtx,
>                   "/dev/video1", iformat, 0, &formatParams);
>
>

Hi!
Anybody knows how to do Video Capture on windows uisng libav* libraries?

Thanks in advance,
Ro.



_______________________________________________
libav-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: Video Capture documentation

Stefano Sabatini
On date Thursday 2008-07-24 07:01:13 +0200, Roberto Garrido Martín wrote:

>
> El 23/07/2008, a las 13:45, Gustavo Felisberto escribió:
>
> > Luca Abeni escreveu:
> >> Gustavo Felisberto wrote:
> >>
> >>> I have been reading the documentation available at:
> >>> http://www.inb.uni-luebeck.de/~boehme/libavcodec_update.html  and  
> >>> I was
> >>> trying to do video capture from a video4linux2 device.
> >>>
> >>> The code there is very outdated and I was unable to find  
> >>> information on
> >>> how to do the capture. Can someone point me to the right direction?
> >>>
> >>
> >> Just open the "/dev/video" (or the correct device file used by your  
> >> card's
> >> driver) file using the video4linux2 format (see  
> >> av_open_input_file()).
> >> Do not forget to set the image size and pixel format in  
> >> AVFormatParameters
> >> before calling av_open_input_file().
> >>
> >>
> >>
> > Thanks for the update Luca. I was trying the
> > AVFormatParameters formatParams;
> > formatParams.device = "/dev/video0";
> >
> > that no longer exists, much easyer now.
> >
> > // Register all formats and codecs
> >  av_register_all();
> >
> >  //Register all devices
> >  avdevice_register_all();
> >
> >  AVFormatParameters formatParams;
> >  AVInputFormat *iformat;
> >
> >  formatParams.channel = 0;
> >  formatParams.standard = NULL;
> >  formatParams.width = 640;
> >  formatParams.height = 480;
> >
> >  iformat = av_find_input_format("video4linux2");
> >
> >  av_open_input_file(&pFormatCtx,
> >                   "/dev/video1", iformat, 0, &formatParams);
> >
> >
>
> Hi!
> Anybody knows how to do Video Capture on windows uisng libav* libraries?

libavdevice + v4w.

Regards.
_______________________________________________
libav-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: Video Capture documentation

tingustar
In reply to this post by Roberto Garrido Martín

To do video capture on windows, you need to use directshow (component of directX) to capture video samples, then use libav* to encode samples to the formats you want (mpeg4, h.264, xvid, vidx, etc.). Libav* functions have nothing to do with capturing which can only be done by directshow.

-Bin

> From: [hidden email]
> To: [hidden email]
> Date: Thu, 24 Jul 2008 07:01:13 +0200
> Subject: Re: [libav-user] Video Capture documentation
 

> Hi!
> Anybody knows how to do Video Capture on windows uisng libav* libraries?
>
> Thanks in advance,
> Ro.
>
>
>
> _______________________________________________
> libav-user mailing list
> [hidden email]
> https://lists.mplayerhq.hu/mailman/listinfo/libav-user

_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
_______________________________________________
libav-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: Video Capture documentation

Roberto Garrido Martín

El 25/07/2008, a las 3:44, <[hidden email]> <[hidden email]
 > escribió:

>
> To do video capture on windows, you need to use directshow  
> (component of directX) to capture video samples, then use libav* to  
> encode samples to the formats you want (mpeg4, h.264, xvid, vidx,  
> etc.). Libav* functions have nothing to do with capturing which can  
> only be done by directshow.
>
> -Bin

Hi again!
My idea was to avoid using DirectShow...
Thanks!!
_______________________________________________
libav-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user