[FFmpeg-devel] [PATCH] write AC-3 metadata

Anssi Hannula anssi.hannula
Sat Jan 1 03:54:40 CET 2011

On 31.12.2010 18:53, Justin Ruggles wrote:
> On 12/31/2010 10:08 AM, Anssi Hannula wrote:
>> On 31.12.2010 15:31, Kieran Kunhya wrote:
>>>> clean effects ? This field indicates that the referenced
>>>> program element has no language.
>>>> hearing impaired ? This field indicates that the
>>>> referenced program element is prepared for the hearing
>>>> impaired.
>>>> visual_impaired_commentary ? This field indicates that the
>>>> referenced program element is prepared for the visually
>>>> impaired viewer.
>>>> [...]
>>> For what it's worth, I've never seen anyone use anything other
>>> than "undefined" for that field in MPEG-2 systems. Visual Impaired
>>> commentary uses the country code "NAR" over here in the UK.
>> Here in Finland visual impaired commentary is marked correctly using
>> that field (additionally it has the country code "hun").
> Well, since this is both codec-level and container-level information,
> there are limited options to support it.
> 1) a new field in AVCodecContext called audio_service_type
>     - set the values in demuxers/decoders/muxers/encoders
>     - I don't know if this would copy over when transcoding though
> 2) Move the metadata API to libavcodec and use key "audio_service_type"
>     - define generic values so that they are compatible across
> formats/codecs
>     - convert names to codes and vice-versa
>     - Downside: mixing of metadata and AVOption APIs to set codec
> bitstream parameters
>> Also, somewhat relatedly, some channels (eurosport mainly, at least when
>> I last checked) are broadcast with mono audio encoded as 2 channels of a
>> single stream and therefore there are multiple language tags present per
>> stream.
> I am curious to know if those streams contain AC-3 in dual-mono or if it
> is actually indicated as stereo in the AC-3 stream itself.  Do you
> happen to have a sample?  We don't support dual mono channel layout
> currently, but we could possibly add AV_CH_DUALMONO1, AV_CH_DUALMONO2,
> and AV_CH_LAYOUT_DUALMONO.  And in that case, some of the AC-3 metadata
> is specified per-channel as well.

Sorry about being unclear. Both the use of visual impaired commentary
value and the dual language audio streams were in MPEG-2 TS container,
with Layer II codec, not AC-3.

In case you want to see a sample anyway, one is here:

Anssi Hannula

More information about the ffmpeg-devel mailing list