Commit Graph

274 Commits

Author SHA1 Message Date
Werner Robitza ad5ca1fb72 doc/hls: fix grammar for HLS options
This fixes the grammar of two HLS option descriptions and makes them less
ambiguous.

Signed-off-by: Werner Robitza <werner.robitza@gmail.com>
Signed-off-by: Lou Logan <lou@lrcd.com>
2018-10-30 14:08:19 -08:00
Steven Liu fbd8746efa avformat/hlsenc: rename option from use_localtime to strftime
fix ticket: 7393
indent option name to segment

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2018-09-05 14:08:18 +08:00
Jan Ekström 1931761f18 avformat/movenc: implicitly enable negative CTS offsets for ismv
ISMV lacks any sort of edit list support, as well as tfxd is
effectively the PTS of the fragment for most intents and purposes.

Thus, if b-frames are requested without negative CTS offsets you
end up with N frames' worth of delay (tfxd PTS plus the CTS offset
of the first sample). Negative CTS offsets enable the first sample
to have CTS=DTS, and thus a/v desync due to b-frame reorder delay
is avoided.
2018-08-24 21:00:05 +03:00
Vishwanath Dixit 5717cd80dc avformat/movenc: creating producer reference time (PRFT) box
The producer reference time box supplies relative wall-clock times
at which movie fragments, or files containing movie fragments
(such as segments) were produced.
The box is mainly useful in live streaming use cases. A media player
can parse the box and utilize the time fields to measure and improve
the latency during real time playout.
2018-05-29 09:32:11 +05:30
Karthick Jeyapal 2efdbf7367 avformat/dashenc: Added option for Segment file format
Right now segment file format is chosen to be either mp4 or webm based on the codec format.
This patch makes that choice configurable by the user, instead of being decided by the muxer.

Also with this change per-stream choice segment file format(based on codec type) is not possible.
All the output audio and video streams should be in the same file format.
2018-05-28 10:52:01 +05:30
Vishwanath Dixit e3518821c9 avformat/dashenc: configuring container format options 2018-05-15 11:13:36 +05:30
Karthick Jeyapal c76a6c93bf avformat/dashenc: Add documentation for http method option 2018-05-14 10:20:54 +05:30
Gyan Doshi 424836505f doc/muxers: tee muxer - rearrange, add notes and general tidy-up 2018-04-19 17:43:42 +05:30
Vishwanath Dixit d10cefbfe5 avformat/dashenc: addition of segment index correction logic
The logic is applicable only when use_template is enabled and use_timeline
is disabled. The logic monitors the flow of segment indexes. If a streams's
segment index value is not at the expected real time position, then
the logic corrects that index value.

Typically this logic is needed in live streaming use cases. The network
bandwidth fluctuations are common during long run streaming. Each
fluctuation can cause the segment indexes fall behind the expected real
time position. Without this logic, players will not be able to consume
the content, even after encoder's network condition comes back to
normal state.
2018-04-17 14:35:40 +05:30
Vishwanath Dixit ab789e184c avformat/dashenc: segmentation at the configured segment duration rate
When use_template is enabled and use_timeline is disabled, typically
it is required to generate the segments at the configured segment duration
rate on an average. This commit is particularly needed to handle the
segmentation when video frame rates are fractional like 29.97 or 59.94 fps.
2018-04-17 14:31:22 +05:30
Vishwanath Dixit 01ba52852d avformat/dashenc: replacing 'min_seg_duration' with 'seg_duration'
There are use cases where average segment duration needs to be configured
and muxer is expected to maintain the average segment duration. So, using
the name 'min_seg_duration' will be misleading. So, changing the parameter
name to 'seg_duration', where it can be minimum segment duration or average
segment duration based on the use-case. The additional updates needed for
this functinality are made the sub-sequent patches of this patch series.
2018-04-17 14:30:47 +05:30
Steven Liu 987026adda avformat/hlsenc: add option hls_delete_threshold
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>
2018-04-13 15:39:49 +08:00
Ravindra 99230b7ef8 libavformat/dashenc: Option to set timeout for socket I/O operation 2018-03-18 12:36:28 +05:30
Ravindra 6010537956 avformat/hlsenc: Option to set timeout for socket I/O operation
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
2018-03-14 19:59:34 +08:00
Vishwanath Dixit 28924f4b48 avformat/dashenc: chunk streaming support for low latency use cases 2018-02-24 10:55:28 +05:30
Vishwanath Dixit 1948b76a1b avformat/hlsenc: closed caption tags in the master playlist 2018-01-24 11:42:57 +08:00
Vishwanath Dixit 41e51fbcd9 avformat/hlsenc: creation of variant streams in subdirectories
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
2018-01-02 10:46:48 +08:00
Vishwanath Dixit e872befdb5 avformat/hlsenc: configurable variant stream index position in filenames 2018-01-02 10:46:17 +08:00
Karthick Jeyapal 0c78b6a416 avformat/dashenc: Persistent HTTP connections supported as an option
Reviewed-by: Aman Gupta <aman@tmm1.net>
Reviewed-by: Steven Liu <lq@onvideo.cn>
2017-12-29 18:12:32 +08:00
Vishwanath Dixit d02289c386 avformat/hlsenc:addition of #EXT-X-MEDIA tag and AUDIO attribute
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-12-23 13:42:00 +08:00
Karthick J 8c2b37e678 avformat/dashenc: Option to generate hls playlist as well
This is to take full advantage of Common Media Application Format(CMAF).
Now server can generate one content and serve both HLS and DASH players.

