[FFmpeg-devel] [PATCH] [HLS] Add LANGUAGE attribute to #EXT-X-MEDIA tag for audio-only variant streams.

Philippe Symons philippe.symons at gmail.com
Tue Nov 13 00:36:34 EET 2018

Hello everyone,

This is my first patch to FFMpeg or any open-source project for that
matter. In this patch, I've added the LANGUAGE attribute to the
#EXT-X-MEDIA tag for for audio only variant streams for HLS streams.

This attribute will be added to the output in
avformats' ff_hls_write_audio_rendition() function, if the language code
can be found in the metadata of the variant stream.

The reason why I implemented this, was because I was working with a player
which needs this attribute to determine the language of the audio stream.
After asking the question on StackOverflow (
I noticed that it wasn't implemented.

I've tested these changes with the following command:

ffmpeg -re -i /home/philippe/Videos/example.ts -map 0:v -c:v copy -map 0:a
-c:a copy -f hls -hls_time 6 -hls_list_size 10 -hls_flags
delete_segments+program_date_time -hls_segment_filename
"/var/www/html/live/stream_%v_%d.ts" -var_stream_map "v:0,agroup:lang
a:0,agroup:lang a:1,agroup:lang a:2,agroup:lang a:
3,agroup:lang" -master_pl_name master.m3u8 /var/www/html/live/stream-%v.m3u8

Looking forward to your feedback. I hope it's okay.

Best regards,

Philippe Symons
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-HLS-Add-LANGUAGE-attribute-to-EXT-X-MEDIA-tag-for-au.patch
Type: text/x-patch
Size: 4797 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20181112/a3a017d7/attachment.bin>

More information about the ffmpeg-devel mailing list