summaryrefslogtreecommitdiff
path: root/libavformat/hlsenc.c
Commit message (Collapse)AuthorAge
* 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>
| * hlsenc: Use AV_TIME_BASE units for all the computationsLuca Barbato2015-08-16
| | | | | | | | | | | | | | | | Do not risk mixing different timebases. CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * hlsenc: write playlist into a temp file and replace the original atomicallyHendrik Leppkes2015-02-20
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
| * hlsenc: remove the AVIOContext for the playlist from the muxer contextHendrik Leppkes2015-02-20
| | | | | | | | | | | | Its only used in one function, having it in the context serves no purpose. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Update demuxers and protocols for protocol whitelist supportMichael Niedermayer2016-02-02
| | | | | | | | | | Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/hlsenc: replace round by lrintGanesh Ajjanagadde2015-12-19
| | | | | | | | | | | | | | Mainly cosmetic here. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | avformat/hlsenc: Check the return code of avformat_write_header()Michael Niedermayer2015-12-13
| | | | | | | | | | | | | | Fixes: segfault Fixes: Ticket5067 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat: use AV_OPT_TYPE_BOOL in a bunch of placesClément Bœsch2015-12-04
| |
* | hlsenc: Only write PAT/PMT once per segmentDerek Buitenhuis2015-11-02
| | | | | | | | | | | | | | This saves a lot of muxing overhead, especially on lower bitrate segments. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | libavformat/hlsenc: Use of uninitialized memory unlinking old filesDHE2015-10-03
| | | | | | | | | | | | | | Fixes ticket#4900 Signed-off-by: DHE <git@dehacked.net> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hlsenc: Fix the method command line parameterMichael Niedermayer2015-09-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hlsenc: Fix memleak of pathMichael Niedermayer2015-09-03
| | | | | | | | | | Fixes: CID1322343 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hlsenc: Initialize vtt_oc to help static analyzersMichael Niedermayer2015-09-03
| | | | | | | | | | | | This is also more robust in case it ever is used Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hlsenc: add a use_localtime option to expand the segment filename ↵LiuQi2015-09-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with localtime test examples: ./ffmpeg -re -i ~/Movies/objectC/facebook.mp4 -v verbose -c copy -f hls -hls_segment_filename test-%s.ts -use_localtime 1 -bsf:v h264_mp4toannexb aaa.m3u8 [StevenLiu@localhost ffmpeg]$ cat aaa.m3u8;ll test-*.ts test-1441052221.ts test-1441052231.ts test-1441052235.ts test-1441052243.ts test-1441052249.ts -rw-r--r-- 1 StevenLiu staff 1310736 9 1 04:15 test-1441052131.ts -rw-r--r-- 1 StevenLiu staff 495192 9 1 04:15 test-1441052141.ts -rw-r--r-- 1 StevenLiu staff 1310736 9 1 04:17 test-1441052212.ts -rw-r--r-- 1 StevenLiu staff 1067840 9 1 04:17 test-1441052221.ts -rw-r--r-- 1 StevenLiu staff 235564 9 1 04:17 test-1441052231.ts -rw-r--r-- 1 StevenLiu staff 1187220 9 1 04:17 test-1441052235.ts -rw-r--r-- 1 StevenLiu staff 694848 9 1 04:17 test-1441052243.ts -rw-r--r-- 1 StevenLiu staff 526588 9 1 04:17 test-1441052249.ts [StevenLiu@localhost ffmpeg]$ ./ffmpeg -re -i ~/Movies/objectC/facebook.mp4 -v verbose -c copy -f hls -hls_segment_filename test-%s.ts -use_localtime 1 -bsf:v h264_mp4toannexb aaa.m3u8 [StevenLiu@localhost ffmpeg]$ cat aaa.m3u8;ll aaa-*.ts aaa-1441052417.ts aaa-1441052427.ts aaa-1441052437.ts aaa-1441052440.ts aaa-1441052449.ts -rw-r--r-- 1 StevenLiu staff 1310736 9 1 04:19 aaa-1441052382.ts -rw-r--r-- 1 StevenLiu staff 277300 9 1 04:19 aaa-1441052392.ts -rw-r--r-- 1 StevenLiu staff 1310736 9 1 04:20 aaa-1441052417.ts -rw-r--r-- 1 StevenLiu staff 1067840 9 1 04:20 aaa-1441052427.ts -rw-r--r-- 1 StevenLiu staff 235564 9 1 04:20 aaa-1441052437.ts -rw-r--r-- 1 StevenLiu staff 1187220 9 1 04:20 aaa-1441052440.ts -rw-r--r-- 1 StevenLiu staff 338776 9 1 04:20 aaa-1441052449.ts [StevenLiu@localhost ffmpeg]$ Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hlsenc: Fix wording in commentMichael Niedermayer2015-07-26
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hlsenc: Add WebVtt support in hlsAnshul Maheshwari2015-07-26
| | | | | | | | | | Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hlsenc: removed empty/unused print_encryption_tag functionChristian Suloway2015-06-16
| | | | | | | | | | Signed-off-by: Christian Suloway <csuloway@globaleagleent.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/hlsenc: added HLS encryptionChristian Suloway2015-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added HLS encryption with -hls_key_info_file <key_info_file> option. The first line of key_info_file specifies the key URI written to the playlist. The key URL is used to access the encryption key during playback. The second line specifies the path to the key file used to obtain the key during the encryption process. The key file is read as a single packed array of 16 octets in binary format. The optional third line specifies the initialization vector (IV) as a hexadecimal string to be used instead of the segment sequence number (default) for encryption. Changes to key_info_file will result in segment encryption with the new key/IV and an entry in the playlist for the new key URI/IV. Key info file format: <key URI> <key file path> <IV> (optional) Example key URIs: http://server/file.key /path/to/file.key file.key Example key file paths: file.key /path/to/file.key Example IV: 0123456789ABCDEF0123456789ABCDEF Example: ffmpeg -f lavfi -i testsrc -c:v h264 -hls_key_info_file file.keyinfo foo.m3u8 file.keyinfo: http://server/file.key /path/to/file.key 0123456789ABCDEF0123456789ABCDEF Example shell script: BASE_URL=${1:-'.'} openssl rand 16 > file.key echo $BASE_URL/file.key > file.keyinfo echo file.key >> file.keyinfo echo $(openssl rand -hex 16) >> file.keyinfo ffmpeg -f lavfi -re -i testsrc -c:v h264 -hls_flags delete_segments \ -hls_key_info_file file.keyinfo out.m3u8 -- Signed-off-by: Christian Suloway <csuloway@globaleagleent.com> Signed-off-by: Dan Dennedy <dan@dennedy.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/hlsenc: do not append an endlist tag when the stream endsMrBoogs2015-05-17
| | | | | | | | Reviewed-by: Thomas Volkert <silvo@gmx.net>
* | avformat/hlsenc: Add hls flag for starting a playlist with a discontinuity ↵MrBoogs2015-05-17
| | | | | | | | | | | | on startup Reviewed-by: Thomas Volkert <silvo@gmx.net>
* | avformat/hlsenc: Add hls flag for rounding m3u8 durations to whole numbers, ↵MrBoogs2015-05-17
| | | | | | | | | | | | problems with floats on some devices Reviewed-by: Thomas Volkert <silvo@gmx.net>
* | avformat/hlsenc: Warn if a non file protocol is usedMichael Niedermayer2015-02-23
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/hlsenc: Use ff_rename() only for local filesMichael Niedermayer2015-02-21
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | hlsenc: write playlist into a temp file and replace the original atomicallyHendrik Leppkes2015-02-21
| | | | | | | | | | Reviewed-by: Lukasz Marek <lukasz.m.luki2@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | hlsenc: remove the AVIOContext for the playlist from the muxer contextHendrik Leppkes2015-02-20
| | | | | | | | | | | | Its only used in one function, having it in the context serves no purpose. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/hlsenc: more robust error testsMichael Niedermayer2015-01-11
| | | | | | | | | | | | errors are negative throughout ffmpeg Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/hlsenc: Use avio_closep() to avoid leaving stale pointers in memoryMichael Niedermayer2015-01-08
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/hlsenc: Use av_freep() to avoid leaving stale pointers in memoryMichael Niedermayer2014-12-16
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/hlsenc: fix hls_write_trailer() on hls_start() failureChristian Suloway2014-12-16
| | | | | | | | | | | | | | | | Close segment I/O context and append segment in hls_write_trailer() only when segment I/O context is allocated. Signed-off-by: Christian Suloway <csuloway@globaleagleent.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/hlsenc: added segment file deletionChristian Suloway2014-12-10
| | | | | | | | | | | | | | | | | | This option flag deletes segment files removed from the playlist after a period of time equal to the duration of the segment plus the duration of the playlist. Signed-off-by: Christian Suloway <csuloway@globaleagleent.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/hlsenc: added segment filename optionChristian Suloway2014-12-06
| | | | | | | | | | | | | | | | | | | | | | | | | | This option allows segment filenames to be specified. Unless -hls_flags single_file is set the filename is used as a string format with the segment number. Example: ffmpeg -f lavfi -i testsrc -c:v h264 -map 0 -hls_segment_filename bar%03d.ts foo.m3u8 Signed-off-by: Christian Suloway <csuloway@globaleagleent.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/hlsenc: Free context after hls_append_segmentMichael Niedermayer2014-11-16
| | | | | | | | | | | | Fixes reading uninitialized memory Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | hlsenc.c, segment.c: propagate defaults to mpegtsMika Raento2014-10-17
| | | | | | | | | | | | | | | | | | This fixes the abnormally high ts overhead in the files produced by the HLS and segments muxers. See https://trac.ffmpeg.org/ticket/2857 . For example makes it much more likely that it can produces streams that fit under the 64kb App store limit. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '28816050e47b6dba430a52e429d21a864cffda8e'Michael Niedermayer2014-10-07
|\| | | | | | | | | | | | | | | | | | | * commit '28816050e47b6dba430a52e429d21a864cffda8e': lavf: Set the stream time base hint properly for chained muxers Conflicts: libavformat/segment.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: Set the stream time base hint properly for chained muxersMartin Storsjö2014-10-06
| | | | | | | | | | | | | | This avoids warnings about using the codec time base as time base hint. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '55f03d872640175a00bfa262da4652b7312b905f'Michael Niedermayer2014-10-03
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit '55f03d872640175a00bfa262da4652b7312b905f': hlsenc: Add parameter -hls_allow_cache Conflicts: doc/muxers.texi libavformat/hlsenc.c libavformat/version.h See: 3edb9aaea6aaa6b93d708693cfa6454c17e03732 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * hlsenc: Add parameter -hls_allow_cacheJoakim Roubert2014-10-03
| | | | | | | | | | | | | | | | | | | | | | | | | | The -hls_allow_cache parameter enables explicitly setting the EXT-X-ALLOW-CACHE tag in the manifest file. That tag indicates whether the client MAY or MUST NOT cache downloaded media segments for later replay. Valid values are 1 (=YES) or 0 (=NO) and the EXT-X-ALLOW-CACHE will not show in the manifest for other values (or if -hls_allow_cache is not used. Signed-off-by: Martin Storsjö <martin@martin.st>