August 30, 2021

Generate NDI stream from local files via Server Playlist

We want to tell you about Server Playlist feature, which lets you create live streams from the video or audio files on your storage. This feature gives vigorous possibilities to your live streaming setup: from simply running a video in a loop as a backup stream to arranging a precise schedule for programs to run at a specific time. Multiplied by Nimble’s and Live Transcoder processing power, you can have any desired live stream egress ranging from re-publishing for any major streaming provider via RTMP or have a precise NDI stream to your equipment. Any supported output protocol can be used, including cutting edge SLDP, SRT and RIST.

As you finish reading this tutorial, you will be able to stream files from a hard disk drive as NDI streams and learn the basics of playlist editing for Nimble Streamer.

For our use case, we will just describe a couple of files in a playlist and loop them endlessly to a live stream, next we set up the Transcoder to make NDI output.


Step 1: Check Prerequisites

First, make sure you have the latest version of Nimble Streamer. You can install it using this instruction or upgrade it.

Second, make also sure that the Transcoder package is installed as described on Transcoder installation page.

Third, you need to have an active Live Transcoder license with respective subscription. Check the license at your account Settings menu under Transcoder licenses tab.

Also, we assume that all your video files are encoded with H.264 and have the same resolution and stereo AAC audio stream, so no additional encoding will be discussed.


Step 2: Make Nimble to know your playlists

Conception starts with a Playlist that uses a JSON syntax to describe files for making a live stream. JSON is powerful yet clear and various online tools can be used to validate it against errors.

To make Nimble know the playlist is engaged in work, specify a location of your playlist by adding the server_playlist_sync_url option to nimble.conf. Location can be either a local path on a hard disk drive with Nimble or HTTP(s) URL. 

Add the next string to /etc/nimble/nimble.conf file:

server_playlist_sync_url=/var/nimble/playlists/basic_playlist.json

and restart Nimble to apply changes. We will fill basic_playlist.json a moment later.

The playlist will be reloaded every 10 seconds, so you can make dynamic changes via some custom scripting and these changes will be accepted by Nimble. If you want any other update time interval, you may set it via the server_playlist_sync_interval option in nimble.conf or via the playlist itself.


Step 3: Write a playlist and get your live stream


The playlist’s grammar is based on key sections: Tasks, Blocks and Streams - which can have their own properties, e.g. Start time or Duration.

Now, copy this text to basic_playlist.json file using your preferred console editor:

{
  "Tasks": [
    {
      "Stream": "live/from_playlist",
      "Blocks": [
        {
          "Id":"1",
   "MaxIterations":0,
           "Streams" : [
            {"Type": "vod", "Source": "/var/nimble/mp4/bbb_1080p_h264_aac.mp4"},
            {"Type": "vod", "Source": "/var/nimble/mp4/TOS-1080p_aac.mp4"}
          ]
        }
      ]
    }
  ]
}

A few seconds later you will notice stream live/from_playlist appearing at Live Streams / Outgoing Live streams of your server.



This very basic example perfectly illustrates the mandatory fields and values of a playlist. It contains one Tasks, one Block, and two Stream sections.

Tasks object represents an array of alive streams, which must have a name set by a Stream field as application/name. Tasks also hold an array of Blocks that can be started at different times. It is achieved via Start property, but we are not discussing it for now in this tutorial. Each block must have a unique Id and a number of times to run. These repetitions are set by MaxIterations and each block runs only once by default. Setting MaxIterations to 0 means the infinite loop of a block.

Next comes the Streams array of objects which holds the full path and name of a file to play within the previously defined live stream. Source property is used for this. At the moment, Type property needs to be “vod” in case of files.

No more additional properties are needed for our simplified case but more details can be found at feature technical spec if needed.

Step 4: Turn Live Stream into NDI stream

Now, you see a live/from_playlist stream, so it can be processed via Transcoder to have NDI output.
Create a new Transcoder scenario and use live/from_playlist as Audio and Video Input.


As for Video and Audio output, click NDI radio button and name it from_playlist:




Click Save button and switch to a console to check available NDI streams with the nimble_ndi tool or any other NDI-supported software.





You did a great job by easily transforming your video files to an NDI stream using the Nimble Server Playlist feature and Live Transcoder.

