You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(defundwim-shell-command-thumbnail-with-ffmpeg ()
"Generate a thumbnail with ffmpeg."
(interactive)
(dwim-shell-command-on-marked-files
"Thumbnail with ffmpeg"" ffmpeg -i '<<f>>' -vf \"thumbnail,scale=640:360\" -frames:v 1 '<<td>>/<<fne>>.png'":utils"ffmpeg":silent-successt))
This fails with dwim-shell-command--escaped-quote-around: Couldn’t figure out how to quote for " ffmpeg -i '<<f>>' -vf "thumbnail,scale=640:360" -frames:v 1 '<<td>>/<<fne>>.png'" using / and .
If instead the command is " ffmpeg -i '<<f>>' -vf \"thumbnail,scale=640:360\" -frames:v 1 '<<fne>>.png'", (ie, omitting the temporary directory), this succeeds.
how does <> work? omitting the explicit / path separator doesn't seem to matter, nor does hardcoding a /tmp/ instead of using <<td>>.
(my actual goal here is to generate temporary thumbnails for videos, so what i really want is something like " ffmpeg -i '<<f>>' -vf \"thumbnail,scale=640:360\" -frames:v 1 '<<td>>/<<fne>>.png' && feh <<td>>/<<fne>>.png", but omitting the && ... clause doesn't affect the error here. I'm also a little curious about how to use <>; maybe i can just pipe the png into feh and avoid the file entirely, but i don't know how.)
The text was updated successfully, but these errors were encountered:
This adds <b> (base name) and <bne> (base name no extension), so we can now craft what you're after.
(my actual goal here is to generate temporary thumbnails for videos, so what i really want is something like " ffmpeg -i '<>' -vf "thumbnail,scale=640:360" -frames:v 1 '<>/<>.png' && feh <>/<>.png",
After getting the latest (v0.60), it should be possible with something like:
(defun dwim-shell-commands-video-temporary-thumbnail ()
"Generate a thumbnail with ffmpeg."
(interactive)
(let ((temp-dir (make-temp-file "thumbnails-" t)))
(dwim-shell-command-on-marked-files
"Thumbnail with ffmpeg"
"ffmpeg -i '<<f>>' -vf \"thumbnail,scale=640:360\" -frames:v 1 '<<td>>/<<bne>>.png' && feh <<td>>/<<bne>>.png"
:silent-success t
:utils "ffmpeg")))
Note: I'm on a mac, so I used open instead of feh. Should hopefully work on linux with feh.
ps. Would be nice if there was a way to preserve the video aspect ratio in the thumbnail, if you know?
Consider the following defun:
This fails with
dwim-shell-command--escaped-quote-around: Couldn’t figure out how to quote for " ffmpeg -i '<<f>>' -vf "thumbnail,scale=640:360" -frames:v 1 '<<td>>/<<fne>>.png'" using / and .
If instead the command is
" ffmpeg -i '<<f>>' -vf \"thumbnail,scale=640:360\" -frames:v 1 '<<fne>>.png'"
, (ie, omitting the temporary directory), this succeeds.how does <> work? omitting the explicit
/
path separator doesn't seem to matter, nor does hardcoding a/tmp/
instead of using<<td>>
.(my actual goal here is to generate temporary thumbnails for videos, so what i really want is something like
" ffmpeg -i '<<f>>' -vf \"thumbnail,scale=640:360\" -frames:v 1 '<<td>>/<<fne>>.png' && feh <<td>>/<<fne>>.png"
, but omitting the && ... clause doesn't affect the error here. I'm also a little curious about how to use <>; maybe i can just pipe the png into feh and avoid the file entirely, but i don't know how.)The text was updated successfully, but these errors were encountered: