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

Don't try "resume-playback", if not seekable #1701

Closed
klausenbusk opened this issue Mar 18, 2015 · 11 comments
Closed

Don't try "resume-playback", if not seekable #1701

klausenbusk opened this issue Mar 18, 2015 · 11 comments

Comments

@klausenbusk
Copy link

Hello

The --save-position-on-quit is really useful, but when you also often listen to live streams it kind of annoying that you need to specific --no-resume-playback every time.. When MPV just could check if it is seekable, and if not just play it..

Regards Kristian

@ghost ghost closed this as completed in 39ed9b7 Mar 18, 2015
@jaseg
Copy link
Contributor

jaseg commented Sep 26, 2016

It doesn't seem 39eb9b7 really fixes this. As far as I can tell mpv is still saving playback state at least on the following streams URLs:

http://www.radioswissjazz.ch/live/aacp.m3u
http://www.deutschlandradio.de/streaming/dlf.m3u

mpv -v output here. I'm running mpv 0.18.1.

I'm not 100% sure that's not just two borked streams but even then IMHO this would be kind of glitchy behavior since when mpv tries to restore the playback position on the first URL above it will just hang indefinitely.

ghost pushed a commit that referenced this issue Sep 26, 2016
demux_lavf.c forces seek to being determined as supported if
STREAM_CTRL_HAS_AVSEEK is returned as success. But it always succeeds
with current FFmpeg versions. (Seems like Libav commit cae448cf broke
this in early 2016.)

Now we can't determine via private API whether the underlying protocol
supports read_seek anymore. The affected protocols (mostly rtmp) also
set seekable=0, meaning they signal they're not seekable, even though
read_seek would work. (My guess is that this can't be fixed because even
though seekable is in theory a combination of elaborate flags [of which
only 1 is defined, AVIO_SEEKABLE_NORMAL], a seekable!=0 always means
it's byte-seekable in some way.)

So the FFmpeg API is being garbage _again_, and all what we can do is
determining this via protocol name and a whitelist.

Should fix the behavior reported in #1701.
@ghost
Copy link

ghost commented Sep 26, 2016

Should now work better.

@matoro
Copy link

matoro commented Mar 31, 2017

Hi, I know this issue is a bit old but I think it's better than opening a new one. Could you disable resume-playback on special block devices as well? I open /dev/video0 in mpv to view my webcam, and it attempts to resume playback, of course failing, so I have to manually specify the --no-resume-playback option. Many thanks for your hard work!

@ghost
Copy link

ghost commented Mar 31, 2017

It should already be considered unseekable (since I expect you can't seek in that device file), but I have no way to test.

@matoro
Copy link

matoro commented Mar 31, 2017

@wm4 Unfortunately not, as you can see here:

$ mpv /dev/video0
[10052718]    cplayer: Resuming playback. This behavior can be disabled with --no-resume-playback.
[10052742]    cplayer: Loading config '/home/matoro/.config/mpv/watch_later/DE2B8D7F52F0D204CC7667A23B2A7902'
[10067932]    cplayer: Playing: /dev/video0
[10531515]    cplayer:  (+) Video --vid=1 (rawvideo)
libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
[10570983]         vf: Using conversion filter.

Break with ^C

[27888967]    cplayer: Saving state.
[27896841] ffmpeg/demuxer: video4linux2,v4l2: Some buffers are still owned by the caller on close.
[27930939]     ffmpeg: ioctl(VIDIOC_QBUF): Bad file descriptor
[27931271]    cplayer: 
[27931291]    cplayer: 
[27931296]    cplayer: Exiting... (Quit)

My webcam indicator light turns on, but the video window never appears unless I pass --no-resume-playback

Configuration file: https://my.mixtape.moe/nnivfe.conf

I am happy to run patches or testing versions if it will help.

@tostr7191
Copy link

I have the same problem. Running mpv http://www.twitch.tv/some_stream and it does not start playback if it finds a previous state (which makes little sense on a stream). The stream works normally if I pass --no-resume-playback.

$ mpv --version
mpv 0.25.0 (C) 2000-2017 mpv/MPlayer/mplayer2 projects

Running Mac OS 10.12.

@mia-0
Copy link
Member

mia-0 commented Jul 22, 2017

Looks like FFmpeg’s HLS demuxer just waits around forever until the segment with the requested timestamp arrives.

@mia-0 mia-0 reopened this Jul 22, 2017
@matoro
Copy link

matoro commented Jul 23, 2017

Thanks for reopening this, but does that mean that only web streams will be looked at again? As of mpv 0.26.0 block devices still have the same problem.

@Traneptora
Copy link
Member

FFmpeg's HLS code has had a lot of work done on it recently. Is this still a problem in 0.28.0?

@matoro
Copy link

matoro commented Jan 13, 2018

@thebombzen Just built v0.28.0.105.gb478d2b1ce and it looks good on streams (at least binary streams, I don't have a playlist stream to test against). However issue still seems to be present with block devices. I know those are two very different cases so it may or may not be appropriate to share an issue.

@Traneptora
Copy link
Member

I would open a separate issue reporting this problem. That one has nothing to do with streams, just detecting the seekability of a tv device.

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

No branches or pull requests

6 participants