[FFmpeg-trac] #1560(avdevice:new): v4l2 device won't open after opening/closing it 16 times

FFmpeg trac at avcodec.org
Fri Jul 20 00:47:20 CEST 2012


#1560: v4l2 device won't open after opening/closing it 16 times
------------------------------------+------------------------------------
             Reporter:  tmatth      |                    Owner:
                 Type:  defect      |                   Status:  new
             Priority:  normal      |                Component:  avdevice
              Version:  git-master  |               Resolution:
             Keywords:  v4l2        |               Blocked By:
             Blocking:              |  Reproduced by developer:  1
Analyzed by developer:  0           |
------------------------------------+------------------------------------
Changes (by Cigaes):

 * reproduced:  0 => 1


Old description:

> Summary of the bug:
>
> In the attached case, I open and close a v4l2 device (/dev/video0) 17
> times. On the 17th time, it fails to open with the following errors:
>
> libv4l2: error attempting to open more then 16 video devices
> [video4linux2,v4l2 @ 0x1f6a5c0] ioctl(VIDIOC_QUERYCAP): Bad file
> descriptor
> Could not open input "/dev/video0"
>
> How to reproduce:
> Build and run the attached test case with a v4l2 device connected.
>
> I'm using the ffmpeg git master branch:
>
> ffmpeg version N-42636-ga8d8e86 Copyright (c) 2000-2012 the FFmpeg
> developers
>   built on Jul 19 2012 17:32:59 with gcc 4.7.0 (GCC) 20120507 (Red Hat
> 4.7.0-5)
>   configuration: --prefix=/opt/ --enable-bzlib --enable-gnutls --enable-
> libv4l2 --enable-libx264 --enable-x11grab --enable-postproc --enable-
> pthreads --disable-static --enable-shared --enable-gpl --disable-debug
> --disable-stripping --enable-pic

New description:

 Summary of the bug:

 In the attached case, I open and close a v4l2 device (/dev/video0) 17
 times. On the 17th time, it fails to open with the following errors:
 {{{
 libv4l2: error attempting to open more then 16 video devices
 [video4linux2,v4l2 @ 0x1f6a5c0] ioctl(VIDIOC_QUERYCAP): Bad file
 descriptor
 Could not open input "/dev/video0"
 }}}
 How to reproduce:
 Build and run the attached test case with a v4l2 device connected.

 I'm using the ffmpeg git master branch:
 {{{
 ffmpeg version N-42636-ga8d8e86 Copyright (c) 2000-2012 the FFmpeg
 developers
   built on Jul 19 2012 17:32:59 with gcc 4.7.0 (GCC) 20120507 (Red Hat
 4.7.0-5)
   configuration: --prefix=/opt/ --enable-bzlib --enable-gnutls --enable-
 libv4l2 --enable-libx264 --enable-x11grab --enable-postproc --enable-
 pthreads --disable-static --enable-shared --enable-gpl --disable-debug
 --disable-stripping --enable-pic
 }}}

--

Comment:

 Same thing on one of my boxes. libavdevice compiled without libv4l2 works.
 Try removing the paragraph under {{{#ifdef CONFIG_LIBV4L2}}} in
 {{{device_open()}}} in {{{libavdevice/v4l2.c}}} and see if it fixes
 things.

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/1560#comment:2>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list