summaryrefslogtreecommitdiff
path: root/libavformat/hlsenc.c
Commit message (Collapse)AuthorAge
* avformat/hlsenc: set strict_std_compliance from the parent AVFormatContextSteven Liu2019-11-26
| | | | | | | fix ticket: 8388 Reviewed-by: Jan Ekström <jeebjp@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: free the original malloc pointer to avoid error when system ↵Limin Wang2019-11-13
| | | | | | function used in the following patch Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/hlsenc: fix the av_dirname path isn't include separator in the end ↵Limin Wang2019-10-31
| | | | | | | of string Reviewed-by: Liu Steven <lq@chinaffmpeg.org> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/hlsenc: move freep segment from sls_flags_filename_process after ↵Steven Liu2019-10-28
| | | | | | caller failed Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: check av_strdup() return valueSteven Liu2019-10-19
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* lavf/hlsenc: fix memory leakJun Zhao2019-10-18
| | | | | | | fix memory leak Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avformat/hlsenc: replace with av_freep for all av_freeLimin Wang2019-10-08
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/hlsenc: replace with av_dirname to get the directoryLimin Wang2019-10-08
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/hlsenc: remove the unnecessary null pointer checkLimin Wang2019-10-08
| | | | | Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/hlsenc: add logging context to logSteven Liu2019-10-08
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: make fix code style of hls_write_trailerSteven Liu2019-09-14
| | | | change vs->avf to oc
* avformat/hlsenc: Fix memleak when using single_fileAndreas Rheinhardt2019-09-14
| | | | | | | | | | This commit fixes a memleak in the hls muxer when one uses a single file as output. It has been forgotten to free the temporary buffers used to write the packets so that the size of the leaks basically amounts to the size of the output file. This commit adds the necessary free. Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* hlsenc: flush segments to guarantuee atomic single file hlsDaniel Oberhoff2019-09-14
|
* avformat/hlsenc: fix memleak at hls_write_trailerSteven Liu2019-09-12
| | | | | Found-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: print warning at the end when upload the last segment failedSteven Liu2019-09-12
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: merge fmp4 and mpegts segment type m3u8 list AVIOConextSteven Liu2019-09-12
| | | | | | | hlsenc has been merge fmp4 and mpegts workflow before so it can merge m3u8 list AVIOContext now. Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: fix compiling error of hlsencSteven Liu2019-09-06
|
* avformat/hlsenc: fix code styleSteven Liu2019-09-06
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: move the warning message from every segment upload to init partSteven Liu2019-09-06
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: avformat/hlsenc: reopen new http session for http_persistentSteven Liu2019-09-06
| | | | | | | | fix ticket: 7975 Tested-by: Ian Klassen <ian@virtualfunc.com> Suggested-by: Ian Klassen <ian@virtualfunc.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* lavf/hlsenc: refine the get_relative_url function to avoid extra malloc for ↵Limin Wang2019-09-02
| | | | | | | relation path Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/hlsenc: remove unused valueSteven Liu2019-08-26
| | | | | CID: 1452644 Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: fix memleak of filenameSteven Liu2019-08-26
| | | | | CID: 1452445 Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: fix memleak in hls_write_trailerSteven Liu2019-08-26
| | | | | | fix CID: 1426931 Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: avformat/hlsenc: simplified codeSteven Liu2019-08-21
| | | | | | simplified code for get dirname string in hls_delete_old_segments Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: simplified code of use_localtime in hls_initSteven Liu2019-08-21
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: fix memleak in update_variant_stream_infoSteven Liu2019-08-21
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: reindent codeSteven Liu2019-08-20
| | | | and remove redundant empty line
* avformat/hlsenc: remove unuse comment of the codeSteven Liu2019-08-20
|
* lavf/hlsenc: free the old_filname to avoid memory leakJun Zhao2019-08-20
| | | | | | | | free the old_filname to avoid memory leak in error handle path. Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/hlsenc: fix one warning: unused variable 'filename' [-Wunused-variable]Limin Wang2019-08-20
| | | | | Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/hlsenc: merge mpegts and fmp4 workflow to one workflowSteven Liu2019-08-18
| | | | | | | | write mpegts or fmp4 context into buffer, and flush the buffer into output file when split fragment. merge two format split workflow into one workflow Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: Fix overflow of int for durations computeSteven Liu2019-07-29
| | | | | | | Fix ticket: 8037 Reported-by: DusanBrejka Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: use old way for fragment mp4 in HLS PUT methodSteven Liu2019-07-15
| | | | | | | fix ticket: 8015 Reported-by: Jun Zhao Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: use one handler for m3u8 and segmentsSteven Liu2019-07-11
| | | | | | | Use one handler for m3u8 and segments. Use two handler in byterange mode. Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: changing all filename length to MAX_URL_SIZEBela Bodecs2019-07-01
| | | | | | | | | Throughout hlsenc code, all filename related buffer lengths are set hardcoded as 1024. This PATCH change it to general value as MAX_URL_SIZE in internal.h Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
* avformat/hlsenc: temp_file usage for master playlist and vtt playlistBela Bodecs2019-06-28
| | | | | | | | | | | | | currently master playlist and subtitle playlist creation does not use temporary files even when temp_file flag is set. Most of the use cases it is not a problem because master playlist creation happens once on the beginning of the whole process. But if master playlist is periodically re-created because of master_pl_refresh_rate is set, non-atomic playlist creation may cause problems in case of live streaming. This patch correct this behavior by adding this functionality. Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
* hlsenc: Add option to set custom HTTP headersDerek Buitenhuis2019-06-27
| | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avformat/hlsenc: better error log message for var_stream_map contentBela Bodecs2019-06-24
| | | | | | | | | | | | When multiple variant streams are specified by var_stream_map option, %v is expected either in the filename or in the last sub-directory name, but only in one of them. When both of them contains %v string, current error message only states half of the truth. And even %v may appears several times inside the last sub-directory name or in filename pattern. This patch clarifies this in the log message and in the doc also. Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
* avformat/hlsenc: better checking var_stream_map contentBela Bodecs2019-06-22
| | | | | | | | | When multiple variant streams are specified by var_stream_map option, implementation assumes that each elementary stream is assigned only once to any variant. But this is not checked. This patch makes this checking. Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu> Reviewed-by: Steven Liu<lq@onvideo.cn>
* avformat/hlsenc: enhanced %v handling with variant namesBodecs Bela2019-06-20
| | | | | | | | | | | | | | | | When multiple variant streams are specified by var_stream_map option, %v placeholder in various names ensures that each variant has its unique names. Currently %v is substituted by its variant index value (0, 1, 2 etc.). In some use cases it would be handy to specify names for variants instead of numerical indexes. This patch makes it possible to use names instead of default indexes. In var_stream_map option each or some of the variant streams may use an optional name attributum (e.g. -var_stream_map "v:0,a:0,name:sd v:1,a:1,name:720p") If a name is specified for a variant, then this name value will be used as substitution value of %v instead of the default index value. Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu> Signed-off-by: Steven Liu <lq@onvideo.cn>
* av_format/hlsenc: fix %v handling by format_name functionBodecs Bela2019-06-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hi All, When multiple variant streams are specified by var_stream_map option, %v placeholder in various names ensures that each variant has its unique names. Most of %v handlng is done in format_name function. Currently in this function the result buffer is the same as the input pattern buffer, so you must allocate it before calling format_name function. It also means, that it is silently assumed that the result string will NOT be longer that the pattern string. It is true most of the time, because %v may appear only once in the pattern string and number of variant streams is less than 100 in practical cases. But theoretically it will fail if specified number of variant streams is greater than 100 (i.e. longer than 2 digits). This patch fixes this behaviour by altering format_name function to allocate the result buffer and return it to the caller. Please, review this patch. best, Bela >From 6377ebee8a106a9684d41b270c7d6c8e57cd3e7b Mon Sep 17 00:00:00 2001 From: Bela Bodecs <bodecsb@vivanet.hu> Date: Mon, 17 Jun 2019 14:31:36 +0200 Subject: [PATCH] av_format/hlsenc: fix %v handling by format_name function When multiple variant streams are specified by var_stream_map option, %v placeholder in various names ensures that each variant has its unique names. Most of %v handlng is done in format_name function. Currently in this function the result buffer is the same as the input pattern buffer, so you must allocate it before calling format_name function. It also means, that it is silently assumed that the result string will NOT be longer that the pattern string. It is true most of the time, because %v may appear only once in the pattern string and number of variant streams is less than 100 in practical cases. But theoretically it will fail if specified number of variant streams is greater than 100. This patch fixes this behaviour by altering format_name function to allocate the result buffer and return it to the caller. Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
* avformat/hlsenc: add EXT-X-I-FRAMES-ONLY tag supportSteven Liu2019-06-14
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* doc/muxers: fix typo of the hls var_stream_map exampleSteven Liu2019-06-02
| | | | | | | And fix typo of the 1833 of hlsenc.c Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro> Signed-off-by: Steven Liu <lq@onvideo.cn>
* avformat/hlsenc: flush packets before update split messageSteven Liu2019-04-14
| | | | | | fix ticket: 7831 Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* lavf: Constify AVOutputFormat pointer.Carl Eugen Hoyos2019-03-20
|
* avformat/hlsenc: fix fmp4_init_filename file name with %v problemSteven Liu2019-02-10
| | | | | | | | | | | when set option fmp4_init_filename to init_%v.mp4 before patch: the init file will be init_%v_0.mp4, init_%v_1.mp4 after patch: the init file will be init_0.mp4, init_1.mp4 Reported-By: Gyan Doshi <ffmpeg@gyani.pro> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: add var_stream_map LANGUAGE field string parameterSteven Liu2019-01-31
| | | | | | | | | | | | | | | | | | | | | 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: add var_stream_map DEFAULT field status parameterSteven Liu2019-01-31
| | | | | | | | | | | | | | | | | | | | | use a:0,agroup:aud_low,default:Yes a:1,agroup:aud_low, a:2,agroup:aud_high,default:Yes a:3, agroup:aud_high, 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,URI="out_0.m3u8" EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_aud_low",NAME="audio_1",DEFAULT=NO,URI="out_1.m3u8" EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_aud_high",NAME="audio_2",DEFAULT=YES,URI="out_2.m3u8" EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_aud_high",NAME="audio_3",DEFAULT=NO,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: make the EXT-X-MEDIA NAME field by stream id.Steven Liu2019-01-31
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>