1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00
Commit Graph

62 Commits

Author SHA1 Message Date
Derek Buitenhuis
48847ee357 Merge commit 'd082078a88da3b3e926197d0d2aa9fa322123b76'
* commit 'd082078a88da3b3e926197d0d2aa9fa322123b76':
  dashenc: eliminate ffurl_* usage

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-29 15:41:03 +00:00
Raymond Hilseth
c66a6369e4 avformat/dashenc: Enable dash output to work when the output isn't a local file
Use avpriv_io_move instead of ff_rename to support more than only
the file protocol.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-28 22:32:28 +01:00
Anton Khirnov
d082078a88 dashenc: eliminate ffurl_* usage
Now all IO should go through the IO callbacks and be interceptable by
the caller.
2016-02-22 11:29:00 +01:00
Derek Buitenhuis
bc9a5965c8 Merge commit '9f61abc8111c7c43f49ca012e957a108b9cc7610'
This also deprecates our old duplicated callbacks.

* commit '9f61abc8111c7c43f49ca012e957a108b9cc7610':
  lavf: allow custom IO for all files

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-10 14:42:41 +00:00
Michael Niedermayer
fe3fed0b14 Update demuxers and protocols for protocol whitelist support
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-02 04:16:50 +01:00
Anton Khirnov
9f61abc811 lavf: allow custom IO for all files
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.
2016-01-24 16:45:32 +01:00
Clément Bœsch
43ecec0f03 avformat: use AV_OPT_TYPE_BOOL in a bunch of places 2015-12-04 15:43:33 +01:00
Bryan Huh
0be48dd9bb avformat/dashenc: Add framerate to dash manifest
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>
2015-11-18 14:46:35 +01:00
Michael Niedermayer
28b7d7a36d Merge commit 'b8d2630c5327d2818d05c8a48be0417905d8e0fd'
* commit 'b8d2630c5327d2818d05c8a48be0417905d8e0fd':
  dashenc: Reduce the segment duration if cutting out parts with edit lists

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-11 01:56:11 +02:00
James Almer
32a4177a62 dashenc: replace attribute id with contentType for the AdaptationSet element
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>
2015-05-11 01:37:39 +02:00
Martin Storsjö
b8d2630c53 dashenc: Reduce the segment duration if cutting out parts with edit lists
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>
2015-05-10 22:57:21 +03:00
James Almer
ac1a1cb948 dashenc: replace attribute id with contentType for the AdaptationSet element
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>
2015-05-10 22:57:20 +03:00
Michael Niedermayer
5a14fca9aa Merge commit '2cc3936599b6fc63143036659653d1be0624360f'
* commit '2cc3936599b6fc63143036659653d1be0624360f':
  dashenc: Add a publishTime field in dynamic manifests

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-20 21:45:56 +02:00
Martin Storsjö
2cc3936599 dashenc: Add a publishTime field in dynamic manifests
This field is mandatory in dynamic manifests.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-04-20 13:16:45 +03:00
Michael Niedermayer
09585e377c Merge commit '3041183677bda0a431b36e96a2c76617abaa8183'
* commit '3041183677bda0a431b36e96a2c76617abaa8183':
  dashenc: Heuristically fill in the duration of packets that need it

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-19 12:18:05 +01:00
Martin Storsjö
3041183677 dashenc: Heuristically fill in the duration of packets that need it
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>
2015-03-19 10:27:03 +02:00
Timo Rothenpieler
5aef535a64 dashenc: Update extradata for mov muxer
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>
2015-03-06 10:07:17 +02:00
Timo Rothenpieler
6cf7f30655 dashenc: Simplify code by using a local variable
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-03-06 10:07:11 +02:00
Timo Rothenpieler
f5668e614b avformat/dashenc: Update extradata for mov muxer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-05 10:33:03 +01:00
Timo Rothenpieler
6cfd536675 avformat/dashenc: Update codec_str on extradata_size change
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-02 21:40:26 +01:00
Timo Rothenpieler
b86af8da31 avformat/dashenc: Use local variable instead of duplicated dereferences
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-02 21:40:26 +01:00
Martin Storsjö
33d412eb4a dashenc: Simplify code by using a local variable
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-03-02 20:34:43 +02:00
Michael Niedermayer
7f03f75ce7 Merge commit '8e32b1f0963d01d4f5d4803eb721f162e0d58d9a'
* commit '8e32b1f0963d01d4f5d4803eb721f162e0d58d9a':
  libavformat: Use ffio_free_dyn_buf where applicable

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-25 00:48:50 +01:00
Martin Storsjö
8e32b1f096 libavformat: Use ffio_free_dyn_buf where applicable
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-24 23:07:47 +02:00
Michael Niedermayer
b7f8e6dd8c Merge commit '3a724a7f3ba7fa766c6a6f0924a15cc742031b8d'
* commit '3a724a7f3ba7fa766c6a6f0924a15cc742031b8d':
  dashenc: Use inttypes.h macros for format strings instead of %lld

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-22 12:06:47 +01:00
Rodger Combs
89684883af avformat/dashenc: fix format string generation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-22 11:55:21 +01:00
Martin Storsjö
3a724a7f3b dashenc: Use inttypes.h macros for format strings instead of %lld
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-22 08:49:41 +02:00
Rodger Combs
1d8aa23794 dashenc: Fix format string generation
Previously this always used the "lld" format for all parameters,
not only time parameters.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-22 08:49:39 +02:00
Michael Niedermayer
fb22e5ae45 Merge commit '46808fdf04ab113df374157b90b506eb3110daf2'
* commit '46808fdf04ab113df374157b90b506eb3110daf2':
  movenc: Enable editlists by default if delay_moov is enabled

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-05 02:45:34 +01:00
Martin Storsjö
46808fdf04 movenc: Enable editlists by default if delay_moov is enabled
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>
2015-01-04 20:04:36 +02:00
Michael Niedermayer
3be67f33a5 Merge commit '7a1a63e34fa46af18311c2493fdaec9a93bdb750'
* commit '7a1a63e34fa46af18311c2493fdaec9a93bdb750':
  dashenc: Use pts for MPD timeline timestamps

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-03 04:26:20 +01:00
Michael Niedermayer
983778f1f6 Merge commit 'c5e7ea13d2d4da0c5da91973a547afff6fe9e011'
* commit 'c5e7ea13d2d4da0c5da91973a547afff6fe9e011':
  dashenc: Use delay_moov

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-03 04:08:09 +01:00
Martin Storsjö
7a1a63e34f dashenc: Use pts for MPD timeline timestamps
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>
2015-01-03 01:22:09 +02:00
Martin Storsjö
c5e7ea13d2 dashenc: Use delay_moov
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-03 01:20:55 +02:00
Michael Niedermayer
0ffb61e8ca Merge commit '8d54bacb789c7d37ca3cf48d9ac13083ad0c1ba7'
* commit '8d54bacb789c7d37ca3cf48d9ac13083ad0c1ba7':
  dashenc: Remove some stray double spaces

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-30 01:57:21 +01:00
Michael Niedermayer
e5a3766767 Merge commit 'b91a5757fcbf723da99b05b298a6f820271dbc2b'
* commit 'b91a5757fcbf723da99b05b298a6f820271dbc2b':
  dashenc: Fix writing of timelines that don't start at t=0

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-30 01:50:53 +01:00
Martin Storsjö
8d54bacb78 dashenc: Remove some stray double spaces
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-12-29 23:26:43 +02:00
Martin Storsjö
b91a5757fc dashenc: Fix writing of timelines that don't start at t=0
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>
2014-12-29 23:26:25 +02:00
Michael Niedermayer
973684a4fb Merge commit '456e93bfdd4cbc5e995dea415019abd0703d0e16'
* commit '456e93bfdd4cbc5e995dea415019abd0703d0e16':
  dashenc: Adjust the start time of a segment to the end of the previous segment

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-17 12:05:00 +01:00
Michael Niedermayer
b32cb08b7f Merge commit '2f628d5943c12389c07d652d23d3916997f9f0f6'
* commit '2f628d5943c12389c07d652d23d3916997f9f0f6':
  dashenc: Write segment timelines properly if the timeline has gaps

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-17 11:57:09 +01:00
Martin Storsjö
456e93bfdd dashenc: Adjust the start time of a segment to the end of the previous segment
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>
2014-12-17 09:43:08 +02:00
Martin Storsjö
2f628d5943 dashenc: Write segment timelines properly if the timeline has gaps
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>
2014-12-17 09:42:30 +02:00
Michael Niedermayer
7ee5f764ee Merge commit 'e737a4aaafcb1d761b7f96043c2f83ce742c64ae'
* commit 'e737a4aaafcb1d761b7f96043c2f83ce742c64ae':
  dashenc: Change the duration fields to 64 bit

