Showing posts with label thumbnail. Show all posts
Showing posts with label thumbnail. Show all posts

September 10, 2020

Make thumbnails for live streams

Nimble Streamer allows generating thumbnails on-the-fly for any outgoing stream. At the moment it supports two formats:

  •  a single-frame MP4 file which can be embedded into any web page via <video> tag.
  • a JPG file.

In order to start generating those thumbnail, you need to enable Generate MP4 thumbnails or Generate JPEG thumbnail parameter for either Global setting of the server or for specific applications' settings as shown below.

Nimble Streamer uses decoding and encoding libraries from Nimble Live Transcoder to get the image from the stream and then encode it into JPG.
So to get his feature working, first you need to install Live Transcoder and subscribe for a license. Once you've installed Live Transcoder and registered the purchased license, you can enable this feature.

Once the parameter is enabled, you can access the generated thumbnail via this kind of URL:

http://server_URL:8081/live/stream/thumbnail.mp4 
http://server_URL:8081/live/stream/thumbnail.jpg 

You may also use https:// if SSL is properly set up on your Nimble Streamer.

Here are the examples of global and per-application "Generate MP4 thumbnails" and "Generate JPEG thumbnails" setting enabled.  The thumbnails are re-newed within a Interval period which you set up after checking the checkbox, by default it's 6 seconds.

For JPEG thumbnails you may also specify their size.

Once you apply new setting, you must re-start your incoming stream on your encoder or origin server.


Related documentations

Live streaming in Nimble Streamer

December 23, 2018

DVR JPEG thumbnails in Nimble Streamer

DVR feature set in Nimble Streamer covers the majority of use cases for streams recording and playback, its setup is described in this article.

We've recently introduced MP4 snapshots of DVR stream which you may use directly via URL or certain kind. MP4 output was chosen over JPG images due to resources usage. MP4 frame can be extracted and inserted into MP4 container with relatively small amount of CPU and RAM. Thumbnails are generated as .mp4 files containing a single key frame. This allows inserting thumbnail in any modern browser using <video> element.

When it comes to saving still image snapshots via JPG, it requires frame decoding and encoding into proper format. That's why you'll need Nimble Streamer Live Transcoder to be available at your DVR server.

Install Live Transcoder and enable thumbnails


Nimble Streamer uses decoding and encoding libraries from Nimble Live Transcoder to get the image from the stream and then encode it into JPG.
So to get his feature working, first you need to install Live Transcoder and subscribe for a license. Once you've installed Live Transcoder and registered the purchased license, you can enable this feature in DVR settings.

Go to Nimble Streamer menu and click on Live streams settings. Once you open settings, go to DVR tab to see your DVR settings. To enable JPG thumbnails, open your stream DVR setting, click on Advanced settings and scroll to Generate JPEG thumbnails checkbox.

Enabling JPG thumbnails generation.
Check that box to enable the feature and use Thumbnail width and Thumbnail height edit boxes to specify dimensions of images. If you leave them as 0, Nimble will save full-size images. If you specify exact values, they will be used for every thumbnail. Another option is to specify only one of those dimensions, in this case, the image will have both sides proportional to each other. E.g. if you set up Thumbnail height to 480 with width set to 0, this will produce thumbnails with 480 height and proportional width, whatever it is for the original image.

Once you start recording any stream via DVR with the feature enabled, it will generate a JPG thumbnail for every recorded segment, its length is defined during the DVR setup. A thumbnail will be a key frame picture at the start of the corresponding segment. Notice that thumbnail generation takes time depending on your hardware so for large resolutions it might take a few seconds. However small resolutions on powerful hardware will allow generating it within a split of a second.

Get thumbnails


Now when DVR is working and pictures are generated continuously, you can get them using the followings URLs.

Latest available thumbnail can be obtained using this type of URL:
http://<server>/<app>/<stream>/dvr_thumbnail.jpg
If you'd like to get specific time spot, add Unix epoch time stamp:
http://<server>/<app>/<stream>/dvr_thumbnail_<epoch_time>.jpg
E.g. http://serverip/live/stream/dvr_thumbnail_1542708934.jpg. In this case Nimble Streamer will return a key frame image at the start of the corresponding segment.

Optimization


If you see that your DVR thread is consuming too much resources, you can add working threads by using thumbnail_transmuxer_threads parameter. Read this reference page for more details about Nimble configuration. By default, this parameter's value is "1".

You may also find useful the API call for DVR export to MP4.

If you have any questions on this or other features, let us know.

Related documentation


Nimble StreamerLive streaming scenariosDVR feature setDVR setup for Nimble Streamer, Watch DVR recording and playback in Nimble Streamer video tutorial

November 20, 2018

DVR MP4 thumbnails in Nimble Streamer

Nimble Streamer software media server has it DVR feature set which covers the majority of use cases for streams recording and playback.

DVR setup is described in this article and you're probably already familiar with it. Now, to get snapshots of DVR stream, you may use direct URL described below.

Notice that thumbnails are generated as .mp4 files containing a single keyframe. This allows inserting thumbnail in any modern browser using <video> element.

If you'd like to generate JPG thumbnails, please read this article.

The latest thumbnail can be obtained using the following URL:
http://<server>/<app>/<stream>/dvr_thumbnail.mp4
If you'd like to get specific time spot, add epoch time:
http://<server>/<app>/<stream>/dvr_thumbnail_<utc>.mp4
E.g. http://serverip/live/stream/dvr_thumbnail_1542708934.mp4

This feature is enabled by default and if you'd like to disable it, use this parameter in Nimble Streamer config file:
dvr_thumbnails_enabled = false

MP4 output was chosen over PNG or JPG images due to resources usage. MP4 frame can be extracted and inserted into MP4 container with relatively small amount of CPU and RAM. Still image capture requires frame decoding and encoding into proper format which needs extra resources. Our customers like Nimble Streamer primarily because of its high performance and we'd like to keep it that way.

Take a look at this video tutorial to see MP4 thumbnails in action and get familiar with DVR most useful features.


Read other documentation articles for more details and full description of available options.


You may also find useful the API call for DVR archive export to MP4.

If you have any questions on this or other features, let us know.

Related documentation


Nimble StreamerLive streaming scenariosDVR feature setDVR setup for Nimble Streamer