Comments (12)
if ffmpeg is broken, why don't you report an error there?
from v4l2loopback.
¿ffmpeg broken? ffmpeg works fine with real v4l2 devices, v4l2loopback is the only one who does not work
from v4l2loopback.
I believe that VIDIOC_ENUMSTD is ¿meta?data that asks ffmpeg, but v4l2loopback can not answer (are they not implemented?)
from v4l2loopback.
correct, ENUMSTD is not implemented, and there is no reason why it should be implemented: v4l2loopback is not a tuner device or similar, that delivers frame in PAL-G (or whatever).
if ffmpeg depends on a device to provide ENUMSTD, i consider it broken (until someone tells me better)
from v4l2loopback.
and other versions ffmpeg can play the streamjust fine (e.g. "0.8.5-6" from the libav fork)
from v4l2loopback.
Could we not set v4l2loopback, to answer ENUMSTD with placebo data, or something? ej null
from v4l2loopback.
This problem is now reported here: https://ffmpeg.org/trac/ffmpeg/ticket/2370.
from v4l2loopback.
thanks for forwarding the bug.
one possible reason why ffmpeg triggered the problem, is that v4l2loopback already provided placebo ioctls for other STD-ioctls (VIDIOC_G_STD, VIDIOC_S_STD, VIDIOC_QUERYSTD).
i have removed these placebos for now, maybe it helps with ffmpeg (so ffmpeg doesn't think anymore that the loopback device should be able to ENUMSTD).
i'm wondering whether this triggers other regressions.
from v4l2loopback.
Hi,
I'm trying to fix this bug for ffmpeg, but first of all, I tried v4l2loopback (both git head and
5568514, same result) with my application, and this is what I get:
[v4l2] Opening video device '/dev/video1'...
[v4l2] Querying capabilities, inputs and formats...
[v4l2] Capabilities:
[v4l2] Driver: v4l2 loopback
[v4l2] Card: Dummy video device (0x0000)
[v4l2] Bus info: v4l2loopback:0
[v4l2] Version: 0x00000603
[v4l2] Capabilities: 0x05000003 V4L2_CAP_VIDEO_CAPTURE V4L2_CAP_VIDEO_OUTPUT V4L2_CAP_READWRITE V4L2_CAP_STREAMING
[v4l2] Input 0:
[v4l2] Name: loopback
[v4l2] Type: 0x00000002 V4L2_INPUT_TYPE_CAMERA
[v4l2] Audioset: 0x00000000
[v4l2] Tuner: 0x00000000
[v4l2] Std: 0x0000000000ffffff
[v4l2] Status: 0x00000000
[v4l2] Image format 0:
[v4l2] Flags: 0x00000000
[v4l2] Description: [YV12]
[v4l2] Pixelformat: 0x32315659
[v4l2] Selecting video input 0...
[v4l2] Std: 0, 0x000000000000b000, NTSC
[v4l2] Std: 1, 0x0000000000001000, NTSC-M
[v4l2] Std: 2, 0x0000000000002000, NTSC-M-JP
[v4l2] Std: 3, 0x0000000000008000, NTSC-M-KR
[v4l2] Std: 4, 0x0000000000004000, NTSC-443
[v4l2] Std: 5, 0x00000000000000ff, PAL
[v4l2] Std: 6, 0x0000000000000007, PAL-BG
[v4l2] Std: 7, 0x0000000000000008, PAL-H
[v4l2] Std: 8, 0x0000000000000010, PAL-I
[v4l2] Std: 9, 0x00000000000000e0, PAL-DK
[v4l2] Std: 10, 0x0000000000000100, PAL-M
[v4l2] Std: 11, 0x0000000000000200, PAL-N
[v4l2] Std: 12, 0x0000000000000400, PAL-Nc
[v4l2] Std: 13, 0x0000000000000800, PAL-60
[v4l2] Std: 14, 0x0000000000ff0000, SECAM
[v4l2] Std: 15, 0x0000000000010000, SECAM-B
[v4l2] Std: 16, 0x0000000000040000, SECAM-G
[v4l2] Std: 17, 0x0000000000080000, SECAM-H
[v4l2] Std: 18, 0x0000000000320000, SECAM-DK
[v4l2] Std: 19, 0x0000000000400000, SECAM-L
[v4l2] Std: 20, 0x0000000000800000, SECAM-Lc
[v4l2] Current std: 0x0000000000ffffff
[v4l2] VIDIOC_ENUMSTD: Invalid argument
I see at least two possible sources of problems:
-
VIDIOC_ENUMINPUT ioctl on input0 returns an input.std=0x0000000000ffffff which is !=0, claiming this device supports different standards. The documentation at http://linuxtv.org/downloads/v4l-dvb-apis/standard.html says that: "Special rules apply to devices such as USB cameras where the notion of video standards makes little sense. [...] Here the driver shall set the std field of struct v4l2_input and struct v4l2_output to zero and the VIDIOC_G_STD, VIDIOC_S_STD, VIDIOC_QUERYSTD and VIDIOC_ENUMSTD ioctls shall return the ENOTTY error code." So perhaps 0 should be returned for this field.
-
VIDIOC_G_STD ioctl returns a std_id=0x0000000000ffffff, which again I think is not possible because that would mean that this device current standard is, for example, both NTSC and PAL at the same time.
At the moment ffmpeg errors out because the VIDIOC_ENUMINPUT ioctl reaches the end of the enumeration returning EINVAL without being able to match the current standard with one in the enumeration, which should not happen unless this device falls under the USB exception.
from v4l2loopback.
current git/master (as of today: 8bbe208) of v4l2loopback has disabled all STD ioctls (thus all of them should fail, so calling applications should never even think that the device supports any STDs).
please check what this does with ffmpeg.
as for the webcam exception: iirc, currently all applications that use v4l2loopback as an output module provide a "webcam-like" output image, rather than some TV-norm. for these your suggestion makes sense. otoh, v4l2loopback should probably by able to emulate a device capabale of TV-norms (e.g. if the consumer requests PAL or NTSC)
from v4l2loopback.
Okay, I tested current git/master (fd822cf) and I can confirm that ffmpeg now works again.
I only noticed one minor thing with my application: if I feed some video with one of the following commands
A) gst-launch-0.10 -v videotestsrc ! "video/x-raw-yuv,width=352,height=288,framerate=10/1,format=(fourcc)YUY2" ! v4l2sink device=/dev/video1
B) gst-launch-0.10 -v videotestsrc ! "video/x-raw-yuv,width=352,height=288,framerate=25/1,format=(fourcc)YUY2" ! v4l2sink device=/dev/video1
which only differ for the framerate, the VIDIOC_G_PARM ioctl always returns:
[v4l2] Capture parameters:
[v4l2] Capability: 0x00000000
[v4l2] Capturemode: 0x00000000
[v4l2] Timeperframe: 1/30
Would it be possible to return the correct timeperframe when reading the streaming parameters? Link at the doc: http://linuxtv.org/downloads/v4l-dvb-apis/streaming-par.html .
Note that ffmpeg can work around this if the user specifies a particular framerate for the resulting video, as the OP did with "-r 25".
from v4l2loopback.
I tested latest git/master(fd822cf) and FFMPEG too. It's a no problem.
Good job!
Testing Environment:
Debian/GNU Linux Testing + Linux Kernel 3.8.1
from v4l2loopback.
Related Issues (20)
- Failed to stream on for some special test
- Failed to stream H264 to virtual camera: "does not support 2:4:7:1 colorimetry" HOT 3
- Devices limited to 8 even with KCPP flag HOT 1
- Chromium cannot read camera: Dequeued v4l2 buffer contains invalid length HOT 5
- DKMS Won't Sign When Building HOT 3
- Dummy device made via v4l2loopback is busy HOT 6
- wont compile on 32bit armv7l HOT 3
- Caught SIGSEGV
- DKMS fails to build against 6.8-rc1 kernel due to use of strlcpy
- can't increase Read/Write buffers from 2 to 4 HOT 1
- resolution 2048x1 does not work HOT 5
- Fails to build against Kernel 6.8-rc6 HOT 3
- dkms build fails on kernel version >6.8.0 HOT 3
- Possible Missing Dependency? HOT 5
- getNextFrame no data errno:0 Success HOT 1
- getNextFrame no data errno:0 Success on v4l2rtspserver log with verbose HOT 2
- how create duplicate device0 and /dev/video1 who desn't have "Video Capture"? HOT 5
- modprobe: ERROR: could not insert 'v4l2loopback': Exec format error HOT 3
- Linux 6.8.4 seems to have broken v4l2loopback in several ways. HOT 6
- Linux 6.8.4 seems to have broken v4l2loopback in several ways.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from v4l2loopback.