summaryrefslogtreecommitdiff
path: root/libavformat/dashenc.c
Commit message (Collapse)AuthorAge
* 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>
* | Merge commit '3041183677bda0a431b36e96a2c76617abaa8183'Michael Niedermayer2015-03-19
|\| | | | | | | | | | | | | * commit '3041183677bda0a431b36e96a2c76617abaa8183': dashenc: Heuristically fill in the duration of packets that need it Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dashenc: Heuristically fill in the duration of packets that need itMartin Storsjö2015-03-19
| | | | | | | | | | | | | | | | | | | | | | This avoids that the mp4 muxer does a similar heuristic, adjusting the timestamps in a way that the dash muxer doesn't know the actual timestamps written to the file in the end. By making sure that the mp4 muxer internal heuristic isn't applied, we know the exact timestamps written to file, so that the timestamps in manifest match the files. Signed-off-by: Martin Storsjö <martin@martin.st>
| * dashenc: Update extradata for mov muxerTimo Rothenpieler2015-03-06
| | | | | | | | | | | | | | | | | | | | | | | | The mov muxer already supports picking up extradata that wasn't present during the avformat_write_header call - we just need to propagate it. Since the dash muxer uses delay_moov, we have time up until the first segment is written to get extradata filled in. Also update the codec description string when the extradata becomes available. Signed-off-by: Martin Storsjö <martin@martin.st>
| * dashenc: Simplify code by using a local variableTimo Rothenpieler2015-03-06
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
| * dashenc: Simplify code by using a local variableMartin Storsjö2015-03-02
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | avformat/dashenc: Update extradata for mov muxerTimo Rothenpieler2015-03-05
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/dashenc: Update codec_str on extradata_size changeTimo Rothenpieler2015-03-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/dashenc: Use local variable instead of duplicated dereferencesTimo Rothenpieler2015-03-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '8e32b1f0963d01d4f5d4803eb721f162e0d58d9a'Michael Niedermayer2015-02-25
|\| | | | | | | | | | | | | * commit '8e32b1f0963d01d4f5d4803eb721f162e0d58d9a': libavformat: Use ffio_free_dyn_buf where applicable Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * libavformat: Use ffio_free_dyn_buf where applicableMartin Storsjö2015-02-24
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '3a724a7f3ba7fa766c6a6f0924a15cc742031b8d'Michael Niedermayer2015-01-22
|\| | | | | | | | | | | | | * commit '3a724a7f3ba7fa766c6a6f0924a15cc742031b8d': dashenc: Use inttypes.h macros for format strings instead of %lld Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dashenc: Use inttypes.h macros for format strings instead of %lldMartin Storsjö2015-01-22
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
| * dashenc: Fix format string generationRodger Combs2015-01-22
| | | | | | | | | | | | | | Previously this always used the "lld" format for all parameters, not only time parameters. Signed-off-by: Martin Storsjö <martin@martin.st>
* | avformat/dashenc: fix format string generationRodger Combs2015-01-22
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '46808fdf04ab113df374157b90b506eb3110daf2'Michael Niedermayer2015-01-05
|\| | | | | | | | | | | | | * commit '46808fdf04ab113df374157b90b506eb3110daf2': movenc: Enable editlists by default if delay_moov is enabled Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * movenc: Enable editlists by default if delay_moov is enabledMartin Storsjö2015-01-04
| | | | | | | | | | | | | | Being able to write editlists properly is one of the main points in the delay_moov flag. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '7a1a63e34fa46af18311c2493fdaec9a93bdb750'Michael Niedermayer2015-01-03
|\| | | | | | | | | | | | | * commit '7a1a63e34fa46af18311c2493fdaec9a93bdb750': dashenc: Use pts for MPD timeline timestamps Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dashenc: Use pts for MPD timeline timestampsMartin Storsjö2015-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should be more correct. This also should give more sensible switching between video streams with different amount of b-frame delay. The current dash.js release (1.2.0) fails to start playback of such files from the start (if the start pts is > 0), but this has been fixed in the current git version of dash.js. Also enable the use of edit lists, so that streams in many cases start at pts=0. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'c5e7ea13d2d4da0c5da91973a547afff6fe9e011'Michael Niedermayer2015-01-03
|\| | | | | | | | | | | | | * commit 'c5e7ea13d2d4da0c5da91973a547afff6fe9e011': dashenc: Use delay_moov Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dashenc: Use delay_moovMartin Storsjö2015-01-03
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '8d54bacb789c7d37ca3cf48d9ac13083ad0c1ba7'Michael Niedermayer2014-12-30
|\| | | | | | | | | | | | | * commit '8d54bacb789c7d37ca3cf48d9ac13083ad0c1ba7': dashenc: Remove some stray double spaces Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dashenc: Remove some stray double spacesMartin Storsjö2014-12-29
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'b91a5757fcbf723da99b05b298a6f820271dbc2b'Michael Niedermayer2014-12-30
|\| | | | | | | | | | | | | * commit 'b91a5757fcbf723da99b05b298a6f820271dbc2b': dashenc: Fix writing of timelines that don't start at t=0 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dashenc: Fix writing of timelines that don't start at t=0Martin Storsjö2014-12-29
| | | | | | | | | | | | | | | | When writing an explicit time, reset the cur_time variable to this value as well. This avoids writing excessive time attributes for each segment in the timeline, as long as the segments are continuous. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '456e93bfdd4cbc5e995dea415019abd0703d0e16'Michael Niedermayer2014-12-17
|\| | | | | | | | | | | | | * commit '456e93bfdd4cbc5e995dea415019abd0703d0e16': dashenc: Adjust the start time of a segment to the end of the previous segment Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dashenc: Adjust the start time of a segment to the end of the previous segmentMartin Storsjö2014-12-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the same adjustment that the mp4 muxer does to the start timestamp of fragments, since the timestamp of a sample in an mp4 file is implicit from the sum of earlier sample durations. This avoids gaps in the timeline (which can stop dash.js from playing it back), and makes sure the timestamp on the segmenter level matches what the mp4 muxer actually writes into the segments. This is only an issue if the AVPacket duration of the last packet of a segment doesn't point to the actual start timestamp of the next packet (the first in the next segment). Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '2f628d5943c12389c07d652d23d3916997f9f0f6'Michael Niedermayer2014-12-17
|\| | | | | | | | | | | | | * commit '2f628d5943c12389c07d652d23d3916997f9f0f6': dashenc: Write segment timelines properly if the timeline has gaps Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dashenc: Write segment timelines properly if the timeline has gapsMartin Storsjö2014-12-17
| | | | | | | | | | | | | | | | | | | | | | | | Write a new start time if the duration of the previous segment didn't match the start of the next one. Check that segments actually are continuous before writing a repeat count. This makes sure timestamps deduced from the timeline actually match the real start timestamp as written in filenames (if using a template containing $Time$). Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'e737a4aaafcb1d761b7f96043c2f83ce742c64ae'Michael Niedermayer2014-12-11
|\| | | | | | | | | | | | | | | | | | | | | * commit 'e737a4aaafcb1d761b7f96043c2f83ce742c64ae': dashenc: Change the duration fields to 64 bit Conflicts: libavformat/dashenc.c See: e65849a70bfb401306038d41ebd8b5750deb3cfd Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dashenc: Change the duration fields to 64 bitMartin Storsjö2014-12-10
| | | | | | | | | | | | | | | | For the last_duration field, it's mostly theoretical, but the total_duration field more probably may need to actually be 64 bit. Bug-Id: CID 1254944 Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'fa8934d6d6a0bb290010bdf16265c40b331d56fb'Michael Niedermayer2014-12-10
|\| | | | | | | | | | | | | * commit 'fa8934d6d6a0bb290010bdf16265c40b331d56fb': dashenc: log file output progress in verbose mode Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dashenc: log file output progress in verbose modeBryan Huh2014-12-10
| | | | | | | | | | | | | | As the manifest/segments are flushed to disk, log to stderr the progress, when in verbose logging mode Signed-off-by: Martin Storsjö <martin@martin.st>
* | avformat/dashenc: make durations 64bitMichael Niedermayer2014-12-07
| | | | | | | | | | | | | | Fix potential integer overflow Fix CID1254944 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>