Commit Graph

136 Commits

Author SHA1 Message Date
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
Peter Große 1443859a8d dashenc: don't write header data before the first packet arrives
Fixes: 1b8ef01f04 ("dashenc: add webm support")
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 44ede215b6 dashenc: set DASH related options for the subsequent matroska muxer when using webm
This patch is inspired by the ffmpeg webm_chunk muxer and fixes that all resulting
tracks have the same track number.

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 3dca4887ae dashenc: fix bitrate estimation with correct scaling
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 8edb9d4572 dashenc: move UTCTiming element to the end of the manifest
Required by comformance XSD [1].

[1] https://github.com/Dash-Industry-Forum/Conformance-and-reference-source/blob/master/conformance/MPDValidator/schemas/DASH-MPD.xsd

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-28 20:24:04 +02:00
Peter Große 3606c11417 dashenc: use av_dict_set_int instead of static function
Signed-off-by: Peter Große <pegro@friiks.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-28 20:24:04 +02:00
Anton Schubert 4723c6226a dashenc: fix bitrate estimation with correct scaling
Signed-off-by: Anton Schubert <ischluff@mailbox.org>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-10-27 19:52:48 +02:00
Rodger Combs 1b8ef01f04 Merge commit '7295b7373862ee54903b33d6ef3335531dfa93ad'
* commit '7295b7373862ee54903b33d6ef3335531dfa93ad':
  dashenc: add webm support

Merged-by: Rodger Combs <rodger.combs@gmail.com>
2017-09-26 14:13:09 -03:00
Rodger Combs a9f51d19d6 Merge commit '01f1f017d831cf14617aaaeafcec3ae3a81efce7'
* commit '01f1f017d831cf14617aaaeafcec3ae3a81efce7':
  dashenc: use avio_dynbuf instead of packet_write callback

Merged-by: Rodger Combs <rodger.combs@gmail.com>
2017-09-26 14:12:19 -03:00
Rodger Combs 5c9373385d Merge commit 'dce2929efa8e82b0832a828f7e8cb81ff8c20a4e'
* commit 'dce2929efa8e82b0832a828f7e8cb81ff8c20a4e':
  dashenc: copy language and role metadata from streams assigned to sets

Merged-by: Rodger Combs <rodger.combs@gmail.com>
2017-09-26 14:11:50 -03:00
Rodger Combs 3f7a8bb67b Merge commit 'ca9bc9de690258d4761a19b0df6e9c9113b80115'
* commit 'ca9bc9de690258d4761a19b0df6e9c9113b80115':
  dashenc: default to one AdaptationSet per stream

Merged-by: Rodger Combs <rodger.combs@gmail.com>
2017-09-26 14:11:25 -03:00
Rodger Combs c0fae3ff90 Merge commit 'efd2fc41b3f0749f9715d50b581f22bbaa8c5b99'
* commit 'efd2fc41b3f0749f9715d50b581f22bbaa8c5b99':
  dashenc: allow assigning all streams of a media type to an AdaptationSet

Merged-by: Rodger Combs <rodger.combs@gmail.com>
2017-09-26 14:11:02 -03:00
Rodger Combs 777d53c793 Merge commit '3d23a5f96ad72961c14ba3a0c2add8f2ab374b61'
* commit '3d23a5f96ad72961c14ba3a0c2add8f2ab374b61':
  dashenc: add support for assigning streams to AdaptationSets

Merged-by: Rodger Combs <rodger.combs@gmail.com>
2017-09-26 14:10:30 -03:00
Rodger Combs 3b9ef13588 Merge commit '9df9309d233f59d9706444a1e24ac24139f2640d'
* commit '9df9309d233f59d9706444a1e24ac24139f2640d':
  dashenc: calculate stream bitrate from first segment if not available

Merged-by: Rodger Combs <rodger.combs@gmail.com>
2017-09-26 14:02:44 -03:00
James Almer 52223ffe44 Revert "lavf/dashenc: update bitrates on dash_write_trailer"
This reverts commit 89c0fda5f4.

A different solution will be committed instead.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-26 13:59:56 -03:00
Steven Liu 837580f458 avformat/dash: move reused API to common file and header file
move from dashenc, move DASHTmplId and dash_fill_tmpl_params to
dash.c, they will be used by dash demuxer and dash muxer.

v2 fixed:
1. rename common file from dashcomm.* to dash.*
Suggested-by: Hendrik Leppkes <h.leppkes@gmail.com>

v3 fixed:
1. rename header file pre defined
2. add ff_ prefix for the internal API
Suggested-by: James Almer <jamrial@gmail.com>

Suggested-by: Timo Rothenpieler <timo@rothenpieler.org>
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Steven Liu <lq@onvideo.cn>
2017-09-01 10:20:56 +08:00
Martin Storsjö d086e40459 lavf: Remove codec_tag from dashenc and smoothstreamingenc
Skip the codec_tag altogether here, to let the user (try to) set
whichever codec/tag is preferred; the individual chained muxer will
reject invalid codecs anyway.

(cherry picked from commit 61f589e31e)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-04 15:47:10 -04:00
Martin Storsjö 61f589e31e lavf: Remove codec_tag from dashenc and smoothstreamingenc
Currently, the tags enforced and set on the segmenter muxer level
mismatch what the mp4/ismv muxer uses (since 713efb2c0d).

Skip the codec_tag altogether here, to let the user (try to) set
whichever codec/tag is preferred; the individual chained muxer will
reject invalid codecs anyway.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-07-02 22:42:26 +03:00
Clément Bœsch 1a950f32ab Merge commit 'e519dcd937c7c98815ba9884867590e302272016'
* commit 'e519dcd937c7c98815ba9884867590e302272016':
  dashenc: separate segments based on current segment duration

Merged-by: Clément Bœsch <u@pkh.me>
2017-05-20 16:55:22 +02:00
Clément Bœsch e815111367 Merge commit '1920382aa9f21d7ed1a3c2214990da8d2b067a92'
* commit '1920382aa9f21d7ed1a3c2214990da8d2b067a92':
  dashenc: add option to provide UTC timing source

Also use E instead of AV_OPT_FLAG_ENCODING_PARAM to be consistent with
the other AVOption.

Merged-by: Clément Bœsch <u@pkh.me>
2017-05-20 16:53:36 +02:00