edit; delete, wrong thread![]()
+ Reply to Thread
Results 31 to 32 of 32
-
Last edited by imaginethat; 19th Jan 2022 at 01:15.
-
It's really of no interest to me but sometimes I like to learn things. I added some metadata via an SRT and a downscaling option:
Code:@echo off REM user variables. Set these to the desired values. REM cols is the number of columns for the image array. REM t_interval is the time interval in seconds. REM downscale is the factor by which to downscale the thumbnails, eg 2 results in half size thumbnails set /A cols = 3 set /A t_interval = 30 set /A downscale = 1 REM get video stats: ffprobe.exe -v quiet -show_entries stream=r_frame_rate -of default=noprint_wrappers=1:nokey=1 -select_streams v:0 %1 > temp.txt set /p fps= <temp.txt ffprobe.exe -v quiet -show_entries stream=width -of default=noprint_wrappers=1:nokey=1 -select_streams v:0 %1 > temp.txt set /p width= <temp.txt ffprobe.exe -v quiet -show_entries stream=height -of default=noprint_wrappers=1:nokey=1 -select_streams v:0 %1 > temp.txt set /p height= <temp.txt ffprobe.exe -v quiet -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 -select_streams v:0 %1 > temp.txt set /p duration= <temp.txt REM At this point the environment variables cols, t_interval, fps, duration, width, and height are available. REM REM Note 1 fps is in numerator/denominator format -- convert to an integer with set /A frate = fps. REM Note 2: caculate the number of rows. REM note 3: calculate the frame count interval from user t_interval * frate set /A frate = %fps% set /A rows = duration / t_interval / cols if %rows% EQU 0 set /A rows = 1 set /A interval = t_interval * frate set /A width = (%width% / %downscale% / 2) * 2 set /A height = (%height% / %downscale% / 2) * 2 REM get metadata into SRT echo 1 >temp.srt echo 00:00:00,000 --^> 00:00:%t_interval%,000 >>temp.srt echo "%~nx1" >>temp.srt echo dimensions: %width%x%height% >>temp.srt echo duration: %duration% seconds >>temp.srt ffprobe.exe -v quiet -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 -select_streams v:0 %1 > temp.txt set /p codec_name= <temp.txt echo video codec: %codec_name% >>temp.srt REM for debugging REM echo duration = %duration% REM echo fps = %fps% REM echo frate = %frate% REM echo width = %width% REM echo height = %height% REM echo downscale = %downscale% REM echo cols = %cols% REM echo rows = %rows% REM echo interval = %interval% REM pause @echo on ffmpeg -y -i %1 -vf "subtitles=temp.srt,thumbnail=%interval%,scale=%width%:%height%,tile=%cols%x%rows%" -frames:v 1 "%~dpnx1.jpg" pause REM delete temp files del temp.srt del temp.txt
103 minute movie, 1920x1080, rows=4, t_interval=300, downscale=2:
[Attachment 62992 - Click to enlarge]Last edited by jagabo; 19th Jan 2022 at 13:16.
Similar Threads
-
Extract short sequence from video as uncompressed images
By Fern99 in forum Newbie / General discussionsReplies: 3Last Post: 7th Jan 2022, 20:12 -
Converting a sequence of images to video with variable framerate
By mantis2892 in forum Video ConversionReplies: 10Last Post: 31st May 2020, 11:38 -
Avidemux MP4v2 Muxer outputting variable frame rate (audio sync issues)
By KittenMittens in forum Video ConversionReplies: 3Last Post: 21st Mar 2018, 21:08 -
How to play an image sequence with mplayer?
By Selur in forum Software PlayingReplies: 4Last Post: 13th Jan 2018, 05:38 -
Using VLC to Capture Frame to Frame Sequence
By pone44 in forum EditingReplies: 0Last Post: 22nd Feb 2017, 22:05