[BUG] Pressing `s` gives `Error writing screenshot` if long filename.
zenny opened this issue · comments
Hi,
Context:
mpv
has been assigned as a backend topipe-viewer
in `~/.config/pipe-viewer/pipe-viewer.conf
video_player_selected => "mpv",
video_players => {
mpv => {
arg => "--really-quiet --force-media-title=*TITLE* --no-ytdl --vo=gpu --hwdec=cuda",
audio => "--audio-file=*AUDIO*",
cmd => "/usr/bin/mpv",
fs => "--fullscreen",
novideo => "--no-video",
srt => "--sub-file=*SUB*",
},
-
When
mpv
is configured to grasp screenshot to the $PWD plays well withpipe-viewer
-
When
mpv
is asked to save the screenshot to a specific location in~/.config/mpv/mpv.conf
screenshot-template="~/Pictures/screenshots/mpv/%F/%p__%tm-%tY"
local utils = require("mp.utils")
local basedir = mp.get_property("options/screenshot-directory")
mp.register_event("file-loaded", function()
local filedir = mp.get_property("filename/no-ext")
local dir = utils.join_path(basedir, filedir)
mp.set_property("options/screenshot-directory", dir)
end)
mpv
standalone (outside `pipe-viewer) captures the screenshot as desired in the relevant folder specified above.**
But pipe-viewer
fails to screenshot with Error writing screenshot!
when pressed s
!
Any idea? Thanks!
The pipe-viewer
version is latest from master.
$ ./pipe-viewer --version
CLI Pipe Viewer 0.4.7
This issue appears to be with pipe-viewer
unable to pipe the long filenames, but NOT with the mpv
(unlike smplayer-dev/smplayer#569 (comment)).
The reason is:
screenshot-template="%F - [%P]v%#01n"
reports Error writing screenshot!
with pipe-viewer, but goes well with mpv
standalone whereas
screenshot-template="screenshot_%n_%p_%02n"
produces the screenshot without any error when pressed s
in pipe viewer.
Any clue appreciated! Thanks.