Commit Graph

16540 Commits

Author SHA1 Message Date
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
Michael Niedermayer
b0ba8a23b6 Merge commit 'b3b0b35db2f3b61bf2f0f4fa85f5b6267d83c8fe'
* commit 'b3b0b35db2f3b61bf2f0f4fa85f5b6267d83c8fe':
  movenc: Get rid of a hack for updating the dvc1 atom

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-03 04:01:34 +01:00
Michael Niedermayer
f38e2bcb72 Merge commit '847bf5988fec1d3e65c1d8cf0cdb8caf0cfd0c1b'
* commit '847bf5988fec1d3e65c1d8cf0cdb8caf0cfd0c1b':
  movenc: Add an option for delaying writing the moov with empty_moov

Conflicts:
	libavformat/movenc.c
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-03 03:13:16 +01:00
Michael Niedermayer
504267fb56 avformat/movenc: Use cluster timestamps when available in edts
Also print both if they differ

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-03 02:47:35 +01:00
Michael Niedermayer
0506f687e8 Merge commit 'c725faebda9a516766d94c33b07972ab0f70cf93'
* commit 'c725faebda9a516766d94c33b07972ab0f70cf93':
  movenc: Use start_dts/cts instead of cluster[0] for writing edit lists

Conflicts:
	libavformat/movenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-03 01:38:58 +01:00
Michael Niedermayer
68a06a244c Merge commit '724cbea7193945fe5a5b4dea8ede344803572844'
* commit '724cbea7193945fe5a5b4dea8ede344803572844':
  movenc: Remove an unnecessary condition when flushing fragments

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-03 01:25:30 +01:00
Michael Niedermayer
7ca10d10aa Merge commit '355d01a1bf55297b1d1f04e4bfbf0ddc93b6247e'
* commit '355d01a1bf55297b1d1f04e4bfbf0ddc93b6247e':
  movenc: Factorize writing ftyp and other identification tags to a separate function

Conflicts:
	libavformat/movenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-03 01:18:54 +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
Martin Storsjö
b3b0b35db2 movenc: Get rid of a hack for updating the dvc1 atom
Use the more generic approach with the delay_moov flag, instead of
having a update mechanism specific to this one single atom.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-03 01:20:40 +02:00
Martin Storsjö
847bf5988f movenc: Add an option for delaying writing the moov with empty_moov
This delays writing the moov until the first fragment is written,
or can be flushed by the caller explicitly when wanted. If the first
sample in all streams is available at this point, we can write
a proper editlist at this point, allowing streams to start at
something else than dts=0. For AC3 and DNXHD, a packet is
needed in order to write the moov header properly.

This isn't added to the normal behaviour for empty_moov, since
the behaviour that ftyp+moov is written during avformat_write_header
would be changed. Callers that split the output stream into header+segments
(either by flushing manually, with the custom_frag flag set, or by
just differentiating between data written during avformat_write_header
and the rest) will need to be adjusted to take this option into use.

For handling streams that start at something else than dts=0, an
alternative would be to use different kinds of heuristics for
guessing the start dts (using AVCodecContext delay or has_b_frames
together with the frame rate), but this is not reliable and doesn't
necessarily work well with stream copy, and wouldn't work for getting
the right initialization data for AC3 or DNXHD either.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-03 01:19:27 +02:00
Martin Storsjö
c725faebda movenc: Use start_dts/cts instead of cluster[0] for writing edit lists
This allows writing edit lists even when track->entry == 0, if
the start times have been set.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-03 01:18:52 +02:00
Martin Storsjö
724cbea719 movenc: Remove an unnecessary condition when flushing fragments
If fragments == 0 it means we haven't written any moov atom yet.
If the empty_moov flag is set, we already have written an empty moov
atom at startup. Thus, the check for empty_moov is redundant.

This is in preparation for allowing writing the moov atom later,
even when using the empty moov flag.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-03 01:18:38 +02:00
Martin Storsjö
355d01a1bf movenc: Factorize writing ftyp and other identification tags to a separate function
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-03 01:18:28 +02:00
Clément Bœsch
11201bbf7f avformat/mov: reindent after previous commit 2015-01-02 11:38:28 +01:00
Clément Bœsch
55faf56c72 avformat/mov: move edit list heuristics into mov_build_index()
mov_read_elst() is now only responsible from storing the table in a data
structure; this is consistent with other table readers functions.
2015-01-02 11:38:21 +01:00
Clément Bœsch
6a29499b95 avformat/flvdec: remove duplicated line error
Fix typo regression since 5c37ffca59

