Forwarded from https://bugs.debian.org/904620
mpv 0.29.0
The mpv.desktop file contains this Exec line:
Exec=mpv --player-operation-mode=pseudo-gui -- %U
The %U will cause the desktop environment to URL encode any files given before passing them to mpv.
In my case, an SFTP file containing spaces was viewed in Nautilus and GNOME URL encoded this and passed the URL to mpv. Since it seems neither mpv or ffmpeg decodes sftp URLs, mpv fails to play the file.
$ mpv 'sftp://host/home/jcowgill/file%20with%20spaces.mkv'
Playing: sftp://host/home/jcowgill/file%20with%20spaces.mkv
[ffmpeg] libssh: Error opening sftp file: SFTP server: No such file
Failed to open sftp://host/home/jcowgill/file%20with%20spaces.mkv.
$ mpv 'sftp://host/home/jcowgill/file with spaces.mkv'
Playing: sftp://host/home/jcowgill/file with spaces.mkv
[plays correctly]
I found #1495 which looks highly related to this issue, although in this case I don't think the user can be blamed for entering an incorrect URL because it was GNOME who generated the URL and it is simply following the desktop file spec.
I guess you could workaround this by using %F in the Exec key, but probably this breaks on non-GNOME systems which can't mount URLs on the filesystem like this.
Can confirm for sftp, but not e.g. HTTP. Seems to be a protocol-specific blunder in ffmpeg.
It sounds like https://trac.ffmpeg.org/ticket/7816 is the upstream bug.
This is pretty fucking hilarious.
Filenames witrh spaces in HTTP: API user is supposed to do the escaping himself, ffmpeg will fail because ffmpeg are dumb looneys (at least the asshole who blocked a patch to fix this).
Filenames with spaces in SFTP: ????????????
Fight it out with the ffmpeg idiots.
Most helpful comment
This is pretty fucking hilarious.
Filenames witrh spaces in HTTP: API user is supposed to do the escaping himself, ffmpeg will fail because ffmpeg are dumb looneys (at least the asshole who blocked a patch to fix this).
Filenames with spaces in SFTP: ????????????
Fight it out with the ffmpeg idiots.