aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/hlsplaylist.h
Commit message (Collapse)AuthorAgeFilesLines
* libavformat/hlsplaylist: add subtitle_varname for naming subtitle streamsJonathan Baecker2024-10-131-1/+1
| | | | | | | | | If 'sname:*' is set in the var_stream_map variable, use it as the NAME attribute for subtitles. This improves the naming of subtitle streams in HTML players, providing clearer and more descriptive labels for users. Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
* hlsenc: Calculate the average and actual maximum bitrate of segmentsMartin Storsjö2024-07-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the bitrate advertised in the master playlist would only be based on the nominal values in either AVCodecParameters bit_rate, or via AVCPBProperties max_bitrate. On top of this, a fudge factor of 10% is added, to account for container overhead. Neither of these bitrates may be known, and if the encoder is running in VBR mode, there is no such value to be known. And the container overhead may be more or less than the given constant factor of 10%. Instead, calculate the maximum bitrate per segment based on what actually gets output from the muxer, and average bitrate across all segments. When muxing of the file finishes, update the master playlist with these values, exposing both the maximum (which previously was a guesstimate based on the nominal values) via EXT-X-STREAM-INF BANDWIDTH, and the average via EXT-X-STREAM-INF AVERAGE-BANDWIDTH. This makes it possible to use the hlsenc muxer with VBR encodes, for VOD style muxing. Signed-off-by: Martin Storsjö <martin@martin.st>
* avformat/hlsenc: Add CHANNELS to EXT-X-MEDIA for AudioDave Johansen2023-11-121-1/+1
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* Remove unnecessary libavutil/(avutil|common|internal).h inclusionsAndreas Rheinhardt2022-02-241-1/+0
| | | | | | | | | | Some of these were made possible by moving several common macros to libavutil/macros.h. While just at it, also improve the other headers a bit. Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/hlsenc, hlsplaylist: CosmeticsAndreas Rheinhardt2020-05-281-4/+5
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/hlsplaylist: Add const where appropriateAndreas Rheinhardt2020-05-281-10/+13
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat: add subtitle support in master playlist m3u8Limin Wang2020-04-081-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Test with the following command for the webvtt subtitle: $ ./ffmpeg -y -i input_with_subtitle.mkv \ -b:v:0 5250k -c:v h264 -pix_fmt yuv420p -profile:v main -level 4.1 \ -b:a:0 256k \ -c:s webvtt -c:a mp2 -ar 48000 -ac 2 -map 0:v -map 0:a:0 -map 0:s:0 \ -f hls -var_stream_map "v:0,a:0,s:0,sgroup:subtitle" \ -master_pl_name master.m3u8 -t 300 -hls_time 10 -hls_init_time 4 -hls_list_size \ 10 -master_pl_publish_rate 10 -hls_flags \ delete_segments+discont_start+split_by_time ./tmp/video.m3u8 Check the master m3u8: $ cat tmp/master.m3u8 #EXTM3U #EXT-X-VERSION:3 #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitle",NAME="subtitle_0",DEFAULT=YES,URI="video_vtt.m3u8" #EXT-X-STREAM-INF:BANDWIDTH=6056600,RESOLUTION=1280x720,CODECS="avc1.4d4829,mp4a.40.33",SUBTITLES="subtitle" video.m3u8 Check the result by convert to mkv: $ ./ffmpeg -strict experimental -i ./tmp/master.m3u8 -c:v copy -c:a mp2 -c:s srt ./test.mkv Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* lavf/hlsenc: refine the get_relative_url function to avoid extra malloc for ↵Limin Wang2019-09-021-2/+2
| | | | | | | relation path Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/hlsenc: add EXT-X-I-FRAMES-ONLY tag supportSteven Liu2019-06-141-2/+3
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: add var_stream_map LANGUAGE field string parameterSteven Liu2019-01-311-1/+1
| | | | | | | | | | | | | | | | | | | | | use a:0,agroup:aud_low,default:Yes,language:CHN a:1,agroup:aud_low,language:ENG a:2,agroup:aud_high,default:YesYes,language:CHN a:3,agroup:aud_high,language:ENG v:0,agroup:aud_low v:1,agroup:aud_high create master m3u8 list. result: EXTM3U EXT-X-VERSION:3 EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_aud_low",NAME="audio_0",DEFAULT=YES,LANGUAGE="CHN",URI="out_0.m3u8" EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_aud_low",NAME="audio_1",DEFAULT=NO,LANGUAGE="ENG",URI="out_1.m3u8" EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_aud_high",NAME="audio_2",DEFAULT=YES,LANGUAGE="CHN",URI="out_2.m3u8" EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_aud_high",NAME="audio_3",DEFAULT=NO,LANGUAGE="ENG",URI="out_3.m3u8" EXT-X-STREAM-INF:BANDWIDTH=1170400,RESOLUTION=640x480,CODECS="avc1.64001e,mp4a.40.2",AUDIO="group_aud_low" out_4.m3u8 EXT-X-STREAM-INF:BANDWIDTH=3440800,RESOLUTION=640x480,CODECS="avc1.64001e,mp4a.40.2",AUDIO="group_aud_high" out_5.m3u8 Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: closed caption tags in the master playlistVishwanath Dixit2018-01-241-1/+1
|
* avformat/hlsenc: Add CODECS attribute to master playlistKarthick Jeyapal2018-01-191-1/+2
|
* avformat/hlsplaylist: Audio rendition's name and defaultness made configurableKarthick Jeyapal2017-12-291-1/+2
| | | | Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: Modularized audio rendition playlist write to allow reuseKarthick Jeyapal2017-12-291-0/+1
| | | | Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc:addition of #EXT-X-MEDIA tag and AUDIO attributeVishwanath Dixit2017-12-231-1/+1
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: set EXT-X-TARGETDURATION use lrint(EXTINF)Karthick J2017-12-221-5/+0
|
* avformat/hlsplaylist: add int type of API ff_hls_write_file_entrySteven Liu2017-12-041-1/+1
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: Refactored 'get_int_from_double' function to allow reuseKarthick J2017-11-301-0/+5
|
* avformat/hlsplaylist: add missing header includesJames Almer2017-11-291-0/+4
| | | | | | Fixes checkheaders. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/hlsplaylist: fix header include guardJames Almer2017-11-291-2/+2
| | | | | | Fixes fate-source Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/hlsenc: Modularized playlist creation to allow reuseKarthick J2017-11-291-0/+51