summaryrefslogtreecommitdiff
path: root/libavformat/dashenc.c
Commit message (Collapse)AuthorAge
* Merge commit '7295b7373862ee54903b33d6ef3335531dfa93ad'Rodger Combs2017-09-26
|\ | | | | | | | | | | | | * commit '7295b7373862ee54903b33d6ef3335531dfa93ad': dashenc: add webm support Merged-by: Rodger Combs <rodger.combs@gmail.com>
| * dashenc: add webm supportPeter Große2017-01-31
| | | | | | | | | | | | | | Use webm muxer for VP8, VP9 and Opus codec, mp4 muxer otherwise. Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '01f1f017d831cf14617aaaeafcec3ae3a81efce7'Rodger Combs2017-09-26
|\| | | | | | | | | | | | | * commit '01f1f017d831cf14617aaaeafcec3ae3a81efce7': dashenc: use avio_dynbuf instead of packet_write callback Merged-by: Rodger Combs <rodger.combs@gmail.com>
| * dashenc: use avio_dynbuf instead of packet_write callbackPeter Große2017-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dash_write function drops data, if no IOContext is initialized. Since the mp4 muxer is used in "frag_custom" mode, data is only written when calling av_write_frame(NULL) explicitly and thus there will be no data loss. To add support for webm as subordinate muxer, which doesn't have such a mode, a dynamic buffer is required to provide an always initialized IOContext. Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'dce2929efa8e82b0832a828f7e8cb81ff8c20a4e'Rodger Combs2017-09-26
|\| | | | | | | | | | | | | * commit 'dce2929efa8e82b0832a828f7e8cb81ff8c20a4e': dashenc: copy language and role metadata from streams assigned to sets Merged-by: Rodger Combs <rodger.combs@gmail.com>
| * dashenc: copy language and role metadata from streams assigned to setsPeter Große2017-01-31
| | | | | | | | | | Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'ca9bc9de690258d4761a19b0df6e9c9113b80115'Rodger Combs2017-09-26
|\| | | | | | | | | | | | | * commit 'ca9bc9de690258d4761a19b0df6e9c9113b80115': dashenc: default to one AdaptationSet per stream Merged-by: Rodger Combs <rodger.combs@gmail.com>
| * dashenc: default to one AdaptationSet per streamPeter Große2017-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously all mapped streams of a media type (video, audio) where assigned to a single AdaptationSet. Using the DASH live profile it is mandatory, that the segments of all representations are aligned, which is currently not enforced. This leads to problems when using video streams with different key frame intervals. So to play safe, default to one AdaptationSet per stream, unless overwritten by explicit assignment. To get the old assignment scheme, use -adaptation_sets "id=0,streams=v id=1,streams=a" Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'efd2fc41b3f0749f9715d50b581f22bbaa8c5b99'Rodger Combs2017-09-26
|\| | | | | | | | | | | | | * commit 'efd2fc41b3f0749f9715d50b581f22bbaa8c5b99': dashenc: allow assigning all streams of a media type to an AdaptationSet Merged-by: Rodger Combs <rodger.combs@gmail.com>
| * dashenc: allow assigning all streams of a media type to an AdaptationSetPeter Große2017-01-31
| | | | | | | | | | | | | | | | | | Using the characters "v" or "a" instead of stream index numbers for assigning streams in the adaption_set option, all streams matching that given type will be added to the AdaptationSet. Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '3d23a5f96ad72961c14ba3a0c2add8f2ab374b61'Rodger Combs2017-09-26
|\| | | | | | | | | | | | | * commit '3d23a5f96ad72961c14ba3a0c2add8f2ab374b61': dashenc: add support for assigning streams to AdaptationSets Merged-by: Rodger Combs <rodger.combs@gmail.com>
| * dashenc: add support for assigning streams to AdaptationSetsPeter Große2017-01-31
| | | | | | | | | | | | | | | | | | Also makes sure all streams are assigned to exactly one AdaptationSet. This patch is originally based partially on code by Vignesh Venkatasubramanian. Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '9df9309d233f59d9706444a1e24ac24139f2640d'Rodger Combs2017-09-26
|\| | | | | | | | | | | | | * commit '9df9309d233f59d9706444a1e24ac24139f2640d': dashenc: calculate stream bitrate from first segment if not available Merged-by: Rodger Combs <rodger.combs@gmail.com>
| * dashenc: calculate stream bitrate from first segment if not availablePeter Große2017-01-31
| | | | | | | | | | | | | | | | | | Bandwidth information is required in the manifest, but not always provided by the demuxer. In that case calculate the bandwith based on the size and duration of the first segment. Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
* | Revert "lavf/dashenc: update bitrates on dash_write_trailer"James Almer2017-09-26
| | | | | | | | | | | | | | | | This reverts commit 89c0fda5f43d8a3d3a1c538ff8d72e6737bc7d8e. A different solution will be committed instead. Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/dash: move reused API to common file and header fileSteven Liu2017-09-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | lavf: Remove codec_tag from dashenc and smoothstreamingencMartin Storsjö2017-07-04
| | | | | | | | | | | | | | | | | | 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 61f589e31e84ae02d7ac6837f30f19c437b1fc2e) Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | Merge commit 'e519dcd937c7c98815ba9884867590e302272016'Clément Bœsch2017-05-20
|\| | | | | | | | | | | | | * commit 'e519dcd937c7c98815ba9884867590e302272016': dashenc: separate segments based on current segment duration Merged-by: Clément Bœsch <u@pkh.me>
| * dashenc: separate segments based on current segment durationPeter Große2017-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation creates new segments comparing pkt->pts - first_pts > nb_segs * min_seg_duration This works fine, but if the keyframe interval is smaller than "min_seg_duration" segments shorter than the minimum segment duration are created. Example: keyint=50, min_seg_duration=3000000 segment 1 contains keyframe 1 (duration=2s < total_duration=3s) and keyframe 2 (duration=4s >= total_duration=3s) segment 2 contains keyframe 3 (duration=6s >= total_duration=6s) segment 3 contains keyframe 4 (duration=8s < total_duration=9s) and keyframe 5 (duration=10s >= total_duration=9s) ... Segment 2 is only 2s long, shorter than min_seg_duration = 3s. To fix this, new segments are created based on the actual written duration. Otherwise the option name "min_seg_duration" is misleading. Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '1920382aa9f21d7ed1a3c2214990da8d2b067a92'Clément Bœsch2017-05-20
|\| | | | | | | | | | | | | | | | | | | * 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>
| * dashenc: add option to provide UTC timing sourcePeter Große2017-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If set, adds a UTCTiming tag in the manifest. This is part of the recommendations listed in the "Guidelines for Implementations: DASH-IF Interoperability Points" [1][2] Section 4.7 describes means for the Availability Time Synchronization. A usable default is "https://time.akamai.com/?iso" [1] http://dashif.org/guidelines/ [2] http://dashif.org/wp-content/uploads/2016/12/DASH-IF-IOP-v4.0-clean.pdf (current version as of writing) Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '3c2717e48dd8c5115f2be35c2afcabd8a1f67aee'Clément Bœsch2017-05-20
|\| | | | | | | | | | | | | * commit '3c2717e48dd8c5115f2be35c2afcabd8a1f67aee': dashenc: increase buffer time hint in the manifest Merged-by: Clément Bœsch <u@pkh.me>
| * dashenc: increase buffer time hint in the manifestAnton Schubert2017-01-27
| | | | | | | | | | | | | | to avoid rebuffering on the clientside for difficult network conditions. Signed-off-by: Anton Schubert <ischluff@mailbox.org> Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '95f1004bdfdf2d26c330c1d4b7c4ac9352d60b18'Clément Bœsch2017-05-20
|\| | | | | | | | | | | | | * commit '95f1004bdfdf2d26c330c1d4b7c4ac9352d60b18': dashenc: add mandatory id to AdaptationSet and Period in manifest Merged-by: Clément Bœsch <u@pkh.me>
| * dashenc: add mandatory id to AdaptationSet and Period in manifestPeter Große2017-01-27
| | | | | | | | | | Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '1ae6cb7d6e4fee30754a46bc91f40ff75ac4412a'Clément Bœsch2017-05-20
|\| | | | | | | | | | | | | * commit '1ae6cb7d6e4fee30754a46bc91f40ff75ac4412a': dashenc: fix ISO8601 UTC parsing Merged-by: Clément Bœsch <u@pkh.me>
| * dashenc: fix ISO8601 UTC parsingAnton Schubert2017-01-27
| | | | | | | | | | | | | | | | | | Appends Z to timestamp to force ISO8601 datetime parsing as UTC. Without Z, some browsers (Chrome) interpret the timestamp as localtime and others (Firefox) interpret it as UTC. Signed-off-by: Anton Schubert <ischluff@mailbox.org> Signed-off-by: Martin Storsjö <martin@martin.st>
| * dash: Use correct ISO C scanf conversion specifierDiego Biurrun2016-10-28
| |
* | Fix all -Wformat warnings raised by DJGPPClément Bœsch2017-03-29
| |
* | lavf/dashenc: update bitrates on dash_write_trailerPrzemysław Sobala2017-03-11
| | | | | | | | | | | | | | Provides a way to change bandwidth parameter inside DASH manifest after a non-CBR H.264 encoding. Caller now is able to compute the bitrate by itself, after all packets have been written, and then set that value in AVFormatContext->streams->codecpar->bit_rate before calling av_write_trailer. As a result that value will be set in DASH manifest. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/dashenc: Only use temporary files when outputting to file protocolThomas Stephens2017-02-14
| | | | | | | | | | | | | | | | | | Skips using temporary files when outputting to a protocol other than "file", which enables dash to output content over network protocols. The logic has been copied from the HLS format. Reviewed-by: Steven Liu <lingjiujianke@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/movenc+dashenc: add automatic bitstream filteringRodger Combs2016-10-24
| | | | | | | | This is disabled by default when the empty_moov flag is enabled
* | lavf/dashenc: add deinit functionRodger Combs2016-10-24
| |
* | avformat/dashenc: Pass flags to child contextMichael Niedermayer2016-04-11
| | | | | | | | | | | | This is needed as the bitexact flag is not in the codecpar context, and thus not copied Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '9200514ad8717c63f82101dc394f4378854325bf': lavf: replace AVStream.codec with AVStream.codecpar This has been a HUGE effort from: - Derek Buitenhuis <derek.buitenhuis@gmail.com> - Hendrik Leppkes <h.leppkes@gmail.com> - wm4 <nfxjfg@googlemail.com> - Clément Bœsch <clement@stupeflix.com> - James Almer <jamrial@gmail.com> - Michael Niedermayer <michael@niedermayer.cc> - Rostislav Pehlivanov <atomnuker@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavf: replace AVStream.codec with AVStream.codecparAnton Khirnov2016-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, AVStream contains an embedded AVCodecContext instance, which is used by demuxers to export stream parameters to the caller and by muxers to receive stream parameters from the caller. It is also used internally as the codec context that is passed to parsers. In addition, it is also widely used by the callers as the decoding (when demuxer) or encoding (when muxing) context, though this has been officially discouraged since Libav 11. There are multiple important problems with this approach: - the fields in AVCodecContext are in general one of * stream parameters * codec options * codec state However, it's not clear which ones are which. It is consequently unclear which fields are a demuxer allowed to set or a muxer allowed to read. This leads to erratic behaviour depending on whether decoding or encoding is being performed or not (and whether it uses the AVStream embedded codec context). - various synchronization issues arising from the fact that the same context is used by several different APIs (muxers/demuxers, parsers, bitstream filters and encoders/decoders) simultaneously, with there being no clear rules for who can modify what and the different processes being typically delayed with respect to each other. - avformat_find_stream_info() making it necessary to support opening and closing a single codec context multiple times, thus complicating the semantics of freeing various allocated objects in the codec context. Those problems are resolved by replacing the AVStream embedded codec context with a newly added AVCodecParameters instance, which stores only the stream parameters exported by the demuxers or read by the muxers.
* | Merge commit 'd082078a88da3b3e926197d0d2aa9fa322123b76'Derek Buitenhuis2016-02-29
|\| | | | | | | | | | | | | * commit 'd082078a88da3b3e926197d0d2aa9fa322123b76': dashenc: eliminate ffurl_* usage Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * dashenc: eliminate ffurl_* usageAnton Khirnov2016-02-22
| | | | | | | | | | Now all IO should go through the IO callbacks and be interceptable by the caller.
* | avformat/dashenc: Enable dash output to work when the output isn't a local fileRaymond Hilseth2016-02-28
| | | | | | | | | | | | | | Use avpriv_io_move instead of ff_rename to support more than only the file protocol. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '9f61abc8111c7c43f49ca012e957a108b9cc7610'Derek Buitenhuis2016-02-10
|\| | | | | | | | | | | | | | | | | This also deprecates our old duplicated callbacks. * commit '9f61abc8111c7c43f49ca012e957a108b9cc7610': lavf: allow custom IO for all files Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavf: allow custom IO for all filesAnton Khirnov2016-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some (de)muxers open additional files beyond the main IO context. Currently, they call avio_open() directly, which prevents the caller from using custom IO for such streams. This commit adds callbacks to AVFormatContext that default to avio_open2()/avio_close(), but can be overridden by the caller. All muxers and demuxers using AVIO are switched to using those callbacks instead of calling avio_open()/avio_close() directly. (de)muxers that use the URLProtocol layer directly instead of AVIO remain unconverted for now. This should be fixed in later commits.
* | Update demuxers and protocols for protocol whitelist supportMichael Niedermayer2016-02-02
| | | | | | | | | | Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat: use AV_OPT_TYPE_BOOL in a bunch of placesClément Bœsch2015-12-04
| |
* | avformat/dashenc: Add framerate to dash manifestBryan Huh2015-11-18
| | | | | | | | | | | | | | | | | | | | | | | | | | DASH manifest should have framerate specified as an attribute in the AdaptationSet element and Representation elements. Though ISO/IEC 23009-1:2014 doesn't seem to define frameRate as a required attribute, it is at least optional, and DASH-IF IOP 3.0 seems to require it. See section 3.2.4 of http://dashif.org/w/2015/04/DASH-IF-IOP-v3.0.pdf In the event that avg_frame_rate is not set in the muxer, we ignore the frameRate tag altogther. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'b8d2630c5327d2818d05c8a48be0417905d8e0fd'Michael Niedermayer2015-05-11
|\| | | | | | | | | | | | | * commit 'b8d2630c5327d2818d05c8a48be0417905d8e0fd': dashenc: Reduce the segment duration if cutting out parts with edit lists Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dashenc: Reduce the segment duration if cutting out parts with edit listsMartin Storsjö2015-05-10
| | | | | | | | | | | | | | | | This makes sure that the time + duration of the first segment matches the start time of the next segment for e.g. AAC audio with encoder delay. Signed-off-by: Martin Storsjö <martin@martin.st>
| * dashenc: replace attribute id with contentType for the AdaptationSet elementJames Almer2015-05-10
| | | | | | | | | | | | | | | | | | | | id should be an integer, not a string. It is also optional, so use contentType instead which is the proper attribute for these values. This fixes an MPD validation error. Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* | dashenc: replace attribute id with contentType for the AdaptationSet elementJames Almer2015-05-11
| | | | | | | | | | | | | | | | | | | | id should be an integer, not a string. It is also optional, so use contentType instead which is the proper attribute for these values. This addresses ticket #4545, fixing an MPD validation error. Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '2cc3936599b6fc63143036659653d1be0624360f'Michael Niedermayer2015-04-20
|\| | | | | | | | | | | | | * commit '2cc3936599b6fc63143036659653d1be0624360f': dashenc: Add a publishTime field in dynamic manifests Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dashenc: Add a publishTime field in dynamic manifestsMartin Storsjö2015-04-20
| | | | | | | | | | | | This field is mandatory in dynamic manifests. Signed-off-by: Martin Storsjö <martin@martin.st>