Reviewed-by: Steven Liu <lq@onvideo.cn>
2017-11-30 10:55:51 +08:00
Jeyapal, Karthick 815e34b5b4 libavformat/hlsenc: Persistent HTTP connections supported as an option 2017-11-29 14:33:07 +08:00
Karthick J efb51c8ebb avformat/hlsenc: Added option to add EXT-X-INDEPENDENT-SEGMENTS tag 2017-11-24 06:57:36 +08:00
Karthick J d24e08e978 avformat/dashenc: Added configuration to override HTTP User-Agent
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-11-21 03:13:03 +01:00
Vishwanath Dixit 77ab1d7bae avformat/hlsenc: creation of hls master playlist file
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
2017-11-20 10:04:34 +08:00
Vishwanath Dixit 92a32d0747 avformat/hlsenc: creation of hls variant streams in a single hlsenc instance
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
2017-11-20 10:02:11 +08:00
Steven Liu f3e34072aa avformat/img2enc: add frame_pts option for make output filename
fix ticket id: #1452
when use frame_pts option, the output image name can be set with PTS
of current frame.

Signed-off-by: Steven Liu <lq@onvideo.cn>
2017-11-13 10:52:01 +08:00
James Almer 27aa69896b Merge commit '0e702124ee149593168cbbb7b30376249a64ae66'
* commit '0e702124ee149593168cbbb7b30376249a64ae66':
  doc: Provide better examples for hls and segment muxing

Merged-by: James Almer <jamrial@gmail.com>
2017-11-11 23:47:50 -03:00
Luca Barbato 0e702124ee doc: Provide better examples for hls and segment muxing
Some encoders do not output further IDRs if not requested to.
2017-10-27 19:52:48 +02:00
Martin Storsjö 07e4be7ec9 movenc: Add an option for enabling negative CTS offsets
This reduces the need for an edit list; streams that start with
e.g. dts=-1, pts=0 can be encoded as dts=0, pts=0 (which is valid
in mov/mp4) by shifting the dts values of all packets forward.
This avoids the need for edit lists for such streams (while they
still are needed for audio streams with encoder delay).

This eases conformance with the DASH-IF interoperability guidelines.

Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-28 18:15:45 +02:00
Rodger Combs 3eb1d05ef7 Merge commit 'c5c663541739cb813a2a5668ee8339b535b35d7d'
* commit 'c5c663541739cb813a2a5668ee8339b535b35d7d':
  doc: add dash muxer

Merged-by: Rodger Combs <rodger.combs@gmail.com>
2017-09-26 14:13:54 -03:00
Lou Logan 183fd30e0f Fix several typos
"apix_fmts" found by Marc Péchaud.
"speedloss" found by Mikhail V.

