1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

203 Commits

Author SHA1 Message Date
James Almer
0c19dd2df4 avformat/dashenc: allow setting segment durations per AdaptationSet
Implemented as as a seg_duration key=value entry in the adaptation_sets muxer
option.
It has the same syntax as the global seg_duration option, and has precedence
over it if set.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-01-15 12:22:28 -03:00
Andreas Rheinhardt
8aeab0dbc1 avformat/dashenc: Fix leak of AVFormatContext on error
The Dash muxer uses submuxers and when one such submuxer has been allocated,
it is initially only stored in a temporary variable. Therefore it leaks
if an error happens between the allocation and storing it permanently.
This commit changes this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: "Jeyapal, Karthick" <kjeyapal@akamai.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-08 01:32:26 +01:00
Marton Balint
59172164f3 avformat/dashenc: use AV_OPT_TYPE_DICT for format_options
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-01 20:41:34 +01:00
Steven Liu
b26225a3c7 avformat/dashenc: remove unused check of avformat_free_context
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Jun Zhao <barryjzhao@tencent.com>
Reviewed-by: Jeyapal, Karthick <kjeyapal@akamai.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-12-02 00:08:07 +08:00
James Almer
1cf2f040e3 avformat/dashenc: fix writing the AV1 codec string in mp4 mode
From https://aomediacodec.github.io/av1-isobmff/#codecsparam, the parameters
sample entry 4CC, profile, level, tier, and bitDepth are all mandatory fields.
All the other fields are optional, mutually inclusive (all or none).

Fixes ticket #8049

Signed-off-by: James Almer <jamrial@gmail.com>
2019-08-03 12:33:15 -03:00
James Almer
ce6a98e830 avformat/dashenc: update stream extradata from packet side data
codecpar->extradata is not going to change between packets. New extradata
is instead propagated using packet side data.

Use ff_alloc_extradata() as well.

Signed-off-by: James Almer <jamrial@gmail.com>
2019-08-03 12:33:14 -03:00
Leo Zhang
116303cd24 avformat/dashenc: add descriptor which is useful to the scheme defined by ISO/IEC 23009-1:2014/Amd.2:2015.
Signed-off-by: leozhang <leozhang@qiyi.com>
2019-07-22 07:57:39 +05:30
Alfred E. Heggestad
2b634e7c23 avformat/dashenc: split extension for MP4 into .mp4 or .m4s 2019-06-25 15:07:44 +05:30
Steven Liu
fa7a6dbd76 avformat/hlsenc: add EXT-X-I-FRAMES-ONLY tag support
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-06-14 10:53:23 +08:00
Michael Niedermayer
359d4e10a0 avformat/dashenc: use 64bit for handling the return of avio_tell()
The return code is 64bit, so this is more correct, especially in case it
actually would be a file of such large size

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-05-17 09:32:21 +05:30
Karthick J
eeca67e023 avformat/dashenc: Fix a bug with writing "final" manifest
This bug was introduced in the commit 951561b64e
2019-04-22 11:31:25 +05:30
Karthick J
bcde9ec020 avformat/dashenc: Disable streaming for webm output
Currently streaming for webm output doesn't work.
Disabling explicitly will make sure that the manifest will get generated correctly.
2019-04-16 15:59:05 +05:30
joepadmiraal
951561b64e libavformat/dashenc : Prevent writing manifest files multiple times 2019-04-10 12:32:17 +05:30
Karthick J
6aeaac3e1c avformat/dashenc: Add support for Global SIDX 2019-04-02 11:16:06 +05:30
joepadmiraal
056a2ac168 avformat/dashenc: Added #EXT-X-PROGRAM-DATE-TIME to HLS playlists 2019-03-06 10:58:57 +05:30
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