Commit Graph

54 Commits

Author SHA1 Message Date
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
Bryan Huh a9d8d35e48 dashenc: Add options to make segment names configurable
This allows one to specify templated segment names for init-segments,
media-segments, and for the base-url in the case of single-file.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-28 10:48:15 +02:00
Michael Niedermayer 4ae1d6021b Merge commit '675ac56b7ee0f204963fde55295197c5df80aa91'
* commit '675ac56b7ee0f204963fde55295197c5df80aa91':
  Revert "lavf: Don't try to update files atomically with renames on windows"

Conflicts:
	libavformat/dashenc.c
	libavformat/hdsenc.c
	libavformat/internal.h
	libavformat/smoothstreamingenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-27 11:52:33 +01:00
Martin Storsjö 675ac56b7e Revert "lavf: Don't try to update files atomically with renames on windows"
This reverts commit b9d08c77a4.

After taking MoveFileEx into use, we can replace files with renames
on windows as well.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-27 09:29:47 +02:00
Michael Niedermayer 71ecfcf2d3 Merge commit 'b9d08c77a44390b0848c06f20bc0e9e951ba6a3c'
* commit 'b9d08c77a44390b0848c06f20bc0e9e951ba6a3c':
  lavf: Don't try to update files atomically with renames on windows

Conflicts:
	libavformat/dashenc.c
	libavformat/hdsenc.c
	libavformat/internal.h
	libavformat/smoothstreamingenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-25 02:14:15 +01:00
Martin Storsjö b9d08c77a4 lavf: Don't try to update files atomically with renames on windows
On windows, rename(2) will fail if the target file exists. On
unix this trick is used to make sure that people reading the file
either will get the full previous file, or the full new version
of the file, but no intermediate version.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-24 23:34:44 +02:00
Michael Niedermayer 9a57309665 Merge commit 'fe42f94ce1023f9c2f7e86404c60afcee5b078a9'
* commit 'fe42f94ce1023f9c2f7e86404c60afcee5b078a9':
  dashenc: Don't segment all video streams when one stream gets a keyframe

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-24 14:07:35 +01:00
Martin Storsjö fe42f94ce1 dashenc: Don't segment all video streams when one stream gets a keyframe
This makes sure that segments actually start at a keyframe (and
makes sure we don't split segments twice in a row, with one segment
consisting of only a handful of packets), when one stream uses b-frames
while another one doesn't.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-24 11:09:40 +02:00
Michael Niedermayer 9f0fd17c61 Merge commit 'f856d9c2f314c493c672dfb9c876da182525da3d'
* commit 'f856d9c2f314c493c672dfb9c876da182525da3d':
  dashenc: Don't require the stream bitrate to be known

Conflicts:
	libavformat/dashenc.c

See: 5f8fcdd448
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-23 01:34:05 +01:00