1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-02 03:06:28 +02:00
Commit Graph

188 Commits

Author SHA1 Message Date
Karthick J
2e67f751b5 avformat/dashenc: Added comments
Added comments regarding usage of certain movflags in streaming mode.
2019-02-25 11:40:54 +05:30
Karthick J
ca5ec4cbbc avformat/dashenc: Added option to repeatedly publish master playlist
The master playlist can be published at a specified interval with this option
2019-02-25 11:40:47 +05:30
Steven Liu
1e03d60054 avformat/hlsenc: add var_stream_map LANGUAGE field string parameter
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>
2019-01-31 16:17:11 +08:00
Karthick J
1db30d6cec avformat/dashenc: Skip writing trailer for MP4 output when in streaming mode
In streaming mode mp4 trailer is not required for playout.
2019-01-28 11:07:10 +05:30
Karthick J
b6d96a6bcc avformat/dashenc: Format xs:datetime in millisecond precision
For low latency streaming even milliseconds matter!
2019-01-21 14:50:23 +05:30
kjeyapal@akamai.com
f22fcd4483 avformat/dashenc: Added support for Low-latency HLS(Experimental)
Apple doesn't have an official spec for LHLS. Meanwhile hls.js player folks are
trying to standardize a open LHLS spec. The draft spec is available in https://github.com/video-dev/hlsjs-rfcs/blob/lhls-spec/proposals/0001-lhls.md
This option will also try to comply with the above open spec, till Apple's spec officially supports it.
Applicable only when @var{streaming} and @var{hls_playlist} options are enabled.
2018-12-17 12:11:55 +05:30
kjeyapal@akamai.com
d209a3d50f avformat/dashenc : Refactored HLS media playlist related code
Made it as a separate function, so that it could be reused (in future)
2018-12-17 12:11:18 +05:30
kjeyapal@akamai.com
876ed08b0d avformat/dashenc: Used the movenc option skip_sidx instead of global_sidx
Anyways the intended behaviour was to disable SIDX atom.
2018-12-11 10:53:18 +05:30
Andrey Semashev
f176d6587b lavf/dashenc: Write media trailers when DASH trailer is written.
This commit ensures that all (potentially, long) filesystem activity is
performed when the user calls av_write_trailer on the DASH libavformat
context, not when freeing the context. Also, this defers media segment
deletion until after the media trailers are written.
2018-12-04 10:34:29 +05:30
Karthick J
4bbb6d1ae9 Revert "lavf/dashenc: Write media trailers when DASH trailer is written."
This reverts commit e444b3b184.
Causing build error due to rebasing. Sorry for about it.
2018-12-03 11:28:18 +05:30
Andrey Semashev
a68a975584 lavf/dashenc: Use avpriv_io_delete to delete files.
This fixes incorrect handling of file pseudo-URIs (i.e. when the filename
starts with "file:").
2018-12-03 10:54:47 +05:30
Andrey Semashev
e444b3b184 lavf/dashenc: Write media trailers when DASH trailer is written.
This commit ensures that all (potentially, long) filesystem activity is
performed when the user calls av_write_trailer on the DASH libavformat
context, not when freeing the context. Also, this defers media segment
deletion until after the media trailers are written.
2018-12-03 10:54:47 +05:30
Karthick J
0a80b39780 avformat/dashenc: Added proper logging when io_open fails for write 2018-12-03 10:54:47 +05:30
kjeyapal@akamai.com
c32aad1961 avformat/dashenc: Added an option to ignore io errors
When dashenc has to run for long duration(say 24x7 live stream), one can enable this option to ignore the io failure of few segment's upload due to an intermittent network issues.
When the network connection recovers dashenc will continue with the upload of the current segments, leading to the recovery of the stream.
2018-12-02 19:14:37 +05:30
kjeyapal@akamai.com
6c1e124201 avformat/dashenc: Handled the error from dashenc_io_open() 2018-12-02 19:14:03 +05:30
Andrey Semashev
84c17449ce lavf/dashenc: Delete HLS manifests on trailer writing if remove_at_exit is set.
This fixes HLS manifests being left behind if remove_at_exit is set.
2018-12-02 19:07:30 +05:30
Andrey Semashev
2a5cf8a241 lavf/dashenc: Don't put non-mp4 streams in HLS manifests.
The only native HLS implementation in the wild (Safari browser) doesn't
support WebM. And at least some MSE-based players (e.g. shaka-player)
cannot handle WebM media segments when playing HLS. So just skip non-mp4
streams from HLS manifests. Note that such streams will still be described
by the DASH manifest and therefore consumed by players supporting DASH.
2018-12-02 19:06:54 +05:30
Andrey Semashev
fa08345e88 lavf/dashenc: Fix segment duration overflow on fine time bases.
When stream time bases are very fine grained (e.g. nanoseconds), 32-bit
segment duration may overflow for even for rather small segment duration
(about 4 seconds long). Therefore we use 64-bit values for segment duration.
2018-11-23 14:15:32 +05:30
kjeyapal@akamai.com
4903662a1d avformat/dashenc : Handled error from ff_http_do_new_request() cleanly 2018-11-22 12:06:27 +05:30
Andrey Semashev
d290bb0c54 lavf/dashenc: Fix AVDictionary leaks in case of various init errors. 2018-11-21 18:02:43 +05:30
Andrey Semashev
281a21ed50 lavf/dashenc: Add support for format-specific file extensions.
The file name template options now support a new "$ext$" placeholder,
which is replaced with a filename extension specific for the selected
file format. This is useful for the new "auto" format mode, when
different streams may use different file formats, and it is not
possible to specify the correct file name extension exactly.

