Giter Site home page Giter Site logo

Comments (12)

umlaeute avatar umlaeute commented on June 28, 2024

if ffmpeg is broken, why don't you report an error there?

from v4l2loopback.

enmaskarado avatar enmaskarado commented on June 28, 2024

¿ffmpeg broken? ffmpeg works fine with real v4l2 devices, v4l2loopback is the only one who does not work

from v4l2loopback.

enmaskarado avatar enmaskarado commented on June 28, 2024

I believe that VIDIOC_ENUMSTD is ¿meta?data that asks ffmpeg, but v4l2loopback can not answer (are they not implemented?)

from v4l2loopback.

umlaeute avatar umlaeute commented on June 28, 2024

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.

umlaeute avatar umlaeute commented on June 28, 2024

and other versions ffmpeg can play the streamjust fine (e.g. "0.8.5-6" from the libav fork)

from v4l2loopback.

enmaskarado avatar enmaskarado commented on June 28, 2024

Could we not set v4l2loopback, to answer ENUMSTD with placebo data, or something? ej null

from v4l2loopback.

ubitux avatar ubitux commented on June 28, 2024

This problem is now reported here: https://ffmpeg.org/trac/ffmpeg/ticket/2370.

from v4l2loopback.

umlaeute avatar umlaeute commented on June 28, 2024

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.

holdenc avatar holdenc commented on June 28, 2024

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:

  1. 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.

  2. 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.

umlaeute avatar umlaeute commented on June 28, 2024

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.

holdenc avatar holdenc commented on June 28, 2024

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.

yukkeorg avatar yukkeorg commented on June 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.