Commit Graph

19607 Commits

Author SHA1 Message Date
Vittorio Giovara
25fcbf7a84 hevc: Support extradata changes
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-12-02 15:04:24 -05:00
Michael Niedermayer
4059cd3952 avformat/ffmenc: Remove the last use of st->codec
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-02 19:37:00 +01:00
Michael Niedermayer
78519a0029 avformat/ffmenc: Make ffm_write_header_codec_ctx() use codecpar
This would be simpler if codecpar supported AVOptions
modern ffserver should be unaffected by this, older ffserver which required the
muxer to directly access the encoder could have issues with this, but this
direct access is just wrong and unsafe

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-02 19:37:00 +01:00
Michael Niedermayer
e8215b77ff avformat/ffmenc: set bitexact mode for old API without accessing the encoder
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-02 19:37:00 +01:00
Michael Niedermayer
c06d4f2ced avformat/ffmenc: Drop ffm_write_header_codec_private_ctx()
This accesses the private encoder context, it should not be used by
the current ffserver it may affect old ffserver versions but i believe
there is consens that accessing the private encoder context from the muxer
is completely wrong.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-02 19:37:00 +01:00
Michael Niedermayer
b7d94c19cd avformat/ffmenc: Replace some st->codec use by codecpar
Note, this temporarly drops the ability to set ffmpeg encoder debug and flags2 via ffserver.conf

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-02 19:37:00 +01:00
Rainer Hochecker
7a9db61da3 matroskadec: partly revert "demux relevant subtitle packets after a seek"
This reverts parts of c16582579b. The hard
coded 30 seconds are a lot, and finishing the seek can takes several
seconds when the source is on a network share. Remove this code
entirely, because it does more bad than good.

(Commit message provided by committer, based on the original messages
by the patch author.)

Signed-off-by: Rainer Hochecker <fernetmenta@online.de>
Signed-off-by: wm4 <nfxjfg@googlemail.com>
2016-12-02 13:59:17 +01:00
Gregory J. Wolfe
9c041a3cd5 avformat/tests/fifo_muxer: includes libavformat/network.h to define ETIMEDOUT for fate build.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-01 23:42:50 +01:00
Vittorio Giovara
7010ebdf1f mov: Evaluate the movie display matrix
This matrix needs to be applied after all others have (currently only
display matrix from trak), but cannot be handled in movie box, since
streams are not allocated yet. So store it in main context, and apply
it when appropriate, that is after parsing the tkhd one.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-11-30 12:18:58 -05:00
Andreas Cadhalpun
2c908f22c2 avidec: fix leaking extradata
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-30 02:22:50 +01:00
Michael Schenk
18b9466937 matroskadec: prevent access of elements after freeing
Using the decode interrupt feature of ffmpeg may cause crashes by
accessing previously freed pointers in matroska_read_close.

To prevent this reset nb_elem to zero after freeing the elements,
because ffmpeg normally tests for nb_elem.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-30 01:15:38 +01:00
Andreas Cadhalpun
c0175fa92b idroqdec: fix leaking pkt on failure
The code calls av_new_packet a few lines above and the allocated memory
has to be freed in case of an error.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-30 00:22:45 +01:00
Michael Niedermayer
744a0b5206 avformat/idroqdec: Check chunk_size for being too large
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-29 19:26:26 +01:00
Michael Niedermayer
102f7d0ee6 avformat/rmenc: Check framerate before storing
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-27 23:28:23 +01:00
Michael Niedermayer
a06e84b56e avformat/utils: Fix type mismatch
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-27 04:08:00 +01:00
Andreas Cadhalpun
ff5f4bd976 lavf: always forward codec_whitelist in avformat_find_stream_info
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-26 23:37:55 +01:00
Steven Liu
af7d0ad983 refine avformat/flvdec set bit_rate 2016-11-26 11:28:22 +08:00
Steven Liu
7c5478a203 avformat/flvdec: move set bit_rate from parse AMF OBJECT to
create_stream

before patch:
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x714 [SAR 1:1 DAR 640:357], 25 fps, 25 tbr, 1k tbn, 50 tbc

