Commit Graph

20161 Commits

Author SHA1 Message Date
Carl Eugen Hoyos
9d494c5e55 lavf/rawenc: Add little- and big-endian G.726 muxers. 2017-08-26 11:43:09 +02:00
Carl Eugen Hoyos
f61e2dcfc3 lavf/g726: Demuxer for raw G.726 streams, both left- and right-justified.
Compatible with the binary encoder attached to ticket #6596 (right-aligned)
and a sample from a SEG Mp3-Player (left-aligned).
2017-08-24 12:55:46 +02:00
Dale Curtis
37e8edc9f5 avformat/mov: Fix trampling of ctts during seeks when sidx support is enabled.
When sidx box support is enabled, the code will skip reading all
trun boxes (each containing ctts entries for samples inthat box).

If seeks are attempted before all ctts values are known, the old
code would dump ctts entries into the wrong location. These are
then used to compute pts values which leads to out of order and
incorrectly timestamped packets.

This patch fixes ctts processing by always using the index returned
by av_add_index_entry() as the ctts_data index. When the index gains
new entries old values are reshuffled as appropriate.

This approach makes sense since the mov demuxer is already relying
on the mapping of AVIndex entries to samples for correct demuxing.

As a result of this all ctts entries are now 1-count. A followup
change will be submitted to remove support for > 1 count entries
which will simplify seeking.

Notes for future improvement:
Probably there are other boxes (stts, stsc, etc) that are impacted
by this issue... this patch only attempts to fix ctts since it
completely breaks packet timestamping.

This patch continues using an array for the ctts data, which is not
the most ideal given the rearrangement that needs to happen (via
memmove as new entries are read in). Ideally AVIndex and the ctts
data would be set-type structures so addition is always worst case
O(lg(n)) instead of the O(n^2) that exists now; this slowdown is
noticeable during seeks.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-24 11:02:22 +02:00
Michael Niedermayer
c42a1388a6 avformat/rtpdec_h264: Fix heap-buffer-overflow
Fixes: rtp_sdp/poc.sdp

Found-by: Bingchang <l.bing.chang.bc@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-23 22:19:33 +02:00
Vitaly Buka
eca2a49716 avformat/aviobuf: Fix signed integer overflow in avio_seek()
Signed integer overflow is undefined behavior.
Detected with clang and -fsanitize=signed-integer-overflow

Signed-off-by: Vitaly Buka <vitalybuka@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-23 03:17:11 +02:00
Vitaly Buka
4a404cb5b9 avformat/mov: Fix signed integer overflows with total_size
Signed integer overflow is undefined behavior.
Detected with clang and -fsanitize=signed-integer-overflow

Signed-off-by: Vitaly Buka <vitalybuka@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-23 03:17:11 +02:00
Steven Liu
20a6b198b4 avformat/hlsenc: move free fmp4_init_filename after hls_window operation
fix ticket id: 6599

Signed-off-by: Steven Liu <lq@onvideo.cn>
2017-08-22 10:21:42 +08:00
bnnm
e7053f3316 lavf/bink: fix latest header and add all existing revisions
KB2 'i' found in Life is Strange (Xbox 360), rest verified against binkconv.exe

Signed-off-by: bnnm <bananaman255@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-20 11:33:51 +02:00
Jacob Trimble
f4544163b2 libavformat/mov: Fix inserting frames before current_frame.
When using streaming input, it may be possible to see frames that appear
before the current_frame.  When these frames are inserted into the
index, the current_frame needs to be updated so it is still pointing
at the same frame.

Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-18 03:02:11 +02:00
Marton Balint
7160992431 avformat/utils: always av_reduce r_frame_rate
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2017-08-17 21:02:40 +02:00
Nikolas Bowe
4b54d5a721 avformat/mov: Fix memory leak when reading DDTS box.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-16 03:35:13 +02:00
Michael Niedermayer
511e10f673 avformat/avidec: Move packet skip after prefix and related checks
This fixes loosing packets
Fixes: big.avi

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-11 12:07:08 +02:00
James Almer
c100330a8f avformat/movenc: reindent after the previous commit 2017-08-09 23:15:38 -03:00
Sasi Inguva
e7e1fbc49b lavf/movenc.c: Set sgpd and sbgp atoms to represent decoder delay for AAC.
According to https://developer.apple.com/library/content/documentation/QuickTime/QTFF/QTFFAppenG/QTFFAppenG.html and ISO-IEC-14496-12 Section 10.1.1.1 and 10.1.1.3

