Mpv: Desktop file requests URL encoded files that mpv does not handle

Created on 27 Jul 2018  路  3Comments  路  Source: mpv-player/mpv

Forwarded from https://bugs.debian.org/904620

mpv version and platform

mpv 0.29.0

Details

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.

Example

$ 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]

Related Info

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.

upstream ffmpeg

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.

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

szg0000 picture szg0000  路  3Comments

xanadupark picture xanadupark  路  3Comments

olivergondza picture olivergondza  路  3Comments

Edenharder picture Edenharder  路  4Comments

ghost picture ghost  路  3Comments