Commit Graph

155 Commits

Author SHA1 Message Date
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
Vishwanath Dixit 990380367b avformat/dashenc: addition of @availabilityTimeOffset in MPD
availability time of Nth segment = availabilityStartTime + (N*segment duration) - availabilityTimeOffset.
This field helps to reduce the latency by about a segment duration in streaming mode.
2018-04-17 14:33:37 +05:30
Vishwanath Dixit 3e75057a1d avformat/dashenc: setting @availabilityStartTime when the first frame is ready
@availabilityStartTime specifies the anchor for the computation of the earliest
availability time (in UTC) for any Segment in the Media Presentation.

As per this requirement, the @AvailabilityStartTime should be set to the
wallclock time at which the first frame of the first segment begins encoding.
But, it was getting set only when the first segment was completely ready. Making
the required correction in this patch. This correction is mainly needed to reduce
the latency in live streaming use cases.
2018-04-17 14:32:50 +05:30
Vishwanath Dixit 1263d91198 avformat/dashenc: removed 'write_manifest' call from 'write_header'
Calling 'write_manifest' from 'write_header' was causing creation of
first MPD with invalid values. Ex: zero @duration param value. Also,
the manifest files (MPD or M3U8s) should be created when at-least
one media frame is ready for consumption.
2018-04-17 14:32:24 +05:30
Vishwanath Dixit 51888c85d4 avformat/dashenc: writing average segment duration for @duration in template mode 2018-04-17 14:32:01 +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
Rodger Combs 08e0f45cc8 lavf/dashenc: remove unneeded call to dash_free 2018-03-18 12:36:59 +05:30
Ravindra 99230b7ef8 libavformat/dashenc: Option to set timeout for socket I/O operation 2018-03-18 12:36:28 +05:30
Serhii Marchuk e45d557561 avformat/dashenc: Use HTTP DELETE for HTTP base proto 2018-03-03 18:27:48 +05:30
Vishwanath Dixit 0dd1fff1c9 avformat/dashenc: fix for segment open issue when persistent connection is enabled 2018-03-03 18:26:44 +05:30
Karthick Jeyapal e3851f6a37 avformat/dashenc: Removed usage of deprecated 'filename' variable 2018-02-27 08:40:48 +05:30
Serhii Marchuk 6d763ab588 avformat/dashenc: add option to change HTTP method 2018-02-27 08:39:47 +05:30
Vishwanath Dixit 28924f4b48 avformat/dashenc: chunk streaming support for low latency use cases 2018-02-24 10:55:28 +05:30
Vishwanath Dixit ffe7cc89d0 avformat/dashenc: opening a segment file when its first frame is ready 2018-02-24 10:54:09 +05:30
Marton Balint 18ac642359 avformat: migrate to AVFormatContext->url
Signed-off-by: Marton Balint <cus@passwd.hu>
2018-01-28 23:06:43 +01:00
Karthick Jeyapal 18e2ac032e avformat/dashenc: Signal http end of chunk(http_shutdown) explicitly
Currently http end of chunk is signalled implicitly in dashenc_io_open().
This mean playlists http writes would have to wait upto a segment duration to signal end of chunk causing delays.
This patch will fix that problem and improve performance.
2018-01-26 07:26:09 +05:30
Karthick Jeyapal 0df9d0f4cb avformat/dashenc: Fix a resource leak when http persistent in enabled 2018-01-26 07:25:31 +05:30
Vishwanath Dixit 1948b76a1b avformat/hlsenc: closed caption tags in the master playlist 2018-01-24 11:42:57 +08:00
Karthick Jeyapal 0afa171f25 avformat/hlsenc: Add CODECS attribute to master playlist 2018-01-19 17:03:09 +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
Karthick Jeyapal 5297ae96a1 avformat/dashenc: Addition of #EXT-X-MEDIA tag and AUDIO attribute
This is required for AV playout from master.m3u8.
Otherwise master.m3u8 lists only video-only and/or audio-only streams.

Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
2017-12-29 13:47:53 +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 e3b2c8502b avformat/dashenc: avformat/dashenc: Fix the EXT-X-TARGETDURATION as per the hls specification 2017-12-22 07:44:51 +08:00
Steven Liu 1cfde7abd0 avformat/dashenc: add avpriv_io_move return value check
fix cid: 1424883

Suggested-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-12-04 12:06:26 +08:00
Steven Liu 071f47649c avformat/hlsplaylist: add int type of API ff_hls_write_file_entry
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-12-04 12:03:37 +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
Karthick J a1f8f1340a avformat/dashenc: Associate mpd extension with dash muxer
Reviewed-by: 刘歧 <lq@chinaffmpeg.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-11-25 02:32:33 +01: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
James Cowgill 0ecb1c53c8 avformat/dashenc: fix min_seg_duration option size
In the DASHContext structure, min_seg_duration is declared as an int,
but the AVOption list claimed it was an INT64. Change the option list
to use the correct size, which should fix some initialization errors
seen on big-endian platforms.

Signed-off-by: James Cowgill <jcowgill@debian.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-11-19 04:38:29 +01:00
James Almer 362372c46b Merge commit '4723c6226aa1ece4099338cc9b38a9cef4fa4846'
* commit '4723c6226aa1ece4099338cc9b38a9cef4fa4846':
  dashenc: fix bitrate estimation with correct scaling

Merged-by: James Almer <jamrial@gmail.com>
2017-11-12 00:15:57 -03:00
Peter Große 3c838e6442 dashenc: copy stream frame rate to output stream
Leads to setting of DefaultDuration in Matroska muxer based on frame rate instead of timebase.
Fixes playback in Chrome.

Signed-off-by: Peter Große <pegro@friiks.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-29 18:28:40 +01:00
Anton Schubert fe334712dd dashenc: Don't output frameRates at both AS and Representation-level. Only output maxFrameRate at AS-level.
Fix conformance regarding section "3.2.4. Presence of Attributes and
Element" of the "Guidelines for Implementation: DASH-IF Interoperability
Points V4.1" (http://dashif.org/guidelines/)

Signed-off-by: Anton Schubert <ischluff@mailbox.org>
Signed-off-by: Peter Große <pegro@friiks.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-29 18:28:40 +01:00
Peter Große 2911dabd51 dashenc: allow AdaptationSets to have different average frame rates
Signed-off-by: Peter Große <pegro@friiks.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-29 18:28:40 +01:00