Resolves warnings in the log about webm segments not having webm extensions.
2018-11-21 18:02:19 +05:30
Andrey Semashev
322e53f8ae lavf/dashenc: Add DASH segment type auto and make it the default
This commit restores the ability to create DASH streams with codecs
that require different containers that was lost after commit
2efdbf7367. It adds a new "auto" value for
the dash_segment_type option and makes it the default. When in this mode,
the segment format will be chosen based on the codec used in the stream:
webm for Vorbis, Opus, VP8 or VP9, mp4 otherwise.
2018-11-21 18:01:53 +05:30
Jan Ekström
b31a4be15f lavf/dashenc: set FLAC manifest codec string to "flac"
Internally in ISOBMFF the FLAC-in-ISOBMFF draft uses "fLaC"
as the identifier for FLACSampleEntry, and there seems to be no
MPEG-DASH specification for the in-manifest identifier for FLAC.

After testing the browsers' implementations, it seems like all of
the major browser vendors have decided to utilize the MIME type for
FLAC ("audio/flac") as the identifier. This change set leads to
that string being utilized for FLAC streams instead of the sample
entry identifier ("fLaC"), which is the default behavior.

Verified by auri_ on IRC to play with the major browsers.
2018-11-14 20:45:02 +02:00
kjeyapal@akamai.com
d6d407d2d7 avformat/dashenc: Disable writing CODECS tag for HEVC streams
For HEVC streams, only the FourCC tag is written without profile, level etc.,
This is breaking playout support in native Safari.
Native Safari playout expects the full info in CODECS tag or None at all.
2018-11-02 07:27:47 +05:30
kjeyapal@akamai.com
de43c227fd avformat/dashenc: Support HTTP persistent for init segments as well 2018-10-26 11:49:47 +05:30
kjeyapal@akamai.com
e715b8e10d avformat/dashenc: URL close unconditionally after DELETE segments
Fixes bug with HTTP DELETE when HTTP Persistent is ON.
Right now, HTTP Persistent connections is supported only for POSTs and PUTs.
HTTP DELETE will still open a new connection every time.
2018-10-21 16:26:32 +05:30
kjeyapal@akamai.com
f848d384dd avformat/dashenc: Support HTTP Persistent for master.m3u8 as well 2018-10-21 16:26:32 +05:30
Karthick Jeyapal
444cdb422d avformat/dashenc: Dont ignore the codec tag from codec parameters 2018-10-18 10:56:05 +05:30
Jian Yang
f7affc6f70 avformat/dashenc: only write video streams into HLS master playlist
Tool mediastreamvalidator reports error "Variant media_[N].m3u8 is
missing audio group" for audio streams in HLS master playlist. As audio
streams are already listed in audio group, skip them as variant media
streams in master playlist.
2018-10-11 12:46:31 +05:30
Karthick Jeyapal
49c67e79ca avformat/dashenc: Reduce Muxing overhead for chunked CMAF format
SIDX atom being inserted for every MOOF atom increases the muxing overhead.
This behaviour can be disabled for chunked CMAF format by enabling Global SIDX option of mov muxer.
2018-09-19 17:31:56 +05:30
James Almer
e3981c5a21 avformat/dashenc: Format VP9 profile as decimal instead of Hexadecimal
Signed-off-by: James Almer <jamrial@gmail.com>
2018-09-17 14:29:46 -03:00
Karthick Jeyapal
422be081a3 avformat/dashenc: Format VP9 bitdepth as decimal instead of Hexadecimal
For example bitdepth should be printed as 10 instead of 0A. Thanks to Hendrik Leppkes for pointing this out

