Skip to main content

Generating thumbnails from streams

Ant Media Server can generate periodic previews (snapshots) of the incoming streams on the fly. This guide will help you learn configuration parameters for generating and using previews.

In order to activate preview generation, you just need to add at least one adaptive bitrate. You can do that in the dashboard using Application > Your App > Settings > Add New Bitrate

Generated preview images will be available in this URL template:


With v2.4.3 and later, "_finished" suffix is added to PNG file after streaming has finished. So that it will be in the following template


The absolute path of the preview image is as follows:


In addition to this, you can also upload preview images to Amazon S3. Please check out the instructions for S3 Integration.

Configuration parameters

You can add/change following properties to the <ANT_MEDIA_SERVER_DIR>`/webapps/`<APP_NAME>`/WEB-INF/

settings.previewHeight: Preview image is saved as 480p default. If you want to increase the resolution, add the following parameter into file.


settings.createPreviewPeriod: Preview image creation period in milliseconds. The default value is 5000 ms. As an example, if you change it as follows, it will create a preview every second.


settings.previewOverwrite: Default value is false. If it is false, when a new stream is received with the same stream id, _N (increasing number) suffix is added to the preview file name. If it is true, a new preview file will overwrite the old one.


settings.addDateTimeToMp4FileName: Default value is false. If true, adds date-time value to file names. If false, it does not add date-time values to file names.


As an alternative, you can also enable this feature on the web panel by enabling the tick box under Application >` Your App >` Settings >` Add Date-Time to Record File names and saving the settings.

settings.previewGenerate: Default value is true. If false, preview images will not be generated.


Keep in mind that if you change the configuration files, you also need to restart Ant Media Server for changes to take effect.

systemctl restart antmedia

You can also enable thumbnail generating options from web panel after version 2.4.3:

![](@site/static/img/Screenshot from 2022-03-30 16-40-21.png)

Share feedback