Skip to content
Luca Barbato edited this page Sep 22, 2015 · 3 revisions

This document is work in progress.

Capture

bmdcapture does capture raw video frames and audio data, normally its output is streamed over avconv for further real-time processing. The output format is suggested is NUT without syncponts since it has next to no overhead and does preserve additional side-data, such as VANC lines.

bmdcapture -C 1 -m 2 -F nut -o strict=experimental:syncpoints=none -f pipe:1 | avconv -vsync passthrough -y -i - <your options here>

Running bmdcapture -h does list the available devices (-C) and modes (-m), is possible to select a specific pixel format (-p) and the number of audio channels (-c).

Pixel formats

The pixel formats supported are either rgb or yuv, with yuv being the most common. The bmd devices usually support capture in 8bit and packed 10bit mode.

Audio channels

The bmd devices provide the audio data as a single stream of N channels. To encode in aac is possible either to split the data in multiple single stereo or mono streams:

bmdcapture ${options} -c 16 -f pipe:1 | avconv -vsync passthrough -i - -af channelsplit ${avconv options}

Ancillary data

The 10bit pixel format is required if you need to capture the ancillary information from SDI-HD, such as subtitles, in that case you need to use the matching libav branch.

Day/Week-long recording

According to some reports some setups might get some input glitches over time, adding -re seems to smooth them out. (Many thanks to Antonio from TodoStreaming for testing various options over weeks and reporting the results!)

Playback

bmdplay takes the same raw data bmdcapture and plays it back in real time. If the data provided does not match the set playback rate the system will close itself as safety measure.

bmdplay uses most of the information provided with the input stream, per bmdcapture is possible to select the card with -C and the mode with -m. -h shows the available cards and modes.

avconv -i <real time source> -c:v rawvideo -pix_fmt uyvy422 -c:a pcm_s16le -ar 48000 -f nut -f_strict experimental -syncpoints none - | ./bmdplay -f pipe:0

Audio

Depending on the amount of audio channels you use you might need to join the audio to feed it to bmdplay.

avconv -i <real time source> -af join=16:16c -c:v rawvideo -pix_fmt uyvy422 -c:a pcm_s16le -ar 48000 -f nut -f_strict experimental -syncpoints none - | ./bmdplay -f pipe:0

The above command joins 16 mono tracks.

Clone this wiki locally