Signed-off-by: Sasi Inguva <isasi@google.com>
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-10 02:43:53 +02:00
DeHackEd
eabeb9093a avformat/hlsenc: allow dynamic encryption key rotation
Makes behaviour of 805ce25b1d optional, re-enables
HLS key rotation feature

Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: DHE <git@dehacked.net>
2017-08-06 15:10:35 +08:00
Steven Siloti
949debd1d1 avformat/utils: fix memory leak in avformat_free_context
The pointer to the packet queue is stored in the internal structure
so the queue needs to be flushed before internal is freed.

Signed-off-by: Steven Siloti <ssiloti@bittorrent.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-05 23:24:02 +02:00
Steven Liu
738b29cfb6 avformat/hlsenc: support fmp4 single file mode
add byterange mode of the hls fmp4

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Steven Liu <lq@onvideo.cn>
2017-08-04 21:38:55 +08:00
Aleksandr Slobodeniuk
50aeb6e4ed avformat/riff: remove useless tag correlation 'mpg2'->MPEG1VIDEO.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-02 15:26:35 +02:00
Aleksandr Slobodeniuk
0aa8fa963f avformat/riff.h : remove unused function parameter "const AVCodecTag *tags" of "void ff_put_bmp_header()"
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-02 15:26:25 +02:00
Matt Oliver
6cc677c0e8 lavf/os_support: Use existing WinRT config value.
Signed-off-by: Matt Oliver <protogonoi@gmail.com>
2017-07-30 14:31:04 +10:00
Michael Niedermayer
ffcc82219c avformat/rtmppkt: Convert ff_amf_get_field_value() to bytestream2
Fixes: out of array accesses

Found-by: JunDong Xie of Ant-financial Light-Year Security Lab
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-07-29 04:05:53 +02:00
Michael Niedermayer
08c073434e avformat/rtmppkt: Convert ff_amf_tag_size() to bytestream2
Fixes: out of array accesses
Fixes: crash-9238fa9e8d4fde3beda1f279626f53812cb001cb-SEGV

Found-by: JunDong Xie of Ant-financial Light-Year Security Lab
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-07-29 03:54:39 +02:00
foo86
6029b8a6bb avformat/s337m: fix potentially undefined pointer arithmetic
Use integer position instead of pointer for loop variable. Also only
skip header fields after header has been fully validated.
2017-07-26 21:23:07 +03:00
Michael Niedermayer
7140761481 avformat/oggparsecelt: Do not re-allocate os->private
Fixes: double free
Fixes: clusterfuzz-testcase-minimized-5080550145785856

Found-by: ClusterFuzz
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-07-25 22:04:34 +02:00
Steven Liu
805ce25b1d avformat/hlsenc: improve hls encrypt get key file operation
get key file only once time is ok, no need more times.
Ticket-id: #6545

Found-by: JohnPi
Signed-off-by: Steven Liu <lq@onvideo.cn>
2017-07-25 10:31:29 +08:00
Clément Bœsch
850a45aef1 lavf/movenc: support GPMF track (gpmd) remuxing
See https://github.com/gopro/gpmf-parser for more information on the
data stream itself.
2017-07-24 14:43:40 +02:00
Steven Liu
f21457f8e0 avformat/hlsenc: fix hls fmp4 extention name bug
ticket-id: #6541
when use hls fmp4 muxer, the extention name is not .m4s, this
code can fix it.

Found-by: JohnPi
Signed-off-by: Steven Liu <lq@onvideo.cn>
2017-07-24 19:55:19 +08:00
James Almer
7c9d2ad45f avcodec/dca: remove GetBitContext usage from avpriv_dca_parse_core_frame_header()
This prevents potential ABI issues with GetBitContext.

Reviewed-by: foo86 <foobaz86@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-07-21 12:18:10 -03:00
foo86
f04ef26816 avformat: add SMPTE 337M demuxer 2017-07-19 12:27:33 +02:00
Jan Sebechlebsky
5c9dcd5c48 libavformat/fifo: Fix initialization of underlying AVFormatContext
Muxers may want to directly access filename in stored in
AVFormatContext. For example in case of RTSP, the filename (url)
is used by the muxer to extract parameters of the connection.
These muxers will fail when used with fifo pseudo-muxer.

