[FFmpeg-devel] [PATCH] decklink: support all valid numbers of audio channels

Dave Rice dave at dericed.com
Wed Dec 23 00:20:41 CET 2015


> On Dec 20, 2015, at 9:28 AM, Matthias Hunstock <atze at fem.tu-ilmenau.de> wrote:
> 
> Am 20.12.2015 um 15:11 schrieb Nicolas George:
>> Le decadi 30 frimaire, an CCXXIV, Matthias Hunstock a écrit :
>>> Decklink cards actually do just some bitbanging: take digital input in
>>> "raw" format (AFAIK UYVY422 10 bit, PCM 16bit) and copy that into your RAM.
>> 
>> Take digital input... from where?
> 
> Ok, the bigger picture:
> 
> The BlackMagic DeckLink series are capture (and sometimes playout)
> cards, mostly having SDI in-/outputs, sometimes also HDMI; some older
> models have analog inputs (RGB component, YUV component and so on) and
> do ADC themselves.
> 
> So the digital input is in most cases (HD-)SDI or HDMI, which also
> includes audio. Since there are well-known "pix_fmts" on the wire, there
> is only little conversion available in the cards. AFAIK only 10bit/8bit
> conversion on the video data.
> 
> So using these cards means you get blasted with raw UYVY422 data and
> either 2, 8 or 16 PCM 16bit audio channels. Reverse logic applies for
> playout.
> 
> 
>>> Another possibility is to demux each channel as a mono track. Would this
>>> make more sense?
>> 
>> It depends on the use case, and therefore on where the channels come from.
> 
> Yes. IMHO a channel mapping is needed in 95% of the use cases, so if it
> is valid to have an unspecified channel layout than it should be used.

I consider the unspecified arrangement of the 8 and 16 channels to be consistent in most cases with the source material being recorded by Decklink. For videotapes there is no metadata to say which channel is for what. There’s some tradition to say that the first channel is left and second channel is right, but there is no machine-readible clarity about the application of this in video tapes. Ideally the user would interpret the unspecified source material and arrange the audio into the proper channels and tracks. Without the user clarifying the arrangement I think an unspecified arrangement should be used.

In using bmdcapture piping 8 channels to ffmpeg, I’ve used this logic to handle channel arrangement based on a user selection: https://github.com/amiaopensource/vrecord/blob/f5b9f2147763adffd58dc53421bc221419f2bdd1/vrecord#L275-L303. However in Media Express (the free utility that comes with Decklink products) it only places all channels in a single track with unspecified arrangement. I think mimicking Media Express is appropriate and avoid presuming too much about the audio. If needed the user could further arrange that audio for clarity, if the input channel option is added, I could add documentation examples on how to arrange it.

Dave Rice


More information about the ffmpeg-devel mailing list