Also take a look at Server playlist support for live steams input article in case you'd like to mix live with VOD in your playlist.

We will continue to show more elegant scenarios and more complex playlists’ grammar in our later articles. Please feel free to share this article with anyone who may be interested in Nimble Streamer’s ability to playback files as a live stream.

Also check our short video about Recording NDI as HLS DVR for further playback with Nimble Streamer.

Related documentation


August 8, 2021

Best practices for Larix Broadcaster production deployment

Larix Broadcaster is a universal mobile tool which is used in a variety of cases from a single event to complex multi-device production. Large-scale deployments show that you may successfully use modern mobile devices for live content remote contribution.

For example, as per Sports Video Group News, Larix was used in 2020 virtual drafts of NFL and MLB. They've released two articles regarding NFL Draft, with Larix Broadcaster mentioned as part of streaming setup: "NFL Draft 2020 ..." and "NFL Draft Reflections ...". The MLB Draft is covered in their respective MLB Draft 2020 article.
In this article we'll overview the best practices and recommendations for Larix Broadcaster deployments and mobile live streaming in general, based on our customers' experience.


Testing is crucial


First and most important advice we can give is: test as much as you can prior to your live event. This relates to hardware capabilities, software features, network and environment features.

This is especially important before making decisions about buying a significant amount of hardware, e.g. when you purchase a fleet of devices for your crew. In general it's good to have identical devices for all members of the team, so we highly recommend doing testing before such purchase.

So start with getting your hands on at least one device and try running your streaming scenarios on it. 

First, check the straight-forward scenario with some default settings (720p@30fps, H.264, default bitrate etc.) then move to those settings which you'd like to use in production if they differ. Short tests need to be combined with long runs.

Then try to push the limit. If your event is planned for 1 hour then run a 2-hours test, just to try the robustness of your device and your streaming setup. If your designated device has any energy-related or temperature problems, you'll see them at this point.

As part of our testing routine before major public releases, we run an hour-long test with periodic changing scenes, doing rotation, camera flip etc to imitate intensive work. Then we also do a work-day-long test with more static-scene streaming to make sure Larix won't cause troubles or overheat on the long run. We call all that the "endurance test".

Android vs iPhone


iPhone is the best option for live streaming so far. We run our tests on a range of devices from iPhone 6s to iPhone 11 Pro, and they all provide Larix with 1080p@60fps encoding. Starting from iPhone XR, latest models even provide 4K@60fps. Of course, you can surely use HEVC for all these modes. The image quality is also excellent, as you would expect.

What about Android? Most of the manufacturers provide only standard to minimum capabilities for third-party apps. We can confirm only one device which supports all the features of Android platform, that is Google Pixel 5. You can be sure Larix will pick up 1080p@60fps, concurrent cameras, 4K@30fps and all the latest platform features.

Android platform encourages the existence of what we call a "zoo of devices". This means a wide variance of shapes, sizes and features, however when it comes to encoding, a vendor will probably follow basic requirements like 1080p@30fps but most other image-related features won't be available for third-party apps. So you won't see 60fps, concurrent cameras or sometimes even 4K in Larix Broadcaster. Unlike iPhone, most Android devices do not provide exact frame rate of 25fps.

Read more about FPS support on Android and iOS in Q2 of our FAQ. It's a bit tricky on mobile devices in general.

If you prefer using Android and you don't need fancy image features, then most mid- to high-tier Android devices should work fine for you. But you need to run proper testing as described above. We use several devices by Samsung, Xiaomi and other brands and they work well in our tests. So far Pixel 5 is the best among them.

One more notice about Android: Larix Broadcaster can be used in background mode which will allow turning off the screen, thus saving energy and making the device less warm.

If you prefer an iPhone then basically any affordable model will do the job.

Audio, additional gear and tricks


Many of our customers use external audio equipment to obtain better sound for their live streams. We like good sound so besides "standard" features like sample rate or channel count, we allow selecting audio source as well as stream in "audio-only" mode when Larix streams only audio part of content. We also plan to extend this with gain control later on.

We also see our customers using external microphones and external sound cards successfully, for example we test Larix with iRig HD2 and it works great. Some sound cards require different audio sample rates, i.e. strictly 48000Hz or 44100Hz. So if you experience issues please check that setting, and also switch audio sources as some devices are capricious about that.

