mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.53k stars 2.92k forks source link

--start= option not working as expected when used with playlists #11284

Open futureisfoss opened 1 year ago

futureisfoss commented 1 year ago

Important Information

Provide following Information:

Reproduction steps

Create a playlist file called playlist.m3u containing paths to a few media files. Now play the playlist with the --start option:

mpv --no-config --start=150 --playlist=playlist.m3u

Expected behavior

Only the first file should start playing at 150 seconds (2:30 minutes) and the rest of the files from the playlist should start from the beginning like normal.

Actual behavior

Every single file from the playlist starts at 150 seconds (2:30 minutes) which I believe is not what most people would expect.

Additional context

I'm not sure if this is supposed to be a bug report or a feature request, but I couldn't find any other option on mpv that does what I wanted. I tried passing --reset-on-next-file=all but it didn't do anything. So for now I just use this trick in my shell script:

first_file_to_play=$(head -n1 "$playlist_file")
mpv --start="$start_time" "$first_file_to_play" && mpv --playlist-start=1 --playlist="$playlist_file"

This is not ideal because I have to call mpv twice, and while the first instance is running I have no way of going forward/backward in the playlist with the < and > keys.

Traneptora commented 1 year ago

You could modify your shell script so you run: mpv --start="$start_time" "$first_file_to_play" '--{' --playlist-start=1 --start=0 --playlist="$playlist_file" '--}' so you have one instance of mpv, but I agree it's still ugly.