[FFmpeg-devel] libavformat and video4linux2 acquire problems
Tue May 8 17:13:42 CEST 2007
Sandro Cavazzoni wrote:
> ffmpeg -s 720x576 -f video4linux2 -vd /dev/video3 out-720x576.mpg
Ok, I see... It looks like ffmpeg is capturing video using a wrong tv
standard. The version of ffmpeg you are using is not setting the tv
standard, so the previously set standard is used. Probably, after reset
your card captures NTSC video.
> So I started VLC, i saw my camera and i closed it.
> Then i did the next command
> ffmpeg -v 10 -s 720x576 -f video4linux2 -vd /dev/video3 out-after-vlc.mpg
When you use vlc, it sets the video standard to PAL, so the following
ffmpeg instance correctly captures PAL video.
> FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2004 Fabrice Bellard
> configuration: --enable-gpl --enable-pp --enable-pthreads
> --enable-vorbis --enable-libogg --enable-a52 --enable-dts
> --enable-libgsm --enable-dc1394 --disable-debug --enable-shared
> libavutil version: 0d.49.0.0
> libavcodec version: 0d.51.11.0
> libavformat version: 0d.50.5.0
> built on Mar 26 2007 15:50:40, gcc: 4.1.2 20061115 (prerelease)
> (Debian 4.1.1-21)
> [video4linux2 @ 0xb7f40af0]Capabilities: 5010015
> The V4L2 driver changed the video from 720x576 to 640x576
The funny thing is that when the v4l2 driver is set to capture PAL
video, it seems to force the width to 640... At which resolution did vlc
capture the video?
Anyway, I suspect this is more a driver issue than an ffmpeg issue...
>>> If I try to open the device with VLC before run my application, then
>>> my application work correctly
>> Ah, ok... It seems that the v4l2 input format is not setting something
>> on your capture card. Are you using the latest version of libavformat
>> from svn? If not, try to upgrade.
> I'm using the version in debian repository.
I do not know which version of ffmpeg is shipped by debian, but it looks
like it is before March 29. On March 29, I committed a patch that
allowed to set the video standard. So, a recent svn checkout should fix
your problem (but you will need to add "-tvstd pal" to the ffmpeg
command line, and when using "-v 10" you will see something like "The
V4L2 driver set standard: ...").
> I can't update libraries on
> this linux installation... tomorrow I install a new linux distribution
> so i try to use the last svn snapshot
You do not need to install new libraries, nor to upgrade your linux
distribution. Just checkout ffmpeg from svn and compile it:
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
(static av* libraries will be compiled, and you will not need to install
More information about the ffmpeg-devel