Besides audio, additional streaming gear may include lightning kits and tripods, these are things that you need to pick up according to your case.

Take a look at The Ultimate Guide To DJ Livestreaming by Phil Morse who gives a good overview of audio hardware, other gear and best practices.

Notice that Larix Broadcaster provides image framing features like rule-of-thirds and safe margins. We recommend you to watch Video Camera and Webcam Framing for Live and VOD tutorial by Jan Ozer to get some creative ideas.

And of course don't forget about the power source. Your phone battery may be excellent but high-quality streaming will eat it very quickly. So either get some good power bank or just plug your phone into a charger. Notice that you'd like to reduce power consumption and have less heating. you can disable live rotation and image overlays, this simplifies the post-processing.

Streaming protocols


Today we have two general options when choosing a live streaming protocol: SRT and RTMP.

If you use popular public services like YouTube Live, Facebook Live or Twitch, you have no choice but to use RTMP. It's an old and well-implemented technology available in any service and live decoder. It does the job properly for a large number of use cases, especially when you stream in a controlled reliable network environment. Larix Broadcaster has solid RTMP support and it's tested with all major RTMP-powered solutions.

If you build your own streaming network or if you can choose a provider with SRT input, you should definitely consider SRT. This is especially important if your crew members stream in mobile networks. SRT was designed for operating in unreliable networks so even if your network has significant packet loss, this will be properly handled by re-sending the lost packets. This advantage comes with a downside: you need to set a latency parameter which defines a time buffer used for compensating the glitches, so keep in mind that you'll have that delay in your production input. We recommend using latency parameters as 4*RTT with your streaming destination, please read this article for more details.

Larix Broadcaster has full support for SRT publishing in Caller, Pull and Rendezvous modes and SRT is being properly tested with all major SRT solutions and tools. Most modern hardware decoders can process SRT (e.g. Haivision is the inventor of SRT and their devices have full support). There are also a lot of software solutions like our Nimble Streamer or Wowza Streaming Engine capable of SRT streaming, so if you decide to try something different from default live streaming services, you'll have plenty of options.

Larix also supports RTSP and RIST output even though those protocols are not used as widely as RTMP or SRT.

So work with your server-side team or your streaming service provider to see which option you may use.

Talkback


Remote contribution often means that a talent needs to be in contact with the studio. Larix Broadcaster supports Talkback, that is IFB audio return feed which you may get on your mobile device using several protocols. You can use any software or hardware solution to generate a live stream with voice instructions from the studio and use earpiece on a mobile device to hear it.

Take a look at our video setup instruction and watch mobile reporter use case demonstration with SRTMiniServer which supports talkback generation.

Larix Grove


If you operate a fleet of devices for live content contribution you need a way to provide your crew with connections' details. Every contributor will have separate connection URL and you'll need to explain each of them how to make the setup. You may use Larix Grove format and UI wizard to create specially formed links and their QR codes to propagate your settings. The settings are imported into Larix Broadcaster and the stream can be started right after that.

Larix Tuner



Besides just settings' propagation, there are a few typical problems that remote production producers may face:
  • Remote contributors need to get new connections settings easily to stream to the right servers in studio facilities, without too many manual actions.
  • With multiple mobile devices set on scene, each one needs to be controlled remotely: define settings, start/stop stream, mute/unmute, enable overlays, etc.
  • Remote producers want to get stats from remote devices, to make infrastructure adjustments.
Larix Tuner provides all these features and even more. You just subscribe for a licenses and activate it on your operators' devices, then operators pass control to Tuner, and from that point the producer can define settings, control behavior and preview what's on device' screen.

Test any further changes


So you've run your tests prior to your live event and Larix Broadcaster works perfectly, like you would expect. 

Now, freeze the settings and don't change anything until the event is over. No software updates, no settings change - just run the event with previously tested devices.

If you really need to make changes to either your mobile app or to server-side part between further events, then start your testing from the beginning to make sure that nothing is broken.

You can never over-test, the more you test the better.


We hope these recommendations are useful for you. If you have your own experience which might be useful for other streamers out there, please don't hesitate to send us a message about it. We appreciate all feedback from our customers.


Follow us in social media to get updates about our new features and products: YouTubeTwitterFacebookLinkedInRedditTelegram