MediaEngine supports multiple types of input signals:
- Local video files
- Network streams
- NDI signals
- SDI signals
- Hardware devices
- Static images
- Image sequences
This article, it is covered how to configure and initialize the sources.
Local Files and Network Streams
This type of source is used with the "-i" attribute which is followed by a path to a file or by a URL of a stream. For example:
transcode.exe -i "d:\mySource.mxf" presetPath -o outputPath
If you don't need to process a file from the start to the end, you might consider setting in- and out- points for the file with the following attributes:
- -from <pos>[ms]
set start position in frames (set just integer) or in milliseconds (specify "ms") - -to <pos>[ms]
set end position in frames (set just integer) or in milliseconds (specify "ms")
For example:
transcode.exe -i "d:\mySource.mxf" -from 1000ms -to 3000ms presetPath -o outputPath
which processes 2 seconds of the mySource.mxf file: from 00:00:01:00 to 00:00:03:00.
Blackmagic DeckLink devices
SDI capture devices are processed as network streams by the MediaEngine. It means that you should use the "-i" attribute to initialize it.
The URL has a specific syntax:
sdi://{devicename}[?{attribute_name}={value}[{separator}{attribute_name}={value}]...]
Required Attributes
The {devicename} is required to initialize the device. With the actual version of MediaEngine, the original device name can only be found during detection in the log file, so it is recommended to use the generic name "DeckLinkDevice({id})" where {id} starts with 1 and sets an index of the device in the system Device Manager.
Optional Attributes
You can add additional query parameters to the URL using the valid separators ";" or "&".
Attribute | Value(s) | Default | Description |
---|---|---|---|
link | "Single", "Dual", "Quad" | <System Settings> | sets the link configuration type |
video | "SDI", "HDMI", "OpticalSDI", "Component", "Composite", "SVideo" | <System Settings> | sets video connection type |
videoFormat | "8BitYUV", "10BitYUV", "8BitARGB", "8BitBGRA", "10BitRGB" | 10BitYUV | sets the pixel layout |
mode | see "Valid Video Modes" below | Auto | sets a specific mode and turns off autodetection |
colorspace | "Auto", "Rec.601", "Rec.709", "Rec.2020", "None" | Auto | override the devices colorspace (assume logic), "None" removes colorspace info from the output |
pixelAspect | "{n}:{d}" | <not set> | override the pixel aspect with the given ratio |
audio | "Embedded", "AESEBU", "Analog", "AnalogXLR", "AnalogRCA", "Microphone", "Headphones" | <System Settings> | sets the audio connection type |
channels | "0", "2", "4", "8", "16" | 2 | sets the number of audio channels |
preroll | {ms} | 0 | starts capturing after the preroll time is passed |
timecode | HH:MM:SS | <none> | optional 24h timecode HH:MM:SS mask (use '*' as a placeholder, e.g. **:*5:**). The recording will be delayed until the (local) time is reached |
timezone | "Local", "UTC" | Local | start timecode (24h) is passed based on local time (system clock) or UTC |
Note please that not all the settings are supported for every device. Setting an invalid parameter will produce an error.
Valid Video Modes:
- "NTSC"
- "NTSC23.98"
- "PAL"
- "NTSCp"
- "PALp"
- "1080p23.98"
- "1080p24"
- "1080p25"
- "1080p29.97"
- "1080p30"
- "1080p47.95"
- "1080p48"
- "1080p50"
- "1080p59.94"
- "1080p60"
- "1080p95.90"
- "1080p96"
- "1080p100"
- "1080p119.88"
- "1080p120"
- "1080i50"
- "1080i59.94"
- "1080i60"
- "720p50"
- "720p59.94"
- "720p60"
- "2K23.98"
- "2K24"
- "2K25"
- "2KDCI23.98"
- "2KDCI24"
- "2KDCI25"
- "2KDCI29.97"
- "2KDCI30"
- "2KDCI47.95"
- "2KDCI48"
- "2KDCI50"
- "2KDCI59.94"
- "2KDCI60"
- "2KDCI95.90"
- "2KDCI96"
- "2KDCI100"
- "2KDCI119.88"
- "2KDCI120"
- "2160p23.98"
- "2160p24"
- "2160p25"
- "2160p29.97"
- "2160p30"
- "2160p47.95"
- "2160p48"
- "2160p50"
- "2160p59.94"
- "2160p60"
- "2160p95.90"
- "2160p96"
- "2160p100"
- "2160p119.88"
- "2160p120"
- "4KDCI23.98"
- "4KDCI24"
- "4KDCI25"
- "4KDCI29.97"
- "4KDCI30"
- "4KDCI47.95"
- "4KDCI48"
- "4KDCI50"
- "4KDCI59.94"
- "4KDCI60"
- "4KDCI95.90"
- "4KDCI96"
- "4KDCI100"
- "4KDCI119.88"
- "4KDCI120"
- "4320p23.98"
- "4320p24"
- "4320p25"
- "4320p29.97"
- "4320p30"
- "4320p47.95"
- "4320p48"
- "4320p50"
- "4320p59.94"
- "4320p60"
- "8KDCI23.98"
- "8KDCI25"
- "8KDCI29.97"
- "8KDCI30"
- "8KDCI47.95"
- "8KDCI48"
- "8KDCI50"
- "8KDCI59.94"
- "8KDCI60"
- "640x480p60"
- "800x600p60"
- "1440x900p50"
- "1440x900p60"
- "1440x1080p50"
- "1440x1080p60"
- "1600x1200p50"
- "1600x1200p60"
- "1920x1200p50"
- "1920x1200p60"
- "1920x1440p50"
- "1920x1440p60"
- "2560x1440p50"
- "2560x1440p60"
- "2560x1600p50"
- "2560x1600p60"
Hardware Devices
First of all, you should get a list of available devices. For this, you should use the "-print-devices" argument:
transcode.exe -print-devices
This outputs you all the available devices on your system:
The output format is the following:
ID: "DEVICE_NAME" (DirectShow path)
For setting a device you need the IDs of your video and audio sources.
To use the device for the transcoding, you should set a video and audio formats if they are available. To check this, you should add "-show-formats" to the "-print-sources" attribute:
transcode.exe -print-devices -show-formats
In this case, the output looks like this:
Again, you should get an ID of the required format for the video and the audio sources.
Once IDs of video and audio devices are obtained, and once you figured out IDs of audio- and video- formats, you can start recording the live feed:
transcode.exe presetPath -o outputPath -cap 6 -vfmt 10 -acap 1 -afmt 1
where:
- -cap - sets an ID of a video capture source
- -vfmt - sets an ID of a source video format (if available)
- -acap - sets an ID of an audio capture source
- -afmt - sets an ID of a source audio format (if available)
An alternative way to get audio and video formats only for the selected sources is to use the "import_tester.exe" utility of MediaEngine:
import_tester.exe -cap 6 -acap 1 -show-formats
The output is much shorter as it is related only to the specified sources:
NDI Signals
NDI streams are processed as a network streams (it means, you should use "-i" attribute to initialize it) with a specific URL syntax:
ndi://{machine name}/{source}[?{attribute_name}={value}[{separator}{attribute_name}={value}]...]
Required Attributes
- {machine name} - Machine name or hostname. Spaces can be replaced by '+' characters.
- {source} - Source name on the given machine. Spaces can be replaced by '+' characters.
For example:
ndi://ABLAPTOP/Test
Optional Attributes
Attribute | Value(s) | Default | Description |
---|---|---|---|
openingTimeout | {N}ms | 10000ms | sets the timeout for finding a source |
signalLossTimeout | {N}ms | 7000ms | sets the timeout for losing a signal (not used) |
searchTimeout | {N}ms | 7000ms | sets the loop timeout for when searching sources |
bandwidth | {N} | 100 | sets the NDI bandwidth 0..100 |
channels | {N} | 2 | sets the number of audio channels 0..N |
referenceLevel | {N} | 20 | sets the audio reference level in dB |
preroll | {ms} | 0 | starts capturing after the preroll time is passed |
timecode | HH:MM:SS | <none> | optional 24h timecode HH:MM:SS mask (use '*' as a placeholder, e.g. **:*5:**). The recording will be delayed until the (local) time is reached |
timezone | "Local", "UTC" | Local | start timecode (24h) is passed based on local time (system clock) or UTC |
You can add additional query parameters to the URL using the valid separators ";" or "&".
For example:
ndi://ABLAPTOP/Test?Channels=4;ReferenceLevel=0
Static Images and Image Sequences
For a static image, you can simply set a path to the image for the "-i" attribute.
transcode.exe -i myImage.png ...
But there are extra parameters available:
- duration - sets a duration of an image in frame numbers (use just N as a value, e.g. 500) or in milliseconds (add ms suffix to the value, e.g. 1000ms)
- static - sets a mode of recording: either a static image (set "1" as a value) or as an image sequence (skip the argument). For example, if you have a folder with an image sequence (the file names are like "image_001.png", "image_002.png", etc.) then for "image_001.png?static=1" you will have only this image processed, and if the "static" is skipped or is set to 0, then the whole image sequence will be processed starting with the "image_001.png".
- framerate - sets a frame rate of a source in N:D format, e.g. "30:1"
So the initialization might look like this:
myImage_1000.jpg?duration=1;static=1;framerate=30:1
Here are samples of using the static images:
-
-i "D:\Media\Image Sequences\PNG_Sequence\PNG_Sequence0000000.png"
=> this is the first image in a sequence, FFmpeg will detect all following images -
-i "D:\Media\Image Sequences\PNG_Sequence\PNG_Sequence%07d.png"
=> using a pattern with leading zeros -
-i "D:\Media\Image Sequences\PNG_Sequence\PNG_Sequence%d.png"
=> using a pattern without leading zeros -
-i "D:\Media\Image Sequences\PNG_Sequence\PNG_Sequence0001000.png"
=> start sequence a frame 1000 until the end -
-i "D:\Media\Image Sequences\PNG_Sequence\PNG_Sequence0001000.png?static=1"
=> decode only one frame (no. 1000) out of the sequence -
-i "D:\Media\Image Sequences\PNG_Sequence\PNG_Sequence0001000.png?static=1;duration=100"
=> decode only one frame (no. 1000) out of the sequence but repeat it 100 times -
-i "D:\Media\Image Sequences\PNG_Sequence\PNG_Sequence0001000.png?static=1;duration=100;framerate=30:1"
=> decode only one frame (no. 1000) out of the sequence but repeat it 100 times using 30 fps framerate