Hi Carl,

> On Dec 29, 2017, at 3:55 PM, Carl Eugen Hoyos <ceffm...@gmail.com> wrote:
> 
> 2017-12-29 19:12 GMT+01:00 Devin Heitmueller <dheitmuel...@ltnglobal.com>:
> 
>> +        for (int i = 0; i < ctx->max_audio_channels / 2; i++) {
>> +            st = avformat_new_stream(avctx, NULL);
>> +            if (!st) {
>> +                av_log(avctx, AV_LOG_ERROR, "Cannot add stream %d\n", i);
>> +                ret = AVERROR(ENOMEM);
>> +                goto error;
>> +            }
>> +            st->codecpar->codec_type  = AVMEDIA_TYPE_AUDIO;
>> +            st->codecpar->codec_id    = ctx->audio_depth == 32 ?
>> AV_CODEC_ID_PCM_S32LE : AV_CODEC_ID_PCM_S16LE;
>> +            st->codecpar->sample_rate = bmdAudioSampleRate48kHz;
>> +            st->codecpar->channels    = 2;
>> +            avpriv_set_pts_info(st, 64, 1, 1000000);  /* 64 bits pts in us 
>> */
>> +            ctx->audio_st[i] = st;
>> +            ctx->num_audio_streams++;
>> +        }
> 
> I would have expected that the channel_layout is set to STEREO in
> this case, is that not always true?

I’m not sure I understand your comment.  Is there some channel layout property 
of the codec parameters I should be setting?

For the moment, it’s true that we’re only supporting capturing stereo pairs.  
But coming down the pipe is support for compressed audio over SDI pairs, as 
well as more complex layouts which involve discrete 5.1 or 7.1 channels.  This 
patch is a stepping stone to that (I’ve designed it with those use cases in 
mind, even though I haven’t implemented them yet).

For example, it’s not uncommon to have a series of SDI pairs such as the 
following:

SDI channels 1-6 contain discrete 5.1 audio as PCM
SDI channels 7-8 contain a stereo PCM pair with a second language
SDI channels 9-10 contain a compressed 5.1 AC-3 stream.

This patch doesn’t let you do the above, but it’s working in that direction.

Devin
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to