Flussonic Media Server documentation

Ad Injector

Ad Injector embeds commercial into stream Anchor Anchor x2

Ad Injector is a tool for inserting video ads into a video stream. If Ad Injector is configured to work with a video stream, then at a certain time one of the selected ads will be played instead of the stream, and then it resumes playing the primary stream.

Setting up Ad Injector Anchor Anchor x2

Follow the procedure below to configure Ad Injector.

  1. Add the following line anywhere in the configuration file (flussonic.conf): plugin ad_injector; and restart the Flussonic instance (/etc/init.d/flussonic restart).

  2. Download videos with ads to the server, into a VOD files directory. More details about VOD you can read here.

  3. Warning! In newer version Flussonic Media Server this panel access on link http://flussonic/admin1#/ad_injector. Open the web interface. On the main page select the Ad Injector tab. Ad Injector setting page will appear.

  4. Create a schedule. To do this in the section entitled Ad Schedules enter the name of your schedule in the text box and click the Add Schedule button. In the Ad Schedules section you should see a list of advertising schedules with Delete button and Schedule: <schedule name> text. You can delete a schedule by clicking the Delete button.

  5. Adjust your ad slots. To do this click on Schedule: <schedule name>. Under the schedule should be available settings for advertising slots. For each slot, you can adjust a playing time in HH:MM:SS format in UTC, and duration of the slot in seconds. Sample configuration may look like this: In this example, the schedule is set up for two slots: one will be played at 12 am for 15 seconds, and the second will be played at 12 am for 15 minutes 10 seconds. Each slot can be removed by clicking the Delete button. You can add a new slot by clicking the Add slot button.

  6. Select videos for your advertising slots. To do this, in the Files section, select a folder where you store video files that was downloaded in step 2, and in the drop-down list tick all videos you want to be played within your advertising schedule. Added files are displayed in the list of ad slots. You can remove a video from a schedule by clicking the cross in front of its name. In this example, TEST schedule uses two files: stream.mp4 и uni169c10.mp4.

  7. Configure priorities of previously added videos. To do this, type the priority ("weight") the text box in front of the file name. The higher is "weight", the sooner this file will be played. If all weights are the same, all files will be played in original order. After each show, file weight is reduced by 1. As soon as a weight of all files in the schedule reaches 0, all weights are reverted to original values. If duration of a video file is longer than corresponding slot duration, the system selects a next video in accordance with its weight. If remaining length of a slot is too short to display a video file entirely, the slot will be terminated prematurely and a primary video stream will be resumed.

  8. Save your settings by clicking the "Save and apply" button.

Warning! If your server is already setup for Ad Injector, when you started using Ad Injector via the web interface you must click Reload from server button. If you do not, then when you click Save and apply any existing settings will be overwritten.

  1. Create stream with this advert schedule. The source URL of such stream will be ad_injector://STREAM_NAME/SCHEDULE. Example. Let you have a stream named ch1 and advertising schedule advert1. New advertising stream can have any name, let it be ch1_adv: erlang stream ch1_adv { url ad_injector://ch1/advert1; }

This stream can be created in admin panel or by editing config file /etc/flussonic/flussonic.conf.

Links to your video stream with advertising will now look like this:

  • RTMP: rtmp://server/static/ch1_adv
  • HLS: http://server/ch1_adv/index.m3u8
  • HDS: http://server/ch1_adv/manifest.f4m

(server — domain name of your server)

Statistics Anchor Anchor x2

Ad Injector also gives you an option to view playback statistics and unique views of your advertising. You can find these statistics in the Adverted streams section at the Ad Injector settings page. If a schedule is attached to a video stream, and it has at least one recent show, it will be present in this section under its alias. For each ad, views and shows are displayed. The "show" is a single show of an ad that was broadcasted by the server, and the "view" is viewing of at least one part of the video by a single viewer.

Statistics are kept for one last day only.