Commit Graph

10922 Commits

Author SHA1 Message Date
Diego Biurrun
d4c2103bd3 golomb: Convert to the new bitstream reader 2017-01-31 17:46:19 +01:00
Mark Thompson
708e84cda1 mov: Avoid memcmp of uninitialised data
The string codec name need not be as long as the value we are
comparing it to, so memcmp may make decisions derived from
uninitialised data that valgrind then complains about (though the
overall result of the function will always be the same).  Use
strncmp instead, which will stop at the first zero byte and
therefore not encounter this issue.
2017-01-30 23:03:52 +00:00
Peter Große
7295b73738 dashenc: add webm support
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>
2017-01-31 00:45:27 +02:00
Peter Große
01f1f017d8 dashenc: use avio_dynbuf instead of packet_write callback
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>
2017-01-31 00:38:29 +02:00
Peter Große
dce2929efa dashenc: copy language and role metadata from streams assigned to sets
Signed-off-by: Peter Große <pegro@friiks.de>
Signed-off-by: Martin Storsjö <martin@martin.st>
2017-01-31 00:38:28 +02:00
Peter Große
ca9bc9de69 dashenc: default to one AdaptationSet per stream
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>
2017-01-31 00:33:07 +02:00
Peter Große
efd2fc41b3 dashenc: allow assigning all streams of a media type to an AdaptationSet
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>
2017-01-31 00:24:14 +02:00
Peter Große
3d23a5f96a dashenc: add support for assigning streams to AdaptationSets
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>
2017-01-31 00:22:00 +02:00
Peter Große
9df9309d23 dashenc: calculate stream bitrate from first segment if not available
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>
2017-01-31 00:08:21 +02:00
Peter Große
e519dcd937 dashenc: separate segments based on current segment duration
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>
2017-01-31 00:08:21 +02:00
Peter Große
1920382aa9 dashenc: add option to provide UTC timing source
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>
2017-01-31 00:08:09 +02:00
Luca Barbato
11e225db31 rtmp: Account for bytes_read wraparound
Servers seem to be happy to receive the wrapped-around value as long
as they receive a report, otherwise they timeout.

Initially reported and analyzed by Thomas Bernhard.
2017-01-29 18:10:44 +01:00
Anton Schubert
3c2717e48d dashenc: increase buffer time hint in the manifest
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>
2017-01-27 14:34:17 +02:00
Peter Große
95f1004bdf dashenc: add mandatory id to AdaptationSet and Period in manifest
Signed-off-by: Peter Große <pegro@friiks.de>
Signed-off-by: Martin Storsjö <martin@martin.st>
2017-01-27 14:27:40 +02:00
Anton Schubert
1ae6cb7d6e dashenc: fix ISO8601 UTC parsing
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>
2017-01-27 14:07:30 +02:00
Alexandra Hájková
381a4e31a6 tak: Convert to the new bitstream reader 2017-01-25 11:06:58 +01:00
Alexandra Hájková
6668bc80b5 mpc: Convert to the new bitstream reader 2017-01-25 09:55:33 +01:00
Alexandra Hájková
b1e7394ea0 rtp: Convert to the new bitstream reader 2017-01-13 10:27:03 +01:00
Alexandra Hájková
a895292f27 mov: Convert to the new bitstream reader 2017-01-13 10:27:03 +01:00
Anton Khirnov
9026ec8aaf matroskadec: make sure not to leave EbmlBin in an inconsistent state
If a read fails, the current code will free the data but leave the size
non-zero. Make sure the size is zeroed in such a case.

CC: libav-stable@libav.org
Bug-Id: 1001
Found-By: Kamil Frankowicz
Signed-off-by: Sean McGovern <gseanmcg@gmail.com>
2017-01-04 20:05:44 -05:00
John Stebbins
0982152c3f matroskadec: fix SRT subtitle duration
The codec id for SRT was changed and conditionals were not updated.
2016-12-24 08:33:17 -08:00
Martin Storsjö
1316446779 http: Check for negative chunk sizes
A negative chunk size is illegal and would end up used as
length for memcpy, where it would lead to memory accesses
out of bounds.

Found-by: Paul Cher <paulcher@icloud.com>

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-12-23 21:28:05 +02:00
Diego Biurrun
0b77a59336 Use correct printf conversion specifiers for POSIX integer types 2016-12-23 19:30:00 +01:00
Diego Biurrun
92db508307 build: Generate pkg-config files from Make and not from configure
This moves work from the configure to the Make stage where it can
be parallelized and ensures that pkgconfig files are updated when
library versions change.

Bug-Id: 449
2016-12-22 12:30:54 +01:00
Alexandra Hájková
fa64aea12e unary: Convert to the new bitstream reader 2016-12-19 12:35:05 +01:00
Anton Khirnov
46191a2da1 mov: fix a possible invalid read in mov_read_mac_string()
When the input string is too large, so the second condition in if ()
fails, the code will erroneously execute the else branch, indexing the
mac_to_unicode table with a negative index.

CC: libav-stable@libav.org
Bug-Id: 1000
Found-By: Kamil Frankowicz
2016-12-19 08:14:59 +01:00
Michael Niedermayer
a4fec9a7ea rtmppkt: Check for packet size mismatches
When receiving fragmented packets, the first packet declares the size,
and the later ones normally are small follow-on packets that don't repeat
the size and the other header fields. But technically, the later fragments
also can have a full header, declaring a different size than the previous
packet.

