Skip to content

Commit

Permalink
Generate Thumbnail via the ffmpeg scripts (Windows Powershell and Bas…
Browse files Browse the repository at this point in the history
…h Scripts available)
  • Loading branch information
FrostKiwi committed Aug 22, 2023
1 parent fc69684 commit e66261f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions assets/media_user/ffmpeg_thumbnails.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$files = Get-ChildItem -File

foreach ($file in $files) {
# Construct the filename for the thumbnail
$baseName = [System.IO.Path]::GetFileNameWithoutExtension($file.Name)
$thumb = "thumb/$baseName.jpg"

# Use ffmpeg to create the thumbnail
& ffmpeg -n -i $file.FullName -vframes 1 -vf "scale=256:-2" -q:v 7 $thumb
}
9 changes: 9 additions & 0 deletions assets/media_user/ffmpeg_thumbnails.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
for file in *; do
if [ -f "$file" ]; then
# Construct the filename for the thumbnail
thumb="thumb/${file%.*}.jpg"

# Use ffmpeg to create the thumbnail
ffmpeg -n -i "$file" -vframes 1 -vf "scale=256:-2" -q:v 7 "$thumb"
fi
done
Binary file added assets/media_user/thumb/YamatoNoNezumi.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e66261f

Please sign in to comment.