after patch:
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x714 [SAR 1:1 DAR 640:357], 2576 kb/s, 25 fps, 25 tbr, 1k tbn, 50 tbc

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-26 08:56:18 +08:00
Steven Liu
ee24c8ad01 avformat/flvenc: fix ticket 5976 and use old commit
mythtv have problem with non-seekable dont write duration and filesize
and there have problem with some other server and player with 0 value
duation and filesize.
So add a flv flags to fix the ticket and make a choose for users.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2016-11-26 08:52:19 +08:00
Carl Eugen Hoyos
e0791c5aaf lavf/flvdec: Set avg_frame_rate for video streams.
Requested-by: qw, applemax82 at 163 dot com
Reviewed-by: Steven Liu
2016-11-25 11:06:14 +01:00
Andreas Cadhalpun
98b3a7979f flvdec: require need_context_update when changing codec id
Otherwise the codec context and codecpar might disagree on the codec id,
triggering asserts in av_parser_parse2.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-25 00:35:46 +01:00
Andreas Cadhalpun
dbefbb61b7 sbgdec: prevent NULL pointer access
Reviewed-by: Josh de Kock <josh@itanimul.li>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-23 01:16:42 +01:00
Andreas Cadhalpun
de4ded0636 rmdec: validate block alignment
This fixes division by zero crashes.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-23 00:57:10 +01:00
Michael Niedermayer
4e5049a230 avformat/mpeg: Adjust vid probe threshold to correct mis-detection
Fixes: _ij.mp3

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-23 00:54:45 +01:00
Andreas Cadhalpun
fdb8c455b6 mxfdec: fix NULL pointer dereference in mxf_read_packet_old
Metadata streams have priv_data set to NULL.

Reviewed-by: Josh de Kock <josh@itanimul.li>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-23 00:40:52 +01:00
Steven Liu
d316b21dba avformat/flvenc: add no_metadata to flvflags
some flv have no metadata,
ffmpeg will same with the source flv stream.

Signed-off-by: Steven Liu <lingjiujianke@gmail.com>
2016-11-22 10:18:23 +08:00
James Almer
0b8df0ce48 avformat/utils: add missing brackets around arguments in av_realloc() call
Found-by: Neil Birkbeck <neil.birkbeck@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-11-21 23:02:20 -03:00
Matthew Gregan
156fbbb562 avformat/movenc: Restrict experimental VP9 support to MODE_MP4.
Signed-off-by: Matthew Gregan <kinetik@flim.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-11-21 16:07:14 -03:00
Matthew Gregan
2d73d25670 Add experimental demuxing support for FLAC in ISO BMFF (MP4).
Based on the draft spec at https://git.xiph.org/?p=flac.git;a=blob;f=doc/isoflac.txt

Signed-off-by: Matthew Gregan <kinetik@flim.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-11-21 15:38:34 -03:00
Matthew Gregan
7dc4200c38 Add experimental muxing support for FLAC in ISO BMFF (MP4).
Based on the draft spec at https://git.xiph.org/?p=flac.git;a=blob;f=doc/isoflac.txt

'-strict experimental' is required to create files in this format.

Signed-off-by: Matthew Gregan <kinetik@flim.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-11-21 15:36:42 -03:00
James Almer
8c1342e631 avformat/matroskaenc: write updated STREAMINFO metadata for FLAC streams if available
FLAC streams originating from the FLAC encoder send updated and more
complete STREAMINFO metadata as part of the last packet, so write that
to CodecPrivate instead of the incomplete one available in extradata
during init.

Signed-off-by: James Almer <jamrial@gmail.com>
2016-11-20 19:31:32 -03:00
James Almer
ee888cfbe7 avformat/matroskaenc: postpone writing the Tracks master
This will allow us to write updated stream information not available
during write_header().