This commit fixes this issue by passing filename from AVFormatContext
of fifo pseudo-muxer to all AVFormatContext(s) of underlying muxers
during initialization.

Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
2017-07-19 10:08:19 +02:00
foo86
3b7ec920af avformat/dtsdec: switch to common frame header parsing function
This makes probing for regular DTS more strict because more header
fields are checked and values not supported by decoder are now rejected.

Also fixes an issue original code had with 14-bit streams: 96 bits of
header were expected, however only 84 bits were converted, which was not
enough to parse LFE flag.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-07-18 21:04:57 -03:00
Derek Buitenhuis
a27c412795 webmdashenc: Fix memory leak
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-16 16:09:17 +01:00
Derek Buitenhuis
e10c31f331 hdsenc: Remove dead store
This is apparently not supposed to error out anyway.

Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-14 13:48:56 +01:00
Kieran O'Leary
264f6c6f95 movenc: Add 'keywords' metadata
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-13 13:34:01 +01:00
Derek Buitenhuis
5ca063799c rtspdec: Fix return error
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-10 15:02:29 -04:00
Paul B Mahol
0281d5ece6 avcodec/magicyuv: add 12 bit formats
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-07-10 12:03:08 +02:00
Wan-Teh Chang
2f84f40d45 avformat/avio: Remove no-op code in url_find_protocol().
In url_find_protocol(), proto_str is either "file" or a string
consisting of only the characters in URL_SCHEME_CHARS, which does not
include ','. Therefore the strchr(proto_str, ',') call always returns
NULL.

Note: The code was added in commit
6161c41817.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2017-07-10 06:56:51 +07:00
Derek Buitenhuis
c27d7c027c rtmpproto: Fix error return
Mistake was added in 5840473890.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-07 15:30:57 -04:00
Tobias Rapp
8bf9572e9a avformat: remove obsolete commented-out DEBUG define
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-07 11:57:39 -04:00
Derek Buitenhuis
2d417076a2 avformat/hlsenc: Add missing error check
Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-07 10:08:18 +08:00
Steven Liu
23e21130bb avformat/hlsenc: add warn message when use both fmp4 and single_file
have not implementation the fmp4 single file yet before this commit.

Suggested-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Steven Liu <lq@onvideo.cn>
2017-07-07 10:05:54 +08:00
Derek Buitenhuis
fde9013ab4 mpegtsenc: Don't pass NULL to memcpy
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-06 21:28:20 -04:00
Derek Buitenhuis
99c68861f9 concatdec: Do not pass NULL to memcmp
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-06 15:35:32 -04:00
Azamat H. Hackimov
121ab69c9d libavformat/gdv: Fix parsing for soundless video
Added 2 byte skipping if there no sound present, that fixes playback
files without sound stream.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-07-05 23:25:58 +02:00
John Stebbins
369a3e111c movenc: allow alternative hvc1 h.265 codec tag
If AVCodecParameters.codec_tag is 'hvc1' use it instead of 'hev1' for
h.265 streams. QuickTime (and other Apple software) requires 'hvc1'.

(cherry picked from commit 84ab1cc437)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-05 15:55:25 -04:00
John Stebbins
974d508e57 movenc: write correct format hvcc when tag is hvc1
(cherry picked from commit 1ea9b7fdf9)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-05 15:55:25 -04:00
John Stebbins
38d808d72e movenc: move tags definitions to where they are used
(cherry picked from commit 1c64bae648)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-05 15:55:25 -04:00
John Stebbins
e199d90da6 movenc: simplify codec_tag lookup
mux.c init_muxer() already sets codec_tag correctly in the cases
simplified here.

This also adds the capability to support alternative tags for the
same codec_id.

(cherry picked from commit f6f86f432f)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-05 15:55:25 -04:00
Steven Liu
1fe40e73a6 avformat/hlsenc: copy codec_tag when stream copy
when use fmp4 segment type in hls and use codec copy,
there have an error message.
error message:
   [mp4 @ 0x25df020] Tag avc1 incompatible with output codec id '28' ([33][0][0][0])
   [hls @ 0x2615c80] Some of the provided format options in '(null)' are not recognized
   Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
this patch can fix it.

Signed-off-by: Liu Qi <w_liuqi@kingsoft.com>
Signed-off-by: Steven Liu <lq@onvideo.cn>
2017-07-05 11:20:21 +08:00
Steven Liu
d01b8f8683 avformat/hlsenc: optimize help message default value.
show the hls_segment_type default always 0, show the flag name better

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-07-05 11:15:20 +08:00