hdsdi3g / medialib

All libs for media manipulation tools
GNU Lesser General Public License v3.0
3 stars 1 forks source link

Thumbnail generator from video file #95

Closed hdsdi3g closed 1 month ago

hdsdi3g commented 6 months ago

Base command line:

ffmpeg -y -ss "$1" -skip_frame nokey -i "$2" -map_metadata -1 -an -vsync vfr \
    -vf "thumbnail=10,bwdif=deint=1,format=yuv420p,scale=w=trunc(ih*dar/2)*2:h=trunc(ih/2)*2:out_color_matrix=bt709:out_range=jpeg,setsar=1:1" \
    -frames:v 1 -codec:v mjpeg -qscale:v 1 -huffman optimal \
    snap.jpg
hdsdi3g commented 1 month ago

https://www.bannerbear.com/blog/how-to-set-a-custom-thumbnail-for-a-video-file-using-ffmpeg

https://www.bannerbear.com/blog/how-to-extract-images-from-a-video-using-ffmpeg/

-ss position (input/output)
When used as an input option (before -i), seeks in this input file to position. Note that in most formats it is not possible to seek exactly, so ffmpeg will seek to the closest seek point before position. When transcoding and -accurate_seek is enabled (the default), this extra segment between the seek point and position will be decoded and discarded. When doing stream copy or when -noaccurate_seek is used, it will be preserved.

When used as an output option (before an output url), decodes but discards input until the timestamps reach position.

position must be a time duration specification, see [(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual](https://www.ffmpeg.org/ffmpeg-utils.html#time-duration-syntax).