summaryrefslogtreecommitdiff
path: root/libavformat/hlsenc.c
Commit message (Collapse)AuthorAge
* avformat/hlsenc: improve to write m3u8 head blockSteven Liu2017-01-24
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: refine the code readable for time unitSteven Liu2017-01-24
| | | | | | Reviewed-by: Bodecs Bela <bodecsb@vivanet.hu> Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: fix too many open files bugSteven Liu2017-01-20
| | | | | | | | When use http method to delete the old segments, there is only io_open, hove not io_close yet, this patch is used to fix it Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: fix bug of hlsenc http delete old segmentsSteven Liu2017-01-19
| | | | | | | | when push hls to http server, the old segemnts can not delete by hls formats. so add the http option into hls_delete_old_segments Reported-by: Yin Jiaoyuan <yinjiaoyuan@163.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: remove debug message used error level logSteven Liu2017-01-18
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: refine the hlsenc codeSteven Liu2017-01-13
| | | | | | | because the oc have been potint to hls->avf or hls->vtt_avf here is not needed point once again Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: fix hlsenc bug at windows systemSteven Liu2017-01-13
| | | | | | | | | | | | when hlsenc use flag second_level_segment_index, second_level_segment_size and second_level_segment_duration, the rename is ok but the output filename always use the old filename so move the rename operation after the close the ts file and before open new segment Reported-by: Christian Johannesen <chrisjohannesen@gmail.com> Reviewed-by: Bodecs Bela <bodecsb@vivanet.hu> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* lavf/hlsenc: fix typo in last commit.Nicolas George2017-01-12
|
* avformat/hlsenc: hls_start_number_source and start_numberBodecs Bela2017-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | start_number option starts the playlist sequence number (#EXT-X-MEDIA-SEQUENCE) from the specified number. Unless hls_flags single_file is set, it also specifies starting sequence numbers of segment and subtitle filenames. Sometimes it is usefull to have unique starting numbers at each run, but currently it is only achiveable by setting this parameter manually. This patch enables to specify start_number source parameter by introducing hls_start_number_source with 3 possible values: generic/epoch/datetime. This ensures to set start sequence number automatically for practically unique numbers. Generic option is the default and this is the curent behaviour: start_number option value specifies the start sequence number. (start_number default value is 0) If hls_start_number_source is set to epoch, then the start number will be the seconds since epoch (1970-01-01 00:00:00). If set to datetime, then the start sequence number will be based on the current date/time value as YYYYmmddHHMMSS. e.g. 20161231235659. Hls speficication allows 64 bit integers as sequence numbers. This patch also changes some code where only 32 bit integer values were handled correctly. Reviewed-by: Moritz Barsnick <barsnick@gmx.net> Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: fix the bug when the largest segment duration pointer right ↵Steven Liu2017-01-11
| | | | | | | | | | value is 0 when the segments largest duration value is look like 4.000000, the EXT-X-TARGETDURATION value should equ 4. it's wrong when hlsenc use ceil, so fix it. Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: fix hls start and tail segment durationSteven Liu2017-01-11
| | | | | | | | | problem fix ticket: #6067 Tested-by: Pero Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: fix Explicit null dereferenced in hlsencSteven Liu2017-01-06
| | | | | | | | CID: 1398228 Passing null pointer dirname to strlen, which dereferences it. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* vformat/hlsenc: typo in default localtime patternBela Bodecs2017-01-05
| | | | | | | | in get_default_pattern_localtime_fmt the default pattern contains %Y%m%d%H%I%S but the original intention was %Y%m%d%H%M%S Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: fix memleak in hlsencSteven Liu2017-01-05
| | | | | | | | fix CID: 1398364 Resource leak refine the code of the new options Reviewed-by: Bodecs Bela <bodecsb@vivanet.hu> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: bugfix in duplicate filename detectionBela Bodecs2017-01-05
| | | | | | | | A wrong, unitialized variable is used for testing. This patch fixes this typo. Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: size and duration in segment filenamesBela Bodecs2017-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1st: This patch makes it possible to put actual segment file size (measured in bytes) and/or duration (calculated in microseconds) into segment filenames. This feature is useful when post-processing live streaming access log files. New behaviour works only when -use_localtime option is set and second_level_segment_size or/and second_level_segment_duration new hls_flags are specified. %%s is the placeholder for size and %%t for duration in hls_segment_filename option. Fix sized trailing zeropadding also works eg. %%09s or %%023t. A command to test new features: ./ffmpeg -loglevel info -y -f lavfi -i color=c=red:size=640x480:r=25 -f lavfi -i sine=f=440:b=4:r=44100 -c:v mpeg2video -g 25 -acodec aac -cutoff 20000 -ac 2 -ar 44100 -ab 192k -f hls -hls_time 3 -hls_list_size 5 -hls_flags second_level_segment_index+second_level_segment_size+second_level_segment_duration -use_localtime 1 -use_localtime_mkdir 1 -hls_segment_filename "segment_%Y%m%d%H%M%S_%%04d_%%08s_%%013t.ts" stream.m3u8 2nd: doc/muxers: beside second_level_segment_duration and second_level_segment_size, added some more details and example to hls_segment_filename, use_localtime, use_localtime_mkdir, hls_flags. hls_flags option list reformatted to table Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: Duplicated segment filenames and use_localtime_mkdirBela Bodecs2017-01-01
| | | | | | | | | | Current implementation of finding duplicate segment filenames may fail if use_localtime_mkdir and use_localtime are in effect and segment_filename option expression contains subdirectories with date/time specifiers. This patch fixes this false behaviour. Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* libavformat/hlsenc: default segment name and use_localtimeBela Bodecs2017-01-01
| | | | | | | | | | | in hlcenc.c, in the hls_write_header() function the default format string for strftime() function contains %s specifier when use_localtime is true. This %s specifier will insert the seconds since EPOCH. But %s is not available on all system/environment. This patch check %s availabilty at runtine and alter the default format string if necessary. Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* libavformat/hlsenc: fix delete_segments when use_localtime_mkdirBela Bodecs2016-12-29
| | | | | | | | | | When delete_segments hls_flag is specified, deleting old segments may fail in certain cases when use_localtime_mkdir is in effect and hls_segment_filename expression contains subdirs. This patch fixes this behaviour. Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: strftime identifiers and segment indexBodecs Bela2016-12-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in filenames Putting date/time values into segment filenames is very usefull. But to produce non-conflicting segment filenames with -use_localtime option with date/time values in hls_segment_filename option, sometimes is not enough. Like in cases when multiple segments produced in the same second. But hlsenc currently does not make possible to use segment index (%d) at the same time whe use_localtime is in effect, due to identifier conflict. This patch makes possible to use strftime identifiers and still put segment index (%d) at same time in segment filenames by introducing second_level_segment_index flag. When -use_localtime is active, identifier %d is for month day index, so %%d is the segment index placeholder. This enhanced behaviour only exists when new second_level_segment_index flag is specified. For instance putting 'segment_%Y%m%d%H%M%S_%%05d.ts' value into -hls_segment_filename option and specifing -hls_flags second_level_segment_index and -use_localtime 1, may produce segment filename as 'segment_20161230235758_00002.ts' An example: ffmpeg -loglevel info -y -f lavfi -i color=c=red:size=640x480:r=25 -f lavfi -i anullsrc=r=44100:cl=stereo -c:v mpeg2video -g 25 -acodec aac -cutoff 20000 -ac 2 -ar 44100 -ab 192k -f hls -hls_time 3 -hls_list_size 5 -hls_flags delete_segments+second_level_segment_index -use_localtime 1 -hls_segment_filename "segment_%Y%m%d%H%M%S_%%05d.ts" stream.m3u8 will produce segments filenames: .... segment_20161227005902_00013.ts segment_20161227005902_00014.ts segment_20161227005902_00015.ts segment_20161227005903_00016.ts segment_20161227005903_00017.ts segment_20161227005903_00018.ts segment_20161227005903_00019.ts segment_20161227005903_00020.ts .... Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
* Fix bug when incrementing initial_prog_date_time when removing segmentsJesper Ek2016-12-27
| | | | | | | | initial_prog_date_time shouldn't be adjusted when deleting segments from disk, but rather when segments are removed from the playlist. Signed-off-by: Jesper Ek <deadbeef84@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: detecting duplicated segment filenamesBela Bodecs2016-12-26
| | | | | | | | | | | | | | | | | ffmpeg-devel with use_localtime parameter hlsenc may produce identical filenames for different but still existing segments. It happens when hls_segment_filename contains syntacticaly correct but inadequate format parameters. Currently there is no any log message when such a situaton occurs but these cases should be avoided in most times. This patch generate warning log messages in these cases. ticketID: #6043 Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu> Signed-off-by: Steven Liu <lingjiujianke@gmail.com>
* avformat/hlsenc: save the EXT-X-DISCONTINUITY from old listSteven Liu2016-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when use fix ticket 2nd problem. command line test step: rm -rf output*;./ffmpeg -i ~/Movies/objectC/facebook.mp4 -an -c:v copy -f hls -hls_time 4 -hls_list_size 5 -hls_flags +delete_segments -hls_flags +append_list -hls_flags +omit_endlist -hls_flags +discont_start -t 50 output.m3u8 ./ffmpeg -i ~/Movies/objectC/facebook.mp4 -an -c:v libx264 -g 4 -f hls -hls_time 4 -hls_list_size 5 -hls_flags +delete_segments -hls_flags +append_list -hls_flags +omit_endlist -hls_flags +discont_start -t 5 output.m3u8 ./ffmpeg -i ~/Movies/objectC/facebook.mp4 -an -c:v libx264 -g 4 -f hls -hls_time 4 -hls_list_size 5 -hls_flags +delete_segments -hls_flags +append_list -hls_flags +omit_endlist -hls_flags +discont_start -t 5 output.m3u8 result: #EXTM3U #EXT-X-VERSION:3 #EXT-X-TARGETDURATION:5 #EXT-X-MEDIA-SEQUENCE:6 #EXTINF:4.120000, output6.ts #EXT-X-DISCONTINUITY #EXTINF:4.000000, output7.ts #EXTINF:0.960000, output8.ts #EXT-X-DISCONTINUITY #EXTINF:4.000000, output9.ts #EXTINF:0.960000, output10.ts Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: fix ticket id 5988 for DISCONTINUITYSteven Liu2016-12-05
| | | | | | add EXT-X-DISCONTINUITY tag at the position of the append point. Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* increment initial_prog_date_time when removing old segmentsRobert Nagy2016-11-12
| | | | | | | | Fixes https://trac.ffmpeg.org/ticket/5940#ticket Reviewed-by: Michael Niedermayer <<michael@niedermayer.cc>> Signed-off-by: Robert Nagy <ronag89@gmail.com> Signed-off-by: Steven Liu <lingjiujianke@gmail.com>
* Revert "img2 encoder: allow %t in filename, based on patch from Yuval Adam"Michael Niedermayer2016-11-01
| | | | | | | breaks API Found-by: jamrial This reverts commit 1a956c64c8eff5edecb004fc7aafd21207e6485c.
* img2 encoder: allow %t in filename, based on patch from Yuval Adamrogerdpack2016-11-01
| | | | | Signed-off-by: rogerdpack <rogerpack2005@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf: fix typosMoritz Barsnick2016-10-09
| | | | | Signed-off-by: Moritz Barsnick <barsnick@gmx.net> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/hlsenc: support multi level path in m3u8 with filenameSteven Liu2016-10-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | before patch: localhost:osx liuqi$ tree 20160926/ 20160926/ └── file-20160909 └── 26 └── 16 └── 15 ├── 46 │   ├── 13.ts │   ├── 25.ts │   ├── 36.ts │   ├── 45.ts │   └── 54.ts └── 47 ├── 04.ts ├── 14.ts ├── 24.ts └── 35.ts 6 directories, 9 files localhost:osx liuqi$ cat out.m3u8 #EXTM3U #EXT-X-VERSION:3 #EXT-X-TARGETDURATION:12 #EXT-X-MEDIA-SEQUENCE:0 #EXTINF:11.360000, 13.ts #EXTINF:10.800000, 25.ts #EXTINF:9.120000, 36.ts #EXTINF:8.760000, 45.ts #EXTINF:10.200000, 54.ts #EXTINF:10.720000, 04.ts #EXTINF:9.600000, 14.ts #EXTINF:10.600000, 24.ts #EXTINF:8.760000, 35.ts #EXT-X-ENDLIST after patch: localhost:osx liuqi$ tree 20160926/ 20160926/ └── file-20160909 └── 26 └── 16 └── 15 ├── 46 │   ├── 13.ts │   ├── 25.ts │   ├── 36.ts │   ├── 45.ts │   └── 54.ts └── 47 ├── 04.ts ├── 14.ts ├── 24.ts └── 35.ts 6 directories, 9 files localhost:osx liuqi$ cat out.m3u8 #EXTM3U #EXT-X-VERSION:3 #EXT-X-TARGETDURATION:12 #EXT-X-MEDIA-SEQUENCE:0 #EXTINF:11.360000, 20160926/file-20160909/26/16/15/46/13.ts #EXTINF:10.800000, 20160926/file-20160909/26/16/15/46/25.ts #EXTINF:9.120000, 20160926/file-20160909/26/16/15/46/36.ts #EXTINF:8.760000, 20160926/file-20160909/26/16/15/46/45.ts #EXTINF:10.200000, 20160926/file-20160909/26/16/15/46/54.ts #EXTINF:10.720000, 20160926/file-20160909/26/16/15/47/04.ts #EXTINF:9.600000, 20160926/file-20160909/26/16/15/47/14.ts #EXTINF:10.600000, 20160926/file-20160909/26/16/15/47/24.ts #EXTINF:8.760000, 20160926/file-20160909/26/16/15/47/35.ts #EXT-X-ENDLIST Signed-off-by: Steven Liu <lingjiujianke@gmail.com>
* avformat/hlsenc: support mkdir_p for use_localtime_mkdirSteven Liu2016-10-01
| | | | | | | | | | | | | | | when use use_localtime_mkdir to create multi level dir, ffmpeg give error message: ffmpeg -re -i ~/Movies/objectC/facebook.mp4 -c copy -use_localtime 1 -use_localtime_mkdir 1 -hls_segment_filename '%Y%m%d/file-%Y%m%d/%s.ts' out.m3u8 error message: Could not create directory 20160926/file-20160926 with use_localtime_mkdir add mkdir_p for support the multi level dir Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Tested-by: Zuo Genyu <1515161258@qq.com> (Windows) Signed-off-by: Steven Liu <lingjiujianke@gmail.com>
* avformat/hlsenc: refine EXT-X-BYTERANGE support for segmentsSteven Liu2016-09-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | refine EXT-X-BYTERANGE tag, the spec link: https://tools.ietf.org/html/draft-pantos-http-live-streaming-19#section-4.3.2.2 the apple doc: https://developer.apple.com/library/ios/technotes/tn2288/_index.html# //apple_ref/doc/uid/DTS40012238-CH1-BYTE_RANGE_SUPPORT_FOR_SEGMENTS command line: ./ffmpeg -i ~/Movies/objectC/a.mp4 -c copy -f hls -hls_time 7 -hls_list_size 0 -hls_segment_size 2500000 -t 40 output-test.m3u8 output: localhost:ffmpeg liuqi$ ll *.ts ;cat output-test.m3u8 -rw-r--r-- 1 liuqi staff 2792176 9 12 14:44 output-test0.ts -rw-r--r-- 1 liuqi staff 3112528 9 12 14:44 output-test3.ts -rw-r--r-- 1 liuqi staff 3377420 9 12 14:44 output-test6.ts -rw-r--r-- 1 liuqi staff 1228016 9 12 14:44 output-test7.ts #EXTM3U #EXT-X-VERSION:4 #EXT-X-TARGETDURATION:10 #EXT-X-MEDIA-SEQUENCE:0 #EXTINF:9.021000, #EXT-X-BYTERANGE:1334988@0 output-test0.ts #EXTINF:3.000000, #EXT-X-BYTERANGE:721356@1334988 output-test0.ts #EXTINF:3.000000, #EXT-X-BYTERANGE:735832@2056344 output-test0.ts #EXTINF:6.000000, #EXT-X-BYTERANGE:1645940@0 output-test3.ts #EXTINF:3.000000, #EXT-X-BYTERANGE:715152@1645940 output-test3.ts #EXTINF:3.000000, #EXT-X-BYTERANGE:751436@2361092 output-test3.ts #EXTINF:9.000000, #EXT-X-BYTERANGE:3377420@0 output-test6.ts #EXTINF:3.960000, #EXT-X-BYTERANGE:1228016@0 output-test7.ts #EXT-X-ENDLIST localhost:ffmpeg liuqi$ ticket-id: #5839 Signed-off-by: Steven Liu <lingjiujianke@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/hlsenc: Emulate strftime("%z") using other functions if it does not ↵Michael Niedermayer2016-09-15
| | | | | | | | work This should fix the code on windows Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/hlsenc: Assume UTC if "%z" is unsupported in strftime()Michael Niedermayer2016-09-13
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/hlsenc: Avoid "%T" "%F" in strftime() to improve compatibilityMichael Niedermayer2016-09-13
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/hlsenc: implement program_date_timeMichael Niedermayer2016-09-08
| | | | | Reviewed-by: Steven Liu <lingjiujianke@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/hlsenc: fix incomplete write of subtitle HLS playlistFranklin Phillips2016-09-05
| | | | | | | | | | | | | | | This patch is a fix for the bug with ticket number 5812 (https://trac.ffmpeg.org/ticket/5812). Basically, the bug is that the last segment and the "#EXT-X-ENDLIST" tag are not being written to the subtitle playlist file when converting a file with subtitles to the HLS format. The reason for this seem to be that the filename for the subtitle file is being freed too early. This solution is simply to free that memory after it's last use in the "hls_window" function. Signed-off-by: Franklin Phillips <franklinphillips9p8@inbox.lv> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/hlsenc: add warning for append_list and hls_init_time optionSteven Liu2016-08-31
| | | | | | | | | When use append_list mode, the hls_init_time set nouse, Because the append_list only support append at the old m3u8 end cannot set init segments durations at the middle of the list. That's invalid. and show a warning message for user. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/hlsenc: add option hls_init_time to set init hls window segment ↵Steven Liu2016-08-29
| | | | | | | | | | duration recover segments duration time by hls_time after init hls window. This is reuqested by Ibrahim Tachijian Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/hlsenc: add append_list flag into hlsencSteven Liu2016-08-21
| | | | | | | | | When ffmpeg exit by exception, start a new ffmpeg will cover the old segment list, add this flag can continue append the new segments into old hls segment list Signed-off-by: LiuQi <liuqi@gosun.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/hlsenc: Use AV_FRAME_FILENAME_FLAGS_MULTIPLE, support tee:Michael Niedermayer2016-08-04
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* add split_by_time flag for support splite mpegts segment at non-keyframeSteven Liu2016-07-11
| | | | | | | support split hls segment at duration set by hls_time Signed-off-by: LiuQi <liuqi@gosun.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '9200514ad8717c63f82101dc394f4378854325bf': lavf: replace AVStream.codec with AVStream.codecpar This has been a HUGE effort from: - Derek Buitenhuis <derek.buitenhuis@gmail.com> - Hendrik Leppkes <h.leppkes@gmail.com> - wm4 <nfxjfg@googlemail.com> - Clément Bœsch <clement@stupeflix.com> - James Almer <jamrial@gmail.com> - Michael Niedermayer <michael@niedermayer.cc> - Rostislav Pehlivanov <atomnuker@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavf: replace AVStream.codec with AVStream.codecparAnton Khirnov2016-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, AVStream contains an embedded AVCodecContext instance, which is used by demuxers to export stream parameters to the caller and by muxers to receive stream parameters from the caller. It is also used internally as the codec context that is passed to parsers. In addition, it is also widely used by the callers as the decoding (when demuxer) or encoding (when muxing) context, though this has been officially discouraged since Libav 11. There are multiple important problems with this approach: - the fields in AVCodecContext are in general one of * stream parameters * codec options * codec state However, it's not clear which ones are which. It is consequently unclear which fields are a demuxer allowed to set or a muxer allowed to read. This leads to erratic behaviour depending on whether decoding or encoding is being performed or not (and whether it uses the AVStream embedded codec context). - various synchronization issues arising from the fact that the same context is used by several different APIs (muxers/demuxers, parsers, bitstream filters and encoders/decoders) simultaneously, with there being no clear rules for who can modify what and the different processes being typically delayed with respect to each other. - avformat_find_stream_info() making it necessary to support opening and closing a single codec context multiple times, thus complicating the semantics of freeing various allocated objects in the codec context. Those problems are resolved by replacing the AVStream embedded codec context with a newly added AVCodecParameters instance, which stores only the stream parameters exported by the demuxers or read by the muxers.
* | avformat/hlsenc: Add support for HLS PLAYLIST types EVENT and VODAdam Kent2016-03-12
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hlsenc: Fix passing options, regression since ↵Michael Niedermayer2016-03-11
| | | | | | | | | | | | bc9a5965c815cf7fd998d8ce14a18b8e861dd9ce Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | hlsenc: add use_localtime_mkdir option to automatically create time-based ↵Johan Ström2016-02-17
| | | | | | | | | | | | | | | | | | | | | | | | | | directory Use with -use_localtime, and set -hls_segment_filename to a path which contains a subdirectory i.e. /some/path/%Y%m%d/%Y%m%dT%H%M%S-%s.ts This will mkdir the %Y%m%d-part of the path if it does not already exist. In addition, each filename in the playlist output will be prefixed with this subdirectory (if playlist and segment shares the same base path). Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hlsenc: Fix filename and optionsMichael Niedermayer2016-02-10
| | | | | | | | | | | | Regression since bc9a5965c815cf7fd998d8ce14a18b8e861dd9ce Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '9f61abc8111c7c43f49ca012e957a108b9cc7610'Derek Buitenhuis2016-02-10
|\| | | | | | | | | | | | | | | | | This also deprecates our old duplicated callbacks. * commit '9f61abc8111c7c43f49ca012e957a108b9cc7610': lavf: allow custom IO for all files Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavf: allow custom IO for all filesAnton Khirnov2016-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some (de)muxers open additional files beyond the main IO context. Currently, they call avio_open() directly, which prevents the caller from using custom IO for such streams. This commit adds callbacks to AVFormatContext that default to avio_open2()/avio_close(), but can be overridden by the caller. All muxers and demuxers using AVIO are switched to using those callbacks instead of calling avio_open()/avio_close() directly. (de)muxers that use the URLProtocol layer directly instead of AVIO remain unconverted for now. This should be fixed in later commits.
| * hlsenc: Support outputting specific versionsLuca Barbato2015-08-25
| | | | | | | | | | | | Right now only version 2 and version 3 are supported. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>