| Summary: | ffmpeg fails to open v4l2 device more than 16 times | ||
|---|---|---|---|
| Product: | Fedora | Reporter: | Tristan Matthews <tristan.matthews> |
| Component: | ffmpeg | Assignee: | Dominik 'Rathann' Mierzejewski <dominik> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | kwizart |
| Priority: | P5 | ||
| Version: | 17 | ||
| Hardware: | x86_64 | ||
| OS: | GNU/Linux | ||
| namespace: | |||
| Attachments: |
compile with "cc v4l2_testcase.c -o v4l2_testcase `pkg-config --cflags --libs libavdevice libavformat`"
v4l2 ONLY testcase |
||
This worth to report this bug in ffmpeg upstream bugzilla. please provide us with the link. Once that said, if you can reproduce the problem without ffmpeg it related to the v4l2 or libv4l side. Thx It seems that CONFIG_LIBV4L2 is not defined, is this normal? I'm deducing that by doing strings /lib64/libavdevice.so | grep "Cannot open video device with libv4l neither" as that string should be present in libavdevice.so if CONFIG_LIBV4L2 was defined, unless I'm missing something. Created attachment 935 [details] v4l2 ONLY testcase Taken from: http://linuxtv.org/downloads/v4l-dvb-apis/v4l2grab-example.html Compile with: cc v4l2_only.c -o v4l2_only -lv4l2 This test opens and closes the v4l2 device 20 times, writing a frame to a file each iteration, without any problem. This would seem to suggest that the problem is in the ffmpeg package. (In reply to comment #3) ... > This test opens and closes the v4l2 device 20 times, writing a frame to a file > each iteration, without any problem. This would seem to suggest that the > problem is in the ffmpeg package. Ok but since we are not deviating from upstream this is an upstream issue as a consequence. Also worth mentioning that the RPM Fusion built has:
--enable-libv4l2 \\\
enabled in the ffmpeg package
Ok I think I've confirmed that this bug is present in the current ffmpeg git master, I will file a bug with them and link to it here. Here is the bug report I filed upstream: https://ffmpeg.org/trac/ffmpeg/ticket/1560 It seems that this bug is only present when the --enable-libv4l2 option is given to configure, without it, v4l2 devices work fine. Bug has been fixed upstream: http://git.videolan.org/?p=ffmpeg.git;a=commit;h=fd58678b86023ea98665f06756bf03f91e56be54 Should the ffmpeg.spec file be changed to get rid of the --enable-libv4l2 patch, or can this patch be added to the rpm? (In reply to comment #9) EDIT: Should the ffmpeg.spec file be changed to get rid of the --enable-libv4l2 _option_, or can this upstream patch be added to the rpm? The upstream patch have been backported in the package. Please grab it from: http://buildsys.rpmfusion.org/plague-results/fedora-17-rpmfusion_free/ (once built) Thanks, works fine here. Thx for your report. fixed in ffmpeg-0.10.4-2.fc17 |
Created attachment 934 [details] compile with "cc v4l2_testcase.c -o v4l2_testcase `pkg-config --cflags --libs libavdevice libavformat`" On Fedora 17, with the ffmpeg-devel package installed, it is impossible for a process to open and close the camera device more than 16 times. I've attached a simple test case that opens and closes /dev/video0 17 times. On the 17th time, it fails with: libv4l2: error attempting to open more then 16 video devices [video4linux2,v4l2 @ 0xb7eae0] ioctl(VIDIOC_QUERYCAP): Bad file descriptor Could not open input "/dev/video0" I can reproduce this on two different machines running FC 17 x86_64, with several different cameras. This bug does not occur with the upstream version of ffmpeg.