summaryrefslogtreecommitdiffstats
path: root/libavformat/hlsenc.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix usage of temp_file flag in hls_flags option.Adrian Guzowski2018-12-261-27/+33
| | | | | | | | | | | This is a regression introduced by 223d2bde22ce33dcbcb6f17f234b609cb98f1fb6. It appears that regression was introduced in 4.1, 4.0.x does not share this behaviour. Temp files were not created for MPEG-TS segments options - HLS_TEMP_FILE flag was never set on AVFormatContext, it is however set on HLSContext object. In order to fix this issue, proper flags field must be checked. In addition, renaming code was messed up and apparently was working only for MP4 files.
* avformat/hlsenc: remove duplicate operation at hls_write_headerSteven Liu2018-12-241-10/+4
| | | | | | the options have set when avformat_init_output at hls_mux_init Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc : Added an option to ignore IO errorsKarthick J2018-12-101-10/+31
| | | | | | Useful for long duration runs with network output Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: Handled error from ff_http_do_new_request() functionKarthick J2018-12-101-1/+7
| | | | | | | This patch fixes the segmentation fault issues due to unhandled errors from ff_http_do_new_request function. Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: remove the cannot reach resultSteven Liu2018-11-251-1/+1
| | | | | | | fix CID: 1441166 because the logic have checked the vtt_dirname before Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* lavf/hlsenc: Do not mix declarations and code.Carl Eugen Hoyos2018-11-161-5/+5
| | | | | | | | | | | | | | Fixes the following warnings: libavformat/hlsenc.c: In function 'hls_write_trailer': libavformat/hlsenc.c:2364:17: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] uint8_t *buffer = NULL; ^~~~~~~ libavformat/hlsenc.c:2372:17: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] int byterange_mode = (hls->flags & HLS_SINGLE_FILE) || (hls->max_seg_size > 0); ^~~ libavformat/hlsenc.c:2379:13: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] int range_length = 0; ^~~
* avformat/hlsenc: check dirname and fix vtt problemSteven Liu2018-11-121-5/+14
| | | | | | | | | fix ticket: 7527 check dirname before use it refine webvtt code in the hls_delete_old_segments Reported-by: caspy Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc.c: fix the output's duration smaller than input's in ↵Charles Liu2018-10-301-2/+1
| | | | | | | | | | sub-range mode. In fmp4 & sub-range mode, the output's duration always smaller than expected, because the size of the last #EXT-X-BYTERANGE is too small. Signed-off-by: Charles Liu <liuchh83@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc.c: the size of init.mp4 is zero.Charles Liu2018-10-301-0/+19
| | | | | | | | | | The size of init.mp4 is zero in fmp4 mode, when the input duraton smaller than the expected segment time. fix ticket: 7166 Signed-off-by: Charles Liu <liuchh83@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc.c: remove the useless variable fmp4_init_mode.Charles Liu2018-10-301-4/+0
| | | | | Signed-off-by: Charles Liu <liuchh83@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc.c: fix memory leak in fmp4 mode.Charles Liu2018-10-301-0/+1
| | | | | Signed-off-by: Charles Liu <liuchh83@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: fix the duration of m4s segment is unusually smaller than ↵Charles Liu2018-10-301-4/+0
| | | | | | | | | | expected. In fmp4 mode, the duration of the second m4s segment is unusually smaller than the expected segment time. Signed-off-by: Charles Liu <liuchh83@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/utils: move mkdir_p to utilsSteven Liu2018-09-251-35/+2
| | | | | | | Because it will be used by avformat/segment.c or other module which need to automatically create sub-directories operation. Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: rename option from use_localtime to strftimeSteven Liu2018-09-051-8/+14
| | | | | | | fix ticket: 7393 indent option name to segment Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* lavf/hlsenc: fix mixed declarations and code warning.Jun Zhao2018-08-221-1/+1
| | | | | | | fix the build warning for "ISO C90 forbids mixed declarations and code" Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Jun Zhao <mypopydev@gmail.com>
* Improve hls VOD mode hls performance problem.Ronak Patel2018-08-191-11/+33
| | | | | | | | | | | | This fixes the creation of the hls manifest in hlsenc.c by writing the entire manifest at the end for VOD playlists. Live & Event Playlists are unaffected. This also fixes the behavior with HLS_TEMP_FILE to work correctly when -hlsflags temp_file is specified, instead of always relying on use_rename, which caused these problems. Files that would previously take over a week to fragment now take 1 minute on the same hardware. This was a 153 hour audio file (2.2GB of audio). Signed-off-by: Ronak Patel <ronak2121@yahoo.com>
* avformat/hlsenc: improve compute after_init_list_durSteven Liu2018-07-111-1/+1
| | | | | | | | | fix ticket: 7305 vs->sequence - hls->start_sequence - vs->nb_entries is the after_init_list_dur fragment numbers fix the wrong compute way vs->sequence - vs->nb_entries Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: support http method for hls fmp4Steven Liu2018-05-241-1/+3
| | | | | | fix ticket: 7160 Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: set AVFMT_NODIMENSIONSAman Gupta2018-05-121-1/+1
| | | | | | Same as previous commit but for mpegts inside HLS. Signed-off-by: Aman Gupta <aman@tmm1.net>
* avformat/hlsenc: avformat/hlsenc: add error message for encrypt fmp4 modeSteven Liu2018-04-161-1/+6
| | | | | | | and refine the warning message when use both hls_key_info_file and hls_enc Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: add option hls_delete_thresholdSteven Liu2018-04-131-0/+9
| | | | | | | | | | | When using hls_list_size with hls_flags delete_segments, currently hls_list_size * 2 +- segments remain on disk. With this new option, the amount of disk space used can be controlled by the user. fix ticket: #7131 Signed-off-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Aman Gupta <aman@tmm1.net>
* lavf/hlsenc: use ff_get_chomp_lineJun Zhao2018-04-121-10/+2
| | | | Signed-off-by: Jun Zhao <mypopydev@gmail.com>
* avformat/hlsenc: fix handling of delete_segments when %v is presentBela Bodecs2018-04-111-3/+23
| | | | | | | | | | | | | | | | | | | | When var_stream_map option is used, %v must appear either in segment name template or in the directory path. This latter case currently is not handled and delete_segments flag of hls_flags is broken now. This patch fix this. The root cause of the bug was that HLSSegment struct only stores the final filename part, but not the final directory path. Most of the cases, final path info is unneded, It only necessary when you want to delete old segments (e.g in case of live streaming). Without variant streams it was unnecessary to store the final directory path, because all segment were stored into the same directory. But introducing %v in directory names either require to store the final directory path into HLSSegment or associate segments with their variant streams to be able deleting them later. I have choosen the second solution and introduced a variant index data member into the segment struct. Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu> Signed-off-by: Steven Liu <lq@onvideo.cn>
* avformat/hlsenc: initialize saveptrsTimo Rothenpieler2018-03-271-1/+2
| | | | | | | | | | av_strtok calls strspn on a non-NULL *saveptr, so not NULL initializing it is an issue. Fixes CID #1428568 Reviewed-by: Karthick Jeyapal <kjeyapal@akamai.com> Signed-off-by: Steven Liu <lq@onvideo.cn> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: use stream's maximum bit rate as fall-back advertised rateJan Ekström2018-03-251-2/+17
| | | | | | | | | | Enables having proper bit rate values being written into the master playlist in case of hard-constrained VBR where the maximum bit rate utilized is known before hand. Does the same thing as movenc.c, for example. Signed-off-by: Jan Ekström <jan.ekstrom@aminocom.com>
* avformat/hlsenc: reindent after previous commitsSteven Liu2018-03-181-125/+125
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: fix fmp4 single init file problemSteven Liu2018-03-181-16/+50
| | | | | | fix ticket: #7021 Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: fix memleak problem about fmp4_init_filenameSteven Liu2018-03-181-7/+8
| | | | | | | move fmp4_init_filename init in if else for first fmp4_init_filename set value operation. Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: reindent after previous commitsSteven Liu2018-03-181-22/+22
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: fix write wrong init file URI string problemSteven Liu2018-03-181-16/+0
| | | | | | fmp4_init_filename should append after base_output_dirname Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: Option to set timeout for socket I/O operationRavindra2018-03-141-1/+4
| | | | Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: fix for zero EXTINF tag durationVishwanath Dixit2018-03-121-1/+1
| | | | | | | This is the fix for bug https://trac.ffmpeg.org/ticket/7073 Tested-by: Brainiarc7 Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: add reference stream index for split segmentSteven Liu2018-03-021-1/+7
| | | | | | | | | fix ticket: #7044 Get the first video stream to reference for split segment when there have more than one video stream Signed-off-by: Steven Liu <lq@chinaffmpeg.org> Reviewed-by: Karthick Jeyapal <kjeyapal@akamai.com>
* hlsenc: Fixing HLS_TEMP_FILE usage with HLS_SECOND_LEVEL_SEGMENT_...Bela Bodecs2018-02-231-7/+13
| | | | | | | | | | | Currently using HLS_TEMP together with HLS_SECOND_LEVEL_SEGMENT_DURATION or HLS_SECOND_LEVEL_SEGMENT_SIZE gives error at end of each segment writing and the final segment file names do not contain the desired data. This patch fixes this bug by delaying the initilization of original segment filename after actual temp file renaming will skip the interfering. Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
* avformat/hls: migrate to AVFormatContext->urlMarton Balint2018-01-281-72/+94
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/hlsenc: use av_bprintf without buffer limit in ↵Marton Balint2018-01-281-55/+58
| | | | | | | | replace_int_data_in_filename In preparation for the deprecation of AVFormatContext->filename. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/hlsenc: closed caption tags in the master playlistVishwanath Dixit2018-01-241-2/+153
|
* avformat/hlsenc: Check that data is setBrendan McGrath2018-01-211-1/+1
| | | | | | | | | | | | | | | If codecpar->extradata is not set (for example, when the stream goes through the 'tee' muxer), then a segfault occurs. This patch ensures the data variable is not null before attempting to access it Before the var_stream_map option was available - I was using the tee muxer to create each resolution as an individual stream. When running this configuration after the most recent hlsenc change I hit a segfault The most simple command which recreates the segfault is: ffmpeg -i in.ts -map 0:a -map 0:v -c:a aac -c:v h264 -f tee [select=\'a,v\':f=hls]tv_hls_hd.m3u8 Signed-off-by: Brendan McGrath <redmcg@redmandi.dyndns.org>
* avformat/hlsenc: Add CODECS attribute to master playlistKarthick Jeyapal2018-01-191-1/+66
|
* avformat/hlsenc: creation of variant streams in subdirectoriesVishwanath Dixit2018-01-021-8/+60
| | | | Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: configurable variant stream index position in filenamesVishwanath Dixit2018-01-021-52/+101
|
* avformat/hlsenc: revamped master playlist url creation logicVishwanath Dixit2018-01-021-16/+18
|
* avformat/hlsenc, utils: Moved is_http_proto from hlsenc to utils for re-useKarthick Jeyapal2017-12-291-9/+3
| | | | | Reviewed-by: Aman Gupta <aman@tmm1.net> Reviewed-by: Steven Liu <lq@onvideo.cn>
* avformat/hlsplaylist: Audio rendition's name and defaultness made configurableKarthick Jeyapal2017-12-291-1/+1
| | | | Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: Modularized audio rendition playlist write to allow reuseKarthick Jeyapal2017-12-291-4/+2
| | | | Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: fix resource leakSteven Liu2017-12-251-2/+5
| | | | fix CID: 1426931 1426929
* avformat/hlsenc: Signal http end of chunk(http_shutdown) during ↵Karthick Jeyapal2017-12-251-0/+5
| | | | | | | | hlsenc_io_close() Currently http end of chunk is signalled implicitly in hlsenc_io_open(). This mean playlists http writes would have to wait upto a segment duration to signal end of chunk causing delays. This patch will fix that problem and improve performance.
* avformat/hlsenc:addition of #EXT-X-MEDIA tag and AUDIO attributeVishwanath Dixit2017-12-231-3/+61
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: set EXT-X-TARGETDURATION use lrint(EXTINF)Karthick J2017-12-221-1/+1
|
* avformat/hlsenc: Fix a memory leak when http_persistent is 1Karthick J2017-12-211-0/+2
| | | | Reviewed-by: Steven Liu <lq@onvideo.cn>
OpenPOWER on IntegriCloud