DekTec logo
Command-Line Options for ffmpeg and ffplay  

Command-Line Options for ffmpeg and ffplay

This page details the command-line options for 'ffmpeg' and 'ffplay' introduced by DekTec. These options are designed to facilitate real-time input and output when using DekTec devices, as well as to provide support for the .sdi file format. They are supplemental to the extensive range of options already offered by ffmpeg and ffplay.

 

Quick Overview

Explore the specialized command-line options added to FFmpeg for seamless integration with DekTec devices and the .sdi file format.

Main

-f dektec

(input/output)

-i <serial>[:<port>]

(input)

<serial>[:<port>]

(output)

-url:<stream> <url>

(input/output)

SMPTE 2110

-aspp <num>

(audio output)

-bps <bits>

(audio input)

-n_channels <num>

(audio input)

-pf <pixel_format>

(video output)

-pm <mode>

(video output)

-ps <bytes>

(audio/video output)

-pt <type>

(audio/video output)

-sample_rate <rate>

(audio input)

-sch <mode>

(video output)

NMOS

-nmos_registry <url|auto>

(a/v input/output)

-nmos_label <name>

(a/v input/output)

-nmos_host <ip_address>

(a/v input/output)

-nmos_port <ip_port>

(a/v input/output)

-nmos_wait <duration>

(a/v input/output)

SDI

-calc_crc <0|1>

(.sdi output)

-threads <num|auto>

(.sdi input/output)

Supported DekTec Adapters

DTA-2110 ST 2110 1x 10G SFP+
DTA-2172 SDI 2x in or out
DTA-2174B SDI 4x in or out
DTA-2178 SDI 8x in or out

Input/Output via DekTec Devices

When using FFmpeg commands ('ffmpeg' or 'ffplay') to handle real-time streams originating from or directed to a DekTec device, adhere to the following option structure:

For input:

ffmpeg|ffplay [<ffmpeg_args>] [<dektec_args>] -f dektec -i <serial>[:<port>]

This sets the DekTec device identified by the specified serial number and optional port as the input source. If no port is specified, port 1 will be used by default.

For output:

ffmpeg [<ffmpeg_args>] [<dektec_args>] -f dektec <serial>[:<port>]

This designates the DekTec device with the given serial number and optional port as the destination for the output stream. If the port is omitted, port 1 will be used as the default.

Main Options

-f dektec (input/output)

Explicitly instruct 'ffmpeg' or 'ffplay' to use a DekTec device for input or output.

-i <serial>[:<port>] (input)

Set the serial number and optional port for the DekTec device providing the input stream. Defaults to port 1 if no port is specified.

<serial>[:<port>] (output)

Set the serial number and optional port for the DekTec device receiving the output stream. Defaults to port 1 if no port is specified.

-url:<stream> <url> (input/output)

Specify the URL for a video (v) or audio (a) stream. For an input, you can also specify nmos instead of an address. This allows an NMOS controller to select the stream to receive. See NMOS Options below.

SMPTE 2110 Options

-aspp <num> (audio output)

Set the number of audio samples per RTP packet. Default is 48. Minimum value is 1. Maximum value depends on the audio properties. Common values are 6 and 48.

-bps <bits> (audio input)

Specify the audio bit depth per sample. Allowed values are 16 and 24.

-n_channels <num> (audio input)

Specify the number of audio channels. Allowed range is from 1 to 64.

-pf <pixel_format> (video output)

Specify the pixel format. Default is auto. Other values are 8 and 10. Automatic pixel format conversion is done if the video pixel format doesn't match this argument.

-pm <mode> (video output)

Set the SMPTE 2110 packing mode. Allowed values are block, line, and general. Default is block.

-ps <bytes> (audio/video output)

Specify the RTP payload size in bytes. Default is -1 and automatically sizes the RTP packets. Allowed range is from 1 to 1440.

-pt <type> (audio/video output)

Specify the RTP payload type. Default is 96. Allowed range is from 96 to 127.

-sample_rate <rate> (audio input)

Specify the audio sample rate. Allowed values are 32000, 44100, 48000, and 96000.

-sch <mode> (video output)

Set the SMPTE 2110 scheduling mode. Allowed values are gapped and linear. Default is gapped.

NMOS Options

NMOS is a standard way for broadcast control systems to discover and connect SMPTE 2110 devices. With the options below, FFmpeg registers itself with an NMOS registry. A controller can then discover its streams and connect them without requiring multicast addresses to be specified on the command line.

On an output, each stream appears in the controller as a sender. The controller can change the address to which a sender transmits, or enable or disable the sender. When disabled, the sender does not transmit any data.