Signed-off-by: Lou Logan <lou@lrcd.com>
2017-09-21 16:17:02 -08:00
Karthick J 837c55e072 avformat/hlsenc: Added configuration to override HTTP User-Agent
Signed-off-by: Karthick J <kjeyapal@akamai.com>
Signed-off-by: Steven Liu <lq@onvideo.cn>
2017-09-05 23:30:52 +08:00
DeHackEd eabeb9093a avformat/hlsenc: allow dynamic encryption key rotation
Makes behaviour of 805ce25b1d optional, re-enables
HLS key rotation feature

Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: DHE <git@dehacked.net>
2017-08-06 15:10:35 +08:00
Steven Liu 274bd1670b avfomat/hlsenc: support fmp4 format in hls
add the fmp4 format into hlsenc
because the fmp4 format add into hls from version 7.
the spec link is:
https://tools.ietf.org/html/draft-pantos-http-live-streaming-20
and the describe on WWDC
https://developer.apple.com/videos/play/wwdc2017/515/

Signed-off-by: Steven Liu <lq@onvideo.cn>
2017-07-03 20:20:44 +08:00
Steven Liu 5caaa3a49e avformat/hlsenc: add hls encrypt options
refer to:
https://git.libav.org/?p=libav.git;a=commitdiff;h=0a4b9d0ccd10b3c39105f99bd320f696f69a75a2
add hls encrypt options looks like libav's libavformat/hlsenc.c

Reviewed-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-04-14 23:30:29 +08:00
Nicolas George 0c20f9fcab doc/muxers: fix default value for image2 option start_number. 2017-04-04 09:15:01 +02:00
Lou Logan 396be0da59 doc/muxers: cleanup mpegts section
Add missing options.
List correct variable types.
Re-order options and markup flag options properly.
Add more texinfo markup.

Signed-off-by: Lou Logan <lou@lrcd.com>
2017-03-16 12:01:15 -08:00
Steven Liu 70a9407b50 doc/muxers: move hls_flags temp_file to after SECOND LEVEL hls example
the temp_file hls_flags describe text offset is wrong, now move it after example

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-03-11 21:11:38 +08:00
Michael Niedermayer 68b8be0811 doc/muxers: Fix typo, causing warnings during build
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-12 20:40:47 +01:00
Steven Liu d96ebc5ef8 avformat/hlsenc: deprecate hls_wrap option
When user use the hls_wrap, there have many problem:
1. some platform refersh the old but usefull segment
2. CDN(Content Delivery Network) Deliver HLS not friendly

The hls_wrap is used to wrap segments for use little space,
now user can use hls_list_size and hls_flags delete_segments
instead it.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-02-11 12:32:31 +08:00
Mulvya 40b6e28778 doc: Add muxers/demuxers list option
Signed-off-by: Mulvya <mulvya@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-11 02:59:32 +01:00
Aman Gupta 606eac7b07 avformat/hlsenc: add hls_flag option to write segments to temporary file until complete
Adds a `-hls_flags +temp_file` which will write segment data to
filename.tmp, and then rename to filename when the segment is complete.

This patch is similar in spirit to one used in Plex's ffmpeg fork, and
allows a transcoding webserver to ensure incomplete segment files are
never served up accidentally.

Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Reviewed-by: Bodecs Bela <bodecsb@vivanet.hu>
Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-02-07 11:58:43 +08:00
Marton Balint 1687fa2131 doc/muxers: remove confusing example for segment muxer option clocktime_wrap_duration
Detecting a leap second depends on a lot of things, segment time, segment
offset, system leap second implementation, the removed part is a huge
simplification which can be misleading, so it is best to remove it.

Signed-off-by: Marton Balint <cus@passwd.hu>
2017-02-04 23:36:46 +01:00
Tobias Rapp c778a9657d doc/muxers: add AVI muxer documentation
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2017-01-31 15:08:37 +01:00
Peter Große c5c6635417 doc: add dash muxer
Signed-off-by: Peter Große <pegro@friiks.de>
Signed-off-by: Martin Storsjö <martin@martin.st>
2017-01-31 00:45:30 +02:00
Bodecs Bela 8811d6d9a0 avformat/hlsenc: hls_start_number_source and start_number
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>
2017-01-12 20:43:10 +08:00
Bela Bodecs 4068f5fac7 doc/muxers/hlsenc: typo hls_flag: discont_starts => discont_start
Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-01-05 23:18:36 +01:00
Bela Bodecs 557c0df9a8 avformat/hlsenc: size and duration in segment filenames
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>
2017-01-03 22:57:51 +08:00
Jan Sebechlebsky 7c91ee01cc libavformat/tee: Add fifo support for tee
Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
2016-12-28 16:18:15 +01:00