Media Indexing and video files
Media Indexing generates thumbnails for image files but does not generate thumbnails for video files (1, 2, 3) for some reason.File Station, DS File, Media Server and friends therefore cannot display thumbnails for video files:
Video Station does however generate thumbnails and those thumbnails are then available to File Station, DS File, Media Server and friends, even if the Video Station package is no longer installed. Looks like Video Station is simply using ffmpeg to generate a SYNOVIDEO_VIDEO_SCREENSHOT.jpg file in the @eaDir folder for each video file:
Console Output: Select all
$ while true; do ps -aefyl | grep ffmpeg | grep -v grep; sleep 0.1; done
/var/packages/CodecPack/target/bin/ffmpeg41 -timelimit 20 -an -ss 300 -i '/volume1/Media/Movies/The Man from Earth (2007).mkv' -vframes 1 -vf scale=size=hd480:force_original_aspect_ratio=decrease -f mjpeg -y '/volume1/Media/Movies/@eaDir/The Man from Earth (2007).mkv/SYNOVIDEO_TEMP.jpg'
$ find @eaDir
@eaDir/The Man from Earth (2007).mkv
@eaDir/The Man from Earth (2007).mkv/SYNOINDEX_MEDIA_INFO
@eaDir/The Man from Earth (2007).mkv/SYNOVIDEO_VIDEO_SCREENSHOT.jpg
Generate thumbnails for video files
The following filebot command uses -exec to execute ffmpeg for each video file to generate the missing thumbnail files:Shell: Select all
filebot -find "/volume1/Media/Movies" --filter 'def i = f.dir / "@eaDir" / f.name / "SYNOVIDEO_VIDEO_SCREENSHOT.jpg"; f.video && i.dir.exists() && !i.exists()' \
-exec ffmpeg -an -ss '{seconds/5}' -i '{f}' -vframes 1 -vf scale=size=hd480:force_original_aspect_ratio=decrease -f mjpeg -y '{folder}/@eaDir/{f.name}/SYNOVIDEO_VIDEO_SCREENSHOT.jpg'
Alternatively, you can use docker to run filebot and ffmpeg inside a container:
Shell: Select all
sudo docker run --rm -it -e PUID=0 -e PGID=0 -v "data:/data" -v "/volume1:/volume1" rednoah/filebot \
-find "/volume1/Media/Movies" --filter 'def i = f.dir / "@eaDir" / f.name / "SYNOVIDEO_VIDEO_SCREENSHOT.jpg"; f.video && i.dir.exists() && !i.exists()' \
-exec ffmpeg -an -ss '{seconds/5}' -i '{f}' -vframes 1 -vf scale=size=hd480:force_original_aspect_ratio=decrease -f mjpeg -y '{folder}/@eaDir/{f.name}/SYNOVIDEO_VIDEO_SCREENSHOT.jpg'
Generate thumbnails from movie posters
Fetch the movie / episode poster for each movie / episode file (see xattr metadata) and save it as SYNOVIDEO_VIDEO_SCREENSHOT.jpg file:Shell: Select all
filebot -find "/volume1/Media/Movies" --apply thumbnail
Delete thumbnails for video files
Find and delete SYNOVIDEO_VIDEO_SCREENSHOT.jpg and SYNOVIDEO_VIDEO_SCREENSHOT_JPEGTN.jpg files:Shell: Select all
find "/volume1/Media/Movies" -name 'SYNOVIDEO_VIDEO_SCREENSHOT*.jpg' -print -delete