Signed-off-by: James Almer <jamrial@gmail.com>
2018-09-17 14:29:40 -03:00
Karthick Jeyapal
7ff3d2594f avformat/dashenc: Format VP9 level as decimal instead of hexadecimal
Commit ID 63c69d51c7 fixed the bug in vpcc, get_vp9_level() function, causing this change.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-09-17 14:29:40 -03:00
Karthick Jeyapal
44ee858b6d avformat/dashenc: Remove muxer overhead from Bandwidth field in DASH manifest
Fixes bug id #7386
Muxer overhead calculations was intented for HLS playlist as Apple's mediastreamvalidator tests were failing.
But applying the same fix for DASH manifest proved counterproductive, as Bandwidth can be used for segment name templates.
2018-09-11 17:31:09 +05:30
Karthick Jeyapal
606879ec42 avformat/dashenc: Add CODECS tag to HLS master playlist 2018-09-11 17:30:27 +05:30
Antonio Morell
6f3e2913f5 libavformat/dashenc: Fix relative URI of HLS master playlist 2018-07-30 11:09:54 +05:30
Karthick Jeyapal
ebf85d3190 avformat/dashenc: Added a warning for incorrect segment name extension
Applicable only to webm output format.
By default all the segment filenames end with .m4s extension.
When someone chooses webm output format, we recommend they also override the relevant segment name options to end with .webm extension. This patch will issue a warning for he same
2018-05-28 10:52:07 +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
Jan Ekström
bad42e9b40 lavf/dashenc: pass standards compliance value to the internal context
Enables one to test possibly nonstandard formats such as Opus or
FLAC in ISOBMFF, among other things.

This becomes much more useful if output segment format becomes an
option, or if the WebM segment feature gets removed.
2018-05-03 10:41:13 +05:30
Jan Ekström
48684d2605 lavf/dashenc: require experimental mode to be enabled for WebM
It has not ever been working and has not been validated,
Additionally, mention that the segment file names should be changed
to end with webm instead of m4s, which is utilized for ISOBMFF
fragments.
2018-05-03 10:40:32 +05:30
Rodger Combs
6f119dc321 lavf/dashenc: don't call flush_init_segment before avformat_write_header
Fixes crash when muxing MKV-in-DASH
2018-05-03 10:39:39 +05:30
Karthick Jeyapal
4c27a6fbfd avformat/dashenc: Set mp4 as the default format for VP9
There is a separate muxer(webmdashenc.c) for supporting VP9+webm output in DASH.
Hence in this muxer we will focus on supporting VP9 in MP4
Have verified playout support of VP9+MP4 in Chrome and Firefox.
2018-04-26 14:23:08 +05:30
Karthick Jeyapal
060e74e2a9 avformat/dashenc: Set VP9 codec string with profile, level and bitdepth
Otherwise some versions of chrome browser returns "codec not supported" error
2018-04-26 14:23:08 +05:30
Steven Liu
002e45b407 avformat/dashenc: change the hls version from 6 to 7
reference hls support fmp4 file from  draft-pantos-http-live-streaming-20
the spec describes version 7 of hls protocol

Suggested-by: Ronak <ronak2121@yahoo.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2018-04-20 13:31:05 +08:00
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
2c51e33bc1 avformat/dashenc: addition of muxer overhead for @bandwidth param in MPD 2018-04-17 14:35:16 +05:30
Vishwanath Dixit
af6058d03b avformat/dashenc: constructing MPD's bandwidth string locally 2018-04-17 14:34:52 +05:30
Vishwanath Dixit
0c7bc7eb47 avformat/dashenc: addition of muxer overhead in master playlist's bandwidth 2018-04-17 14:34:25 +05:30
Vishwanath Dixit
85ae55eca3 avformat/dashenc: logic to compute muxer overhead 2018-04-17 14:34:03 +05:30