-
Notifications
You must be signed in to change notification settings - Fork 517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v4l2loopback broken in git ffmpeg #38
Comments
if ffmpeg is broken, why don't you report an error there? |
¿ffmpeg broken? ffmpeg works fine with real v4l2 devices, v4l2loopback is the only one who does not work |
I believe that VIDIOC_ENUMSTD is ¿meta?data that asks ffmpeg, but v4l2loopback can not answer (are they not implemented?) |
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) |
and other versions ffmpeg can play the streamjust fine (e.g. "0.8.5-6" from the libav fork) |
Could we not set v4l2loopback, to answer ENUMSTD with placebo data, or something? ej null |
This problem is now reported here: https://ffmpeg.org/trac/ffmpeg/ticket/2370. |
thanks for forwarding the bug. 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. |
Hi, I'm trying to fix this bug for ffmpeg, but first of all, I tried v4l2loopback (both git head and
I see at least two possible sources of problems:
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. |
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). 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) |
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 which only differ for the framerate, the VIDIOC_G_PARM ioctl always returns:
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 . |
I tested latest git/master(fd822cf) and FFMPEG too. It's a no problem. Testing Environment: |
Newer versions of ffmpeg can't read v4l2loopback stream
ffmpeg -v debug -f video4linux2 -i /dev/video0 -f alsa -i pulse_monitor -vcodec libvpx -vb 300k -r 25 -quality good -cpu-used 0 -s 640x360 -aspect 16:9 -f webm /tmp/fifo2.webm
ffmpeg version N-38414-g997a362 Copyright (c) 2000-2013 the FFmpeg developers
built on Feb 26 2013 18:27:23 with gcc 4.7 (Ubuntu/Linaro 4.7.2-2ubuntu1)
configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-version3 --enable-x11grab --enable-libvpx --enable-libxvid --enable-libpulse --enable-libspeex --enable-libfdk-aac --enable-libopus
libavutil 52. 17.103 / 52. 17.103
libavcodec 54. 92.100 / 54. 92.100
libavformat 54. 63.100 / 54. 63.100
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 41.100 / 3. 41.100
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set libav* logging level) with argument 'debug'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'video4linux2'.
Reading option '-i' ... matched as input file with argument '/dev/video0'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'alsa'.
Reading option '-i' ... matched as input file with argument 'pulse_monitor'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'libvpx'.
Reading option '-vb' ... matched as AVOption 'vb' with argument '300k'.
Reading option '-r' ... matched as option 'r' (set frame rate (Hz value, fraction or abbreviation)) with argument '25'.
Reading option '-quality' ... matched as AVOption 'quality' with argument 'good'.
Reading option '-cpu-used' ... matched as AVOption 'cpu-used' with argument '0'.
Reading option '-s' ... matched as option 's' (set frame size (WxH or abbreviation)) with argument '640x360'.
Reading option '-aspect' ... matched as option 'aspect' (set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)) with argument '16:9'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'webm'.
Reading option '/tmp/fifo2.webm' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set libav* logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file /dev/video0.
Applying option f (force format) with argument video4linux2.
Successfully parsed a group of options.
Opening an input file: /dev/video0.
[video4linux2,v4l2 @ 0x2f18d00] fd:3 capabilities:5000003
[video4linux2,v4l2 @ 0x2f18d00] Selecting input_channel: 0
[video4linux2,v4l2 @ 0x2f18d00] input_channel: 0, input_name: loopback
[video4linux2,v4l2 @ 0x2f18d00] Querying the device for the current frame size
[video4linux2,v4l2 @ 0x2f18d00] Setting frame size to 320x240
[video4linux2,v4l2 @ 0x2f18d00] Trying to set codec:rawvideo pix_fmt:yuv420p
Last message repeated 1 times
[video4linux2,v4l2 @ 0x2f18d00] Trying to set codec:rawvideo pix_fmt:yuv422p
[video4linux2,v4l2 @ 0x2f18d00] Trying to set codec:rawvideo pix_fmt:yuyv422
[video4linux2,v4l2 @ 0x2f18d00] ioctl(VIDIOC_ENUMSTD): Invalid argument
/dev/video0: Invalid argument
The text was updated successfully, but these errors were encountered: