You can make and use high quality videos that are still small enough to be a thumbnail:
Here’s a bat script to generate them:
ffmpeg-topic-preview.bat.txt (3.1 KB)
Place it together with ffmpeg.exe and the video and run
ffmpeg-topic-preview.bat big_buck_bunny_720p.mp4 30 20 40
Usage: ffmpeg-topic-preview.bat <input_video_file> <start_time> <duration> [quality] [effort]
Example: ffmpeg-topic-preview.bat "Big Buck Bunny.mp4" 00:00:30 20
Example: ffmpeg-topic-preview.bat "Big Buck Bunny.mp4" 00:00:30 20 50 (lower quality)
Quality: 0-63 (lower=better, default=40)
Effort: 0-12 (lower=slower/better, default=8)
Code
@echo off
setlocal EnableDelayedExpansion
REM Default values
set "RESOLUTION=360"
set "DEFAULT_QUALITY=40"
set "DEFAULT_EFFORT=8"
REM Parameter validation - if any required parameter is missing, show usage
if "%~1"=="" goto :show_usage
if "%~2"=="" goto :show_usage
if "%~3"=="" goto :show_usage
REM Process input parameters (remove quotes if present)
set "input=%~1"
set "start_time=%~2"
set "duration=%~3"
REM Set quality parameter with default
if "%~4"=="" (
set "quality=%DEFAULT_QUALITY%"
) else (
set "quality=%~4"
)
REM Set effort parameter with default
if "%~5"=="" (
set "effort=%DEFAULT_EFFORT%"
) else (
set "effort=%~5"
)
REM Generate output filename
set "output=%~n1-%RESOLUTION%p.avif"
REM Validate input file exists
if not exist "%input%" (
echo ERROR: Input file "%input%" does not exist!
pause
exit /b 1
)
echo Converting "%input%" to "%output%"
echo Start time: %start_time%, Duration: %duration%s
echo Resolution: %RESOLUTION%p, Quality: %quality%, Effort: %effort%
echo.
REM FFmpeg command with parameter explanations:
REM -ss: Seek to start time (skip beginning)
REM -i: Input video file
REM -t: Duration in seconds to process
REM -vf "scale=-2:360": Video filter - scale to 360p height, auto width (even)
REM -c:v libsvtav1: Video codec - SVT-AV1 encoder
REM -crf: Quality 0-63 (lower=better quality, higher=smaller file)
REM -preset: Effort 0-12 (lower=slower encoding/better compression)
REM -an: Remove all audio streams
REM -loop 0: Infinite loop for AVIF animation
REM -y: Overwrite output file without prompting
echo ^> ffmpeg -ss "%start_time%" -i "%input%" -t "%duration%" -vf "scale=-2:%RESOLUTION%" -c:v libsvtav1 -crf %quality% -preset %effort% -an -loop 0 "%output%" -y
ffmpeg -ss "%start_time%" -i "%input%" -t "%duration%" -vf "scale=-2:%RESOLUTION%" -c:v libsvtav1 -crf %quality% -preset %effort% -an -loop 0 "%output%" -y
REM Check if output file was created
if not exist "%output%" (
echo ERROR: Failed to create output file!
pause
exit /b 1
)
REM File exists, check size
for %%A in ("%output%") do set "filesize=%%~zA"
set /a filesizeKB=!filesize!/1024
echo.
echo File created: %output%
echo File size: !filesizeKB! KB
REM Check if file is too large
if !filesize! gtr 1000000 (
echo.
echo WARNING: File size exceeds 1000 KB!
echo Images over 1MB can't be used as topic previews
echo.
set /a suggested_quality=%quality%+10
if !suggested_quality! gtr 63 set suggested_quality=63
echo Suggestions to reduce file size:
echo - Increase quality value ^(current: %quality%, try e.g. !suggested_quality!^)
echo - Reduce duration ^(current: %duration%s, try shorter clips^)
) else (
echo File size is acceptable for use as topic preview.
)
pause
goto :eof
:show_usage
echo Usage: %~nx0 ^<input_video_file^> ^<start_time^> ^<duration^> [quality] [effort]
echo Example: %~nx0 "Big Buck Bunny.mp4" 00:00:30 20
echo Example: %~nx0 "Big Buck Bunny.mp4" 00:00:30 20 50 (lower quality)
echo Quality: 0-63 (lower=better, default=%DEFAULT_QUALITY%)
echo Effort: 0-12 (lower=slower/better, default=%DEFAULT_EFFORT%)
pause
exit /b 1
If you are not on Windows or don’t like running bat files, just run the exactly same ffmpeg command
ffmpeg -ss "00:00:30" -i "big_buck_bunny_720p.mp4" -t "20" -vf "scale=-2:360" -c:v libsvtav1 -crf 40 -preset 8 -an -loop 0 "big_buck_bunny_720p-360p.avif" -y
varying -ss
(start), -t
(duration) and -crf
(quality) to make the file below 1MB