If the follow-on packet declares a larger size than the initial one, we
could end up writing outside of the allocation.

This fixes out of bounds writes.

Found-by: Paul Cher <paulcher@icloud.com>
Reviewed-by: Paul Cher <paulcher@icloud.com>

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-12-15 15:45:59 +02:00
Martin Storsjö
cdcfa97dc4 libavformat: Fix a faulty api deprecation guard in prepare_input_packet
This seems to have been added by mistake in 11de006b, by not
noticing the negation for the existing condition. This block does
not contain any code that accesses the codec field in AVStream.

This function is meant to serve as a complement to compute_pkt_fields2,
which is guarded by FF_API_COMPUTE_PKT_FIELDS2 && FF_API_LAVF_AVCTX.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-12-15 12:01:48 +02:00
Luca Barbato
3f75e5116b avio: Keep track of the amount of data written
Make avio_size() work with any write AVIOContext.
2016-12-08 15:58:28 -05:00
Diego Biurrun
f912fd767e Add missing #includes for standalone spherical-information-related headers 2016-12-08 20:12:23 +01:00
Vittorio Giovara
e90137c045 mov: Export spherical information
This implements Spherical Video V1 and V2, as described in the
spatial-media collection by Google.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-12-07 14:35:06 -05:00
Vittorio Giovara
2fb6acd9c2 lavc: Add spherical packet side data API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-12-07 14:34:34 -05:00
Diego Biurrun
9265364bec build: Separate avisynth and avxsynth support
This simplifies the code.
2016-12-06 17:49:05 +01:00
Diego Biurrun
3794062ab1 Remove Plan 9 support
Supporting the system was a nice joke for the 9 release, but it has
run its course. Nowadays Plan 9 receives no testing and has no
practical usefulness.
2016-12-03 09:15:01 +01:00
Diego Biurrun
239d02eff3 avisynth: Cast to the right type when loading avisynth library functions
Fixes a number of related warnings.
2016-11-29 13:13:35 +01:00
Diego Biurrun
e122b12c88 build: Drop gcrypt support
GnuTLS in combination with gcrypt has been deprecated since 2010.
2016-11-25 18:46:53 +01:00
Martin Storsjö
537b5b773b rtmpdh: Do global initialization before running the test
The rtmpdh code can use crypto libraries which may require
a process global init. (gcrypt is one of the libraries
where the rtmpdh test code can fail if global init hasn't been
done, depending on gcrypt version.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-11-24 13:59:17 +02:00
Alexandra Hájková
2dbe2aa2c2 rdt: Convert to the new bitstream reader 2016-11-24 11:22:13 +01:00
Alexandra Hájková
2cef81a87c ogg: Convert to the new bitstream reader 2016-11-24 11:22:13 +01:00
Alexandra Hájková
8d1997add6 mpegts: Convert to the new bitstream reader 2016-11-24 11:22:13 +01:00
James Almer
12ab667e21 matroska: use av_stream_add_side_data() for stereo3d side data
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-11-23 10:37:46 -05:00
James Almer
1893495e1d mov: Use av_stream_add_side_data() for displaymatrix side data
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-11-23 10:37:36 -05:00
James Almer
79ff9935ae utils: Add av_stream_add_side_data()
Functionally similar to av_packet_add_side_data(). Allows the use of an
already allocated buffer as stream side data.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-11-23 10:36:13 -05:00
Diego Biurrun
5eef983297 ape: Restructure DEBUG ifdefs to avoid unused function parameter warnings 2016-11-22 17:28:16 +01:00
Diego Biurrun
97cd7a3dc0 rtpdec_mpeg4: const correctness for parse_fmtp_config()
libavformat/rtpdec_mpeg4.c:282:38: warning: passing argument 2 of ‘parse_fmtp_config’ discards ‘const’ qualifier from pointer target type
2016-11-21 14:54:03 +01:00
Luca Barbato
3c7fa8cbb9 hlsenc: Fix the openssl support 2016-11-18 11:18:58 +01:00
Luca Barbato
0a4b9d0ccd hlsenc: Add encryption support
Partially based on Christian Suloway <csuloway@globaleagleent.com> work.
2016-11-17 19:19:55 +01:00
Christian Suloway
d860a3cc0a crypto: Add encryption support
Signed-off-by: Christian Suloway <csuloway@globaleagleent.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-11-17 19:19:55 +01:00
Stephen Hutchinson
3cc3463f30 avisynth: Support pix_fmts added to AviSynth+
A number of new pix_fmts* have been added to AviSynth+:
16-bit packed RGB and RGBA
10-, 12-, 14, and 16-bit YUV 4:2:0, 4:2:2, and 4:4:4
8-, 10-, 12-, 14-, and 16-bit Planar RGB
8-, 10-, 12-, 14-, and 16-bit Planar YUVA and Planar RGBA
10-, 12-, 14-, and 16-bit GRAY variants
32-bit floating point Planar YUV(A), Planar RGB(A), and GRAY

*some of which are not currently available pix_fmts here and were
 not added to the demuxer due to this

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-11-17 09:44:12 +01:00
Stephen Hutchinson
aaae59700f avisynth: Simplify the pix_fmt check for the newer AviSynth API
The values don't need to be hardcoded since the correct values are
returned by avs_bits_per_pixel.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-11-17 09:21:24 +01:00