Signed-off-by: James Almer <jamrial@gmail.com>
2016-11-20 19:31:32 -03:00
Andreas Cadhalpun
1c7da19a4b ffmdec: validate codec parameters
A negative extradata size for example gets passed to memcpy in
avcodec_parameters_from_context causing a segmentation fault.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-20 20:08:35 +01:00
James Almer
0ffea35657 avformat/utils: check for overflow before reallocating side data
This makes av_stream_add_side_data() consistent with av_packet_add_side_data().

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-11-19 20:11:50 -03:00
James Almer
2343f23e4d avformat/matroska: use av_stream_add_side_data() for stereo3d side data
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-11-19 12:20:50 -03:00
James Almer
eb3a59c903 avformat/mov: reuse existing err variable
Signed-off-by: James Almer <jamrial@gmail.com>
2016-11-19 00:54:58 -03:00
James Almer
77f033eb98 avformat/mov: use av_stream_add_side_data() for displaymatrix side data
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-11-18 22:20:36 -03:00
James Almer
2ab50647ff avformat/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.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-11-18 22:17:13 -03:00
Steven Liu
4696f7639b avformat/flvdec: add debug message to list keyframes index metadata
when parsing keyframe index metadata, list the message by trace log

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-19 02:15:27 +01:00
James Almer
50e0e96f3f avformat/apngenc: use the stream parameters extradata if available
Fixes remuxing apng streams coming from the apng demuxer, which sends extradata
during init.

Signed-off-by: James Almer <jamrial@gmail.com>
2016-11-18 12:26:44 -03:00
James Almer
16c429166d Revert "apngdec: use side data to pass extradata to the decoder"
This reverts commit e0c6b32046.

Said commit changed the behavior of the demuxer and decoder in a non
backwards compatible way.
Demuxers should make extradata available at init if possible, and send
new extradata as side data within a packet if needed.

A better fix for the remuxing crash will follow.

Signed-off-by: James Almer <jamrial@gmail.com>
2016-11-18 12:24:28 -03:00
Michael Niedermayer
709c87109d avformat/movenc: Check frame rate before use.
Fixes division by 0
This is similar to how avg_frame_rate is checked elsewhere
Fixes: 6d24add0455f41b1b45b7ba615cd46f3/asan_generic_dc34c3_5480_0a2ef411cae999b9871ed71a2e481b71.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-17 19:03:41 +01:00
Hendrik Leppkes
4a485daa7f Merge commit '4f7723cb3b913c577842a5bb088c804ddacac8df'
* commit '4f7723cb3b913c577842a5bb088c804ddacac8df':
  movenc: Add an option for skipping writing the mfra/tfra/mfro trailer

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-11-17 14:54:51 +01:00
Carl Eugen Hoyos
9648ce2a18 lavf/Makefile: Fix rule for the data muxer. 2016-11-14 13:33:22 +01:00
Hendrik Leppkes
d8ffdefbdc Merge commit '029cf99c5166b36f33381cd8ebfa5f1f1f463d1f'
* commit '029cf99c5166b36f33381cd8ebfa5f1f1f463d1f':
  mov: Save number of stsd elements after stream extradata allocation

Mostly noop, see 8b43ee4054

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-11-14 12:41:32 +01:00
Hendrik Leppkes
a0bc6b51d4 Merge commit 'e72d6fa08a3c1876109149401753a8d2c736d418'
* commit 'e72d6fa08a3c1876109149401753a8d2c736d418':
  build: Move MP2 muxer declaration away from MP3 muxer code

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-11-14 11:20:15 +01:00
Rodger Combs
f8e3ebde56
lavf/mux: don't warn about missing timestamps on attached pictures 2016-11-14 01:45:02 -06:00
Hendrik Leppkes
8fad4b4e25 Merge commit '785c25443b56adb6dbbb78d68cccbd9bd4a42e05'
* commit '785c25443b56adb6dbbb78d68cccbd9bd4a42e05':
  movenc: Apply offsets on timestamps when peeking into interleaving queues

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-11-13 22:57:02 +01:00
Andreas Cadhalpun
25012c5644 filmstripdec: correctly check image dimensions
This prevents a division by zero in read_packet.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-13 19:18:14 +01:00
Vlad Tarca
2bd83ef26a avformat: Add Pro-MPEG CoP #3-R2 FEC protocol
Pro-MPEG Code of Practice #3 release 2 forward error correction for rtp_mpegts streams

Signed-off-by: Vlad Tarca <vtarca@mobibase.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-13 11:38:15 +01:00