On an input, each stream appears in the controller as a receiver. If -url:v nmos is specified instead of an address, FFmpeg does not initially know which stream to receive. It waits until a controller connects the receiver to a sender and then starts receiving. The controller can later switch the receiver to another stream with the same format (resolution, frame rate, and so on). A connection to a stream with a different format is rejected.

These options require an FFmpeg build with NMOS support.

-nmos_registry <url|auto> (a/v input/output)

Register the SMPTE 2110 streams with an NMOS registry. Specify the address of the registry, e.g. http://registry.local, or specify auto to discover a registry automatically on the network. Without this option, FFmpeg does not use NMOS.

-nmos_label <name> (a/v input/output)

Set the name under which FFmpeg appears in the controller. The names of its streams are prefixed with this name. The default is ffmpeg-<serial>:<port>.

-nmos_host <ip_address> (a/v input/output)

Specify the IP address of this computer on which controllers can reach FFmpeg. By default, FFmpeg uses the address of the network interface that leads to the NMOS registry. Set this option only if the computer has multiple network addresses and the automatically selected address is incorrect.

-nmos_port <ip_port> (a/v input/output)

Specify the network port on which controllers can reach FFmpeg. The default is 0, which causes FFmpeg to select a free port. Set this option if a firewall allows connections only to specific ports.

-nmos_wait <duration> (a/v input)

Specify how long FFmpeg waits for a controller to connect the streams specified as nmos. If no controller connects the required streams within this time, FFmpeg stops with an error listing the streams that were not connected. The default is 60 seconds. A negative value causes FFmpeg to wait indefinitely.

SDI Options

-calc_crc <0|1> (.sdi file output)

Enable ('1') or disable ('0') the calculation of CRC checksums for each SDI line in the .sdi output file. Default is '1'. Disabling ('0') can speed up ffmpeg.
When using a DekTec SDI output device, the line CRCs are computed automatically by the hardware, making this option redundant.

-threads <num|auto> (.sdi file input/output)

Specify the number of threads used to convert each SDI frame. The default is auto: a maximum of 4 threads are used to convert the SDI frames.

Example Command Lines

Decode the video and audio of the first service from the MPEG-2 Transport Stream file input.ts. Then, output the uncompressed video and audio as SMPTE 2110 streams via a DTA-2110 device, targeting the specified multicast URLs.

ffmpeg -i input.ts -url:v 239.0.0.5:5678 -url:a 239.0.0.6:5680 \
       -f dektec 211000054

Receive and display a SMPTE 2110 video stream via a DTA-2110 device, with auto-detection of video parameters enabled by the DekTec FFmpeg extension.

ffplay -url:v 239.0.0.5:5678 -f dektec -i 2110000054

Receive a video stream via a DTA-2110 that an NMOS controller selects, with the registry discovered automatically on the network.

ffmpeg -f dektec -nmos_registry auto -url:v nmos -i 2110000054:1 -f null -

Receive a SMPTE 2110 video and audio stream via a DTA-2110 device, and display the video in a window while playing the audio through the computer's audio output. The DekTec FFmpeg extension automatically detects both the video and audio formats.

ffplay -url:v 239.0.0.5:5678 -url:a 239.0.0.5:5680 -f dektec -i 2110000054

Receive a SMPTE 2110 audio-only stream via a DTA-2110 device and play it through the system's default audio output. In this example, auto-detection is bypassed by specifying the audio format directly in the command line.

ffplay -url:a 239.0.0.5:5680 -sample_rate 48000 -bps 24 -n_channels 2 \
       -f dektec -i 2110000054

Decode a Transport Stream file and play it out as a real-time SDI stream via a DTA-2178 device on port 3.

ffmpeg -i input.ts -f dektec -i 2178000024:3

Send a test pattern via a DTA-2110 as an NMOS sender, registered with the registry at 192.168.10.11.

ffmpeg -f lavfi -i testsrc2=size=1280x720:rate=25 -pix_fmt uyvy422 \
  -f dektec -url:v 239.100.9.5:5004 -nmos_registry http://192.168.10.11 211000054:1

Receive a real-time SDI stream via a DTA-2178 device on port 1. Display the video in a window and play the audio through the system's default audio output.

ffplay -f dektec -i 2178000024:1

Decode the video and audio of the first service in an MPEG Transport Stream and convert them to SDI format, saving the output as an .sdi file.

ffmpeg -i input.ts output.sdi

Read an .sdi file and display its video content in a window, while playing the audio through the system's default audio output.

ffplay input.sdi