Found-By: cousin_luigi
2015-01-01 22:09:21 +01:00
Michael Niedermayer
efc4bfc195 avformat/flvdec: use named identifier instead of literal numbers as return values
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-01 20:19:09 +01:00
Michael Niedermayer
eb767a276b avformat/flvdec: Increase string array size
Fixes parsing httphostheader of Scarlatti\,\ Pieter-Jan\ Belder\ -\ Sonata\ K113\ in\ A\ major\ -\ Alle.flv

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-01 18:16:04 +01:00
Michael Niedermayer
322f0f5960 avformat/flvdec: do not inject dts=0 metadata packets which failed to be parsed into a new data stream
Such data streams (which then contain no other packets except the faulty one)
confuse some user applications, like VLC
Works around vlcticket 12389

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-01 18:13:22 +01:00
Michael Niedermayer
5c37ffca59 avformat/flvdec: add several error messages to error conditions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-01 18:03:54 +01:00
Michael Niedermayer
3eb5cbe0c5 avformat/cdxl: Fix integer overflow of image_size
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-31 22:33:51 +01: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
256df8a2fa libavformat/cdxl: fix duration in case of overflow
Fixes integer overflow
Fixes CID1260706

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-29 20:53:56 +01:00
Michael Niedermayer
ac08c5c0ad avformat/mux: 2 subtitle packets could have the same DTS
Fixes Ticket3514

See: ETSI EN 300 743 V1.3.1 (2006-11)
"In summary, all of the segments of a single display set shall be carried in one (or more) PES packets that have the same
 PTS value."
with PTS = DTS and remuxing of such a stream it is to be expected that sometimes
multiple packets would have the same DTS

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-29 03:57:44 +01:00
Pedro E. M. Brito
202947a066 libavformat/segment.c: Add strftime expansion for segment filename templates
Allows expansion of the filename template with strftime() with the option
-strftime 1 (disabled by default). This allows segments to be named by time of
creation, adding some flexibility.

Fixes Ticket 4104 (add strftime to segment muxer)

Signed-off-by: Pedro E. M. Brito <pedroembrito@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-28 21:48:44 +01:00
Michael Niedermayer
f7da4b1cf1 avformat/rtsp: Use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-26 14:59:29 +01:00
Michael Niedermayer
0704c44d68 avformat/cache: remove ftruncate usage, its not always available
In case of errors the cache file will be slightly larger than needed,
this should have no practical relevance though

Should fix build on VS201*

Found-by: jamrial
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-26 12:41:15 +01:00
Michael Niedermayer
7c210c4424 avformat/cache: Extend cache entries if possible instead of creating new ones
This reduces the number of cache entries and should significantly
reduce memory requirements

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-26 02:21:51 +01:00
Michael Niedermayer
312151bb9a avformat/cache: avoid lseek() on reading from the cache if possible
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-26 01:24:27 +01:00
Michael Niedermayer
ce3551896a avformat/cache: keep cache_pos updated
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-26 01:22:52 +01:00
Michael Niedermayer
954fc854f2 avformat/cache: cleanup cache file on cache write failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-26 01:13:49 +01:00
Michael Niedermayer
8706910c4c avformat/cache: Support user specified read-ahead for non seekable media
Fixes Ticket2406

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-25 22:09:24 +01:00
Michael Niedermayer
7018d3d351 avformat/cache: Use the correct io handle in seeking
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-25 22:07:32 +01:00
Michael Niedermayer
dedd3c89ae avformat/cache: more informative error message
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-25 22:07:32 +01:00
Michael Niedermayer
681559d3ff avformat/cache: remember EOF point if hit and use it to handle SEEK_END
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-25 22:07:23 +01:00
Michael Niedermayer
0c0168a210 avformat/cache: support non continuous caching
This allows using the cache protocol on top of seekable but slow protocols to
speed them up

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-25 19:20:55 +01:00
Michael Niedermayer
7dce91368f avformat/smoothstreamingenc: Use av_freep() avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-25 12:51:48 +01:00
Michael Niedermayer
443bd2715d avformat/wtvdec: Use av_freep() avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-25 12:51:48 +01:00
Michael Niedermayer
68fa549230 avformat/segment: Use av_freep() avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-25 12:51:48 +01:00
Michael Niedermayer
96dce6f7ce avformat/seek: move the cur variable into the loop
This improves readability and makes it clear that the freed
value is not used after the end of an iteration

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-24 13:14:07 +01:00
Michael Niedermayer
3f56224a9a avformat/rtpdec_mpeg4: Use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-24 13:14:07 +01:00
Michael Niedermayer
ef05af82b2 avformat/rtpproto: Use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-24 13:14:07 +01:00
Michael Niedermayer
82d1abc44c avformat/seek: use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-24 13:14:07 +01:00
Michael Niedermayer
e01467241f avformat/aea: reduce false positives in probing
Fixes probetest failure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-23 18:41:53 +01:00
Michael Niedermayer
0d7a14e236 avformat/avidec: optimize probe
about 2x as fast

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-23 16:32:26 +01:00