Generate thumbnails for video files on Synology NAS

Support for Synology NAS, QNAP NAS and other Embedded Linux systems
Post Reply
User avatar
rednoah
The Source
Posts: 24560
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Generate thumbnails for video files on Synology NAS

Post by rednoah »

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:
Screenshot



:idea: 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:
** if the built-in ffmpeg does not work then you may need to use the /var/packages/CodecPack/target/bin/ffmpeg41 binary from the Advanced Media Extensions package

Shell: Select all

filebot -find "/volume1/Media/Movies" --filter 'def i = f.dir / "@eaDir" / f.name / "SYNOVIDEO_VIDEO_SCREENSHOT.jpg"; f.video && !i.exists() && seconds > 0 && (i.dir.exists() || i.dir.mkdirs())' \
		-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'
Screenshot

:idea: Alternatively, you can use docker to run filebot and full-featured ffmpeg inside a container:

Shell: Select all

sudo docker run --rm -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.exists() && seconds > 0 && (i.dir.exists() || i.dir.mkdirs())' \
	-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'


:idea: If you are using the DLNA media player of your Smart TV (e.g. LG webOS TV) then you may need to select Default Profile in the Media Server settings to make thumbnails work:
Screenshot





Task Scheduler

You can use Task Scheduler to generate video thumbnails automatically on a schedule:

Shell: Select all

SHARE='/volume1/Media'

docker run --rm -e PUID=0 -e PGID=0 -v 'data:/data' -v "$SHARE:$SHARE" rednoah/filebot \
	-find "$SHARE" --filter 'def i = f.dir / "@eaDir" / f.name / "SYNOVIDEO_VIDEO_SCREENSHOT.jpg"; f.video && !i.exists() && seconds > 0 && (i.dir.exists() || i.dir.mkdirs())' \
	-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'
ScreenshotScreenshot


You can use Task Scheduler to generate HEIC / HEIF photo thumbnails automatically on a schedule:

Shell: Select all

SHARE='/volume1/Media'

docker run --rm -e PUID=0 -e PGID=0 -v 'data:/data' -v "$SHARE:$SHARE" rednoah/filebot \
	-find "$SHARE" --filter 'def i = f.dir / "@eaDir" / f.name / "SYNOFILE_THUMB_S.jpg"; ext ==~ /(?i:HEIC|HEIF)/ && !i.exists() && (i.dir.exists() || i.dir.mkdirs())' \
	-exec convert -verbose '{f}' -thumbnail '1280x1280>' -write '{folder}/@eaDir/{f.name}/SYNOFILE_THUMB_XL.jpg' -thumbnail '360x360>' -write '{folder}/@eaDir/{f.name}/SYNOFILE_THUMB_M.jpg' -thumbnail '120x120>' '{folder}/@eaDir/{f.name}/SYNOFILE_THUMB_S.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
Screenshot





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
:idea: Please read the FAQ and How to Request Help.
iconoclast
Posts: 3
Joined: 30 May 2026, 14:28

Re: Generate thumbnails for video files on Synology NAS

Post by iconoclast »

I have a Synology NAS DS124. I'm trying to generate video thumbnails for video files taken with my phone. I'm very new to Linux and I"m not super technical.

So far I have installed Filebot and Filebot node through the package center in DSM. I have also installed FFMPEG 7, Java Installer, and JSNode. I see the scripts that have been recommend to be added to facilitate thumbnails but I don't know where or how to put them. Can someone please walk me through the next steps?
User avatar
rednoah
The Source
Posts: 24560
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Generate thumbnails for video files on Synology NAS

Post by rednoah »

iconoclast wrote: 30 May 2026, 14:41 I see the scripts that have been recommend to be added to facilitate thumbnails but I don't know where or how to put them. Can someone please walk me through the next steps?
You can use Task Scheduler to create and run scripts:

ScreenshotScreenshot


:idea: Note that the Task Scheduler example above relies exclusively on docker. This means that any dependencies (other than Container Manager) that you may or may not have installed via Package Center will not be used and do not matter.


:idea: DSM › Control Panel › Task Scheduler is part of Synology DSM. You can create new scheduled tasks via the Create button. After that you just copy & paste the shell script, adjust it to your needs, and run it. Make sure to send the output to yourself via email (or by setting an output results folder) so you can see what your script is doing, or not doing if something doesn't work.
:idea: Please read the FAQ and How to Request Help.
iconoclast
Posts: 3
Joined: 30 May 2026, 14:28

Re: Generate thumbnails for video files on Synology NAS

Post by iconoclast »

So are you saying that I can run this functionality using task scheduler alone? Did I need to install Filebot, Java Installer, FFMPEG? This is where I get confused. Is Docker the same as Container Manager and do I need to install it?

I guess these are the questions I have. In order to enable video thumbnails in file station,
- What packages do I need to install?
- Can said packages be installed through the DSM Package Center or do they need to be installed through Docker (Container Manager)?
- Once those packages are installed, what script needs to be added and where do I add it?

Thank you for the help.
User avatar
rednoah
The Source
Posts: 24560
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Generate thumbnails for video files on Synology NAS

Post by rednoah »

iconoclast wrote: 31 May 2026, 01:21 So are you saying that I can run this functionality using task scheduler alone?
Yes. Open Task Manager. Create Task. Paste Shell Script as shown in the screenshots above. Maybe modify the first line. That's it.

ScreenshotScreenshot


:idea: You can click on the screenshots above to make them bigger. That's what you want to see on your screen when you configure the Task Manager to run our custom script.


:idea: You can copy & paste the code from here:

Shell: Select all

SHARE='/volume1/Media'

docker run --rm -e PUID=0 -e PGID=0 -v 'data:/data' -v "$SHARE:$SHARE" rednoah/filebot \
	-find "$SHARE" --filter 'def i = f.dir / "@eaDir" / f.name / "SYNOVIDEO_VIDEO_SCREENSHOT.jpg"; f.video && !i.exists() && seconds > 0 && (i.dir.exists() || i.dir.mkdirs())' \
	-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'



:idea: docker is indeed part of Container Manager. That's the only package you need to install via DSM Package Center. Container Manager is usually already installed, so you usually don't need to open DSM Package Center at all. You don't need to open Container Manager either. It just needs to be installed for the docker command to work.




:?: If you continue to have trouble, make sure to screenshots of what you have so far / or where you're stuck, so that we can see what you can see.
:idea: Please read the FAQ and How to Request Help.
iconoclast
Posts: 3
Joined: 30 May 2026, 14:28

Re: Generate thumbnails for video files on Synology NAS

Post by iconoclast »

Thank you for taking the time to assist me. Your responses make sense and are helpful. I would like to ask though because I'm a little confused. I've read other places that I"m supposed to install FileBot, Java Installer, FFMPEG, JSnode. Is this not the case? Those packages are not needed to create video thumbnails?
User avatar
rednoah
The Source
Posts: 24560
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Generate thumbnails for video files on Synology NAS

Post by rednoah »

iconoclast wrote: 01 Jun 2026, 01:16 Thank you for taking the time to assist me. Your responses make sense and are helpful. I would like to ask though because I'm a little confused. I've read other places that I"m supposed to install FileBot, Java Installer, FFMPEG, JSnode. Is this not the case? Those packages are not needed to create video thumbnails?
No, you don't to need install any packages via DSM Package manager (other than Container Manager) so you really really just need to follow the instructions as shown in the screenshots above. If you are stuck, show us screenshots of where you are stuck.
:idea: Please read the FAQ and How to Request Help.
Post Reply