Conflicts:
	libavformat/dashenc.c

See: e65849a70b
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-11 02:03:47 +01:00
Martin Storsjö
e737a4aaaf dashenc: Change the duration fields to 64 bit
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>
2014-12-10 22:51:51 +02:00
Michael Niedermayer
1397cb002d Merge commit 'fa8934d6d6a0bb290010bdf16265c40b331d56fb'
* commit 'fa8934d6d6a0bb290010bdf16265c40b331d56fb':
  dashenc: log file output progress in verbose mode

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-10 01:24:56 +01:00
Bryan Huh
fa8934d6d6 dashenc: log file output progress in verbose mode
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>
2014-12-10 00:03:16 +02:00
Michael Niedermayer
e65849a70b avformat/dashenc: make durations 64bit
Fix potential integer overflow
Fix CID1254944

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-07 20:07:26 +01:00
Michael Niedermayer
f001a2bd34 Merge commit 'fcae9f212a6001d966c52dc22cd4b22e9851b428'
* commit 'fcae9f212a6001d966c52dc22cd4b22e9851b428':
  dashenc: Avoid a VLA-like construct

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-28 12:52:13 +01:00
Michael Niedermayer
5ce070c16c Merge commit 'a9d8d35e4833fc4dfbf557ce73c84e9ca6224427'
* commit 'a9d8d35e4833fc4dfbf557ce73c84e9ca6224427':
  dashenc: Add options to make segment names configurable

Conflicts:
	libavformat/dashenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-28 12:50:38 +01:00
Martin Storsjö
fcae9f212a dashenc: Avoid a VLA-like construct
This fixes the build on compilers that interpreted the earlier
code as a variable length array (which we intentionally disallow).

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-28 11:55:42 +02:00