[FFmpeg-user] Retain audio track titles that are displayed in VLC

Moritz Barsnick barsnick at gmx.net
Fri Jul 26 00:58:37 EEST 2019

On Thu, Jul 25, 2019 at 21:06:03 +0200, Janis Hamme wrote:
> VLC seems to read some other flags from the TS container and maps these
> to a track description:
> https://github.com/videolan/vlc/search?q=impaired&unscoped_q=impaired

Ah, okay! I didn't realize they would do it differently.

VLC appears to use the supplementary_audio_descriptor, where the
editorial_classification determines the description you see in VLC.

In ffmpeg's libavformat/mpegts.c (demuxer), both the ISO 639 language
descriptor and the supplementary audio descriptor are evaluated to
obtain the disposition information. In the ffmpeg muxer, only the ISO
639 language descriptor is written though. VLC on the other hand only
checks the supplementary audio descriptor. Nice mismatch. ;-) That's
where you observe your loss of information.

ffmpeg's TS muxer is known to have quite a lot of limitations, but this
one clashes with VLC.

My guess is that mpegtsenc.c's mpegts_write_pmt() needs to gain a
section for writing the supplementary audio descriptor (0x06) with some
payload like this:

            *q = (st->disposition & AV_DISPOSITION_DEPENDENT) ? 0 : 0x80; /* mix type */
            if (st->disposition & AV_DISPOSITION_HEARING_IMPAIRED)
                *q |= 0x2 << 2;
            else if (st->disposition & AV_DISPOSITION_VISUAL_IMPAIRED)
                if (st->disposition & AV_DISPOSITION_DESCRIPTIONS)
                    *q |= 0x1 << 2;
                    *q |= 0x3 << 2;

I don't have enough insight yet to complete this code though. :P

> Probably ffmpeg uses another format for the disposition that VLC does
> not understand.
> > Have you tried a more recent ffmpeg (not that I expect it to
> > have relevant changes in this matter)?
> It's only behind by a minor version (4.1.3 vs 4.1.4). Debian Buster is
> still fresh ;-)

No, I actually mean ffmpeg's development on the master branch. That's
where feature enhancements happen (and they are not backported to the
previous release series):



More information about the ffmpeg-user mailing list