Skip to content
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

Special block devices not detected as unseekable #5391

Open
matoro opened this issue Jan 13, 2018 · 6 comments
Open

Special block devices not detected as unseekable #5391

matoro opened this issue Jan 13, 2018 · 6 comments

Comments

@matoro
Copy link

matoro commented Jan 13, 2018

Creating a new issue as per recommendation from @thebombzen here: #1701 (comment)

mpv version and platform

mpv 0.27.0 on Linux 4.14.13-1-ARCH x86_64 GNU/Linux

Reproduction steps

$ mpv /dev/video0

Expected behavior

mpv will access and play webcam stream.

Actual behavior

mpv attempts to resume playback from last time command was run. This results in the file getting accessed, but no window appearing for x time, where x is the value stored in the resume file in .config/mpv/watch_later/. Behaves as expected if the --no-resume-playback option is passed on the command line or set in the config file.

Log file

https://spit.mixtape.moe/view/raw/02aafc27

@Traneptora
Copy link
Member

Does the problem still exist if you use mpv tv:// --tv-device=/dev/video0 rather than playing the device file directly? (mpv needs to be compiled with --enable-tv and --enable-tv-v4l2)

@matoro
Copy link
Author

matoro commented Jan 13, 2018

@thebombzen

waf: error: no such option: --enable-tv-v412

tv features:
    --enable-tv         enable TV interface [disable]
    --disable-tv-v4l2   disable Video4Linux2 TV interface [autodetect]
    --disable-libv4l2   disable libv4l2 support [autodetect]
    --disable-audio-input
                        disable audio input support [autodetect]
    --enable-dvbin      enable DVB input module [disable]

@kevmitch
Copy link
Member

l, not 1

@matoro
Copy link
Author

matoro commented Jan 14, 2018

@thebombzen that fixes it. Output:

$ mpv tv:// --tv-device=/dev/video0
[10023085]    cplayer: Playing: tv://
[10023962]         tv: Selected driver: v4l2
[10023972]         tv:  name: Video 4 Linux 2 input
[10024472]         tv: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was used instead.
[10024485]         tv: Selected device: Integrated_Webcam_HD: Integrate
[10024498]         tv:  Capabilities:  video capture  read/write  streaming
[10024508]         tv:  supported norms:
[10024518]         tv:  inputs: 0 = Camera 1;
[10024522]         tv:  Current input: 0
[10024540]         tv:  Current format: YUYV
[10036241]         tv: tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
[10036266]         tv: ioctl enum norm failed: Inappropriate ioctl for device
[10036274]         tv: Error: Cannot set norm!
[10036280]         tv: Selected input hasn't got a tuner!
[10037062]         tv: ioctl set mute failed: Invalid argument
[10042402]    cplayer:  (+) Video --vid=1 (rawvideo 640x480 30.000fps)
[10410980]    cplayer: VO: [gpu] 640x480 yuv420p
[14589591] statusline: V: 00:00:04 / 00:00:04 (97%)
[----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------]
[14768596]    cplayer: Not seekable - not saving state.
libv4l2: error dequeuing buf: Invalid argument
[14809482]         tv: VIDIOC_DQBUF failed: Invalid argument
libv4l2: error dequeuing buf: Invalid argument
[14809497]         tv: VIDIOC_DQBUF failed: Invalid argument
libv4l2: error dequeuing buf: Invalid argument
[14809506]         tv: VIDIOC_DQBUF failed: Invalid argument
libv4l2: error dequeuing buf: Invalid argument
[14809516]         tv: VIDIOC_DQBUF failed: Invalid argument
libv4l2: error dequeuing buf: Invalid argument
[14809524]         tv: VIDIOC_DQBUF failed: Invalid argument
libv4l2: error dequeuing buf: Invalid argument
[14809534]         tv: VIDIOC_DQBUF failed: Invalid argument
[14809547]         tv: ioctl set mute failed: Invalid argument
[14810627]         tv: 130 frames successfully processed, 11 frames dropped.
[14810927]    cplayer: 
[14810960]    cplayer: 
[14810965]    cplayer: Exiting... (Quit)

Is it a problem that this is not automatically detected?

@Traneptora
Copy link
Member

Traneptora commented Jan 14, 2018

If you don't have TV support built in, mpv will defer the Video4Linux2 device reading to FFmpeg. FFmpeg should report the TV device stream as non-seekable. I have no idea if FFmpeg does report this and mpv ignores it, or if FFmpeg incorrectly reports it as seekable. That's something to look into.

@matoro
Copy link
Author

matoro commented Jan 14, 2018

OK. I can provide debug logs as necessary as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants