Skip to main content
Skip table of contents

FFmpeg Streaming Source Filter Specification

The FFmpeg Streaming Source filter can only be used as the first filter of an input graph. It reads audio data from various types of streams.

JSON Structure

JS
{
	"name": "FFmpeg Streaming Source",
	"url": "...",
	"videoStreamIndex": ...,
	"audioStreamIndex": ...,
    "reconnectOnError": ...,
    "reconnectionTimeOutMs": ...,
    "options": {
        ...
    }
}
FieldDescription
url

The url to an SDP file, M3U8 (HLS) or RTSP, RTMP, HTTP stream. (required) E.g. https://dg-rbb-https-fra-dtag-cdn.sslcast.addradio.de/rbb/inforadio/live/mp3/128/stream.mp3

audioStreamIndexIf the RTSP URL outputs more than 1 audio stream, you can specify the index of the audio stream to use (in the 0..n-1 range). Default: 0 (optional, int)
videoStreamIndex

-1. Currently not implemented.

reconnectOnError

In case of unreliable, "infinite" streams (e.g. internet/web radio) you can change the the connection behaviour on errors and end of file/stream. Default: false (optional, boolean)

true: try reconnect after an connection error or at end of stream. After the specified time-out is elapsed, reconnection tries are given up with an error.

false: end of stream and error lead to the regular end/error behaviour.

reconnectionTimeOutMsThe time-out of the reconnection tries in milliseconds. Default: 1000 (optional, number). ReconnectionTimeout is only considered it reconnectOnError is TRUE.
optionsAn optional list of arbitrary key/value pairs, which are passed to the filter "as is". Details will be added here as they become available. The key/value pairs reflect the ffmpeg.exe command line parameter. Default: (none)

Notes: 

  • The video stream will not actually be rendered by ROAD. However, the FFmpeg Streaming Source filter needs the info to properly work with multiplexed audio/video streams.

Using

In order to get streaming work use the following steps.

  • Start StreamingConfigurator.exe (ROAD Streaming Configurator)
  • If the stream is played back as expected, copy the ROAD configuration and use it 

Troubleshooting

If you do not get an error in ROAD, but also don't hear anything in the player, 

  • use ffplay.exe to get the desired command line options. (see https://ffmpeg.org/ffplay.html) Example: ffplay.exe -loglevel debug -protocol_whitelist rtp,file,udp g:\_TEST\test.sdp

Examples

RTP Streaming (with SDP file)

JSON Structure for HTTP (chunked transfer) streaming

JS
{
	"name": "FFmpeg Streaming Source",
	"url": "C:\MySdpFiles\stream.sdp"
}

HTTP Streaming (chunked transfer encoding)

JSON Structure for HTTP (chunked transfer) streaming

JS
{
	"name": "FFmpeg Streaming Source",
	"url": "http://swr-swr3-live.cast.addradio.de/swr/swr3/live/mp3/128/stream.mp3",
	"userName": "",
	"password": "",
	"program": -1,
	"videoPid": -1,
	"audioPid": 0,
	"videoStreamIndex": -1,
	"audioStreamIndex": 0,
    "reconnectOnError": true,
    "reconnectionTimeOutMs": 5000 
    "options": {
		"reconnect_delay_max": 120,
		"reconnect_on_network_error": 1
	}
}

HLS Streaming

JSON Structure for HLS streaming

JS
{
	"name": "FFmpeg Streaming Source",
	"url": "d:/myRadioStream.m3u8.tmp",
}

File (for debugging)

JSON Structure for HLS streaming

JS
{
	"name": "FFmpeg Streaming Source",
	"url": "d:/test.mp3"
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.