Commit Graph

19594 Commits

Author SHA1 Message Date
Stephen Hutchinson bf14393635 avisynth: fix Planar RGB output
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-27 04:37:57 +02:00
James Almer eabbc64728 avformat/matroskaenc: fix cue relative position values when CRC32 is enabled
The dynamic buffer does not contain the CRC32 element so calls to avio_tell()
don't take it into account. This resulted in CueRelativePosition values being
six bytes short.
This is a regression since 6724525a15

Instead of adding yet another custom check for CRC32 to fix a size or an offset,
remove the existing ones and reserve the six bytes in the dynamic buffer.

Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-26 16:28:59 -03:00
Michael Niedermayer 1609935b6c Bump minor versions after 3.2 branchpoint to seperate release
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-26 20:52:42 +02:00
Michael Niedermayer 3f3025205f Bump minor versions for 3.2
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-26 20:52:42 +02:00
Michael Niedermayer 38e5a4f3bb Revert "avformat/utils: Discard huge timestamps which would cause overflows if used in basic computations"
Some people seem to oppose this the patch seems to have been missed for a month on the ML
lets restart the discussion and solve this after the release

This reverts commit e936c8d176.
2016-10-26 20:31:04 +02:00
Michael Niedermayer e936c8d176 avformat/utils: Discard huge timestamps which would cause overflows if used in basic computations
Allowing larger timestamps makes it impossible to calculate basic things like the
difference of 2 timestamps or their sum without checking each individual computation for
overflow.
This should avoid a significant number of overflow checks

Fixes Ticket5136

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-26 19:46:00 +02:00
Michael Niedermayer d88a6bedb9 avformat/isom: Fix old API regression with exporting max bitrate
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-26 19:46:00 +02:00
Suman- a81494b603 lavf/flvdec: init AVPacket::pos to FLVTAG offset
Current code doesn't initialize AVPacket::pos. Made it point to FLVTAG so flv_read_packet can decode from pos

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-26 02:12:18 +02:00
Rodger Combs 490c6bda0e
lavf/mov: reindent
Reviewed-By: Michael Niedermayer <michael@niedermayer.cc>
2016-10-24 05:47:10 -05:00
Rodger Combs 697400eac0
lavf/mov: improve `tref/chap` chapter handling
3 parts:
- Supports multiple chapter streams
- Exports regular text chapter streams as opaque data. This prevents consumers
  from showing chapters as if they were regular subtitle streams.
- Exports video chapter streams as thumbnails, and provides the first one as
  an attached_pic.
2016-10-24 05:47:10 -05:00
Rodger Combs 73ead477dd
lavf: add AV_DISPOSITION_TIMED_THUMBNAILS
Reviewed-By: Michael Niedermayer <michael@niedermayer.cc>
2016-10-24 05:47:05 -05:00
Rodger Combs d99d7cbdfc
lavf/rawenc: add automatic bitstream filtering for H264+HEVC 2016-10-24 03:53:24 -05:00
Rodger Combs 42cb050a05
lavf/movenc+dashenc: add automatic bitstream filtering
This is disabled by default when the empty_moov flag is enabled
2016-10-24 03:53:23 -05:00
Rodger Combs c972a28fc3
lavf/dashenc: add deinit function 2016-10-24 03:53:23 -05:00
Rodger Combs e83d5d7e58
lavf/movenc: add deinit function 2016-10-24 03:53:22 -05:00
Rodger Combs 45f5c55732
lavf/segment: fix writing separate header with auto BSF 2016-10-24 03:53:22 -05:00
Rodger Combs c7cd6ad850
lavf/segment: add deinit function 2016-10-24 03:53:22 -05:00
Rodger Combs a246fef163
lavf/mux: add avformat_init_output
This allows a consumer to run the muxer's init function without actually
writing the header, which is useful in chained muxers that support
automatic bitstream filtering.
2016-10-24 03:53:21 -05:00
Carlos Fernandez 728ccae8a2 lavf/mpegts: add missed fixes to scte35 section callback
They somehow got lost along the patch versions.

Signed-off-by: Marton Balint <cus@passwd.hu>
2016-10-23 00:10:34 +02:00
James Almer cc71fa319f avformat/matroskaenc: write DisplayWidth and DisplayHeight elements only if they differ from PixelWidth and PixelHeight
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-22 15:00:15 -03:00
Andreas Cadhalpun 178eebd79e mpegts: handle AVMEDIA_TYPE_UNKNOWN correctly
It is negative, so can't be used for left shifting.

This fixes ubsan runtime error: shift exponent -1 is negative

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-10-22 19:23:12 +02:00
Carl Eugen Hoyos 6969bed12c lavf/rtpdec_g726: Map mime type G726 to g726le.
Add new mime types AAL2-G726 for g726 as suggested in rfc 3551.

This patch will break interaction with applications that incorrectly
use big-endian G.726 with mime type G726 but we know of at least one
device (DVTel camera) that correctly implements the rfc, so do the same.

Fixes ticket #5890.
2016-10-22 03:53:38 +02:00
Andreas Cadhalpun c8a6eb58d7 doc: fix spelling errors
Thanks to Mathieu Malaterre <malat@debian.org> for reporting the
Que/Queue typo. (https://bugs.debian.org/839542)

Reviewed-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-10-21 23:58:47 +02:00
Carlos Fernandez 5db3c9476c lavf/mpegts: SCTE-35 extraction from mpegts
Reviewed-by: Marton Balint <cus@passwd.hu>
Acked-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Carlos Fernandez <carlos@ccextractor.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-10-21 20:41:19 +02:00
Michael Niedermayer fecb3e82a4 avformat/mxfdec: Check size to avoid integer overflow in mxf_read_utf16_string()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-21 20:06:29 +02:00
Michael Niedermayer c495f4ffde avformat/mxfdec: Fix mixed declaration and code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-21 20:06:29 +02:00
Andreas Cadhalpun b0a043f51b dcstr: fix division by zero
Also check for possible overflows.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-10-21 19:41:09 +02:00
Andreas Cadhalpun 93c39db5f1 aiff: check block_align in aiff_read_packet
It can be unset in avcodec_parameters_from_context and a value of 0
causes SIGFPE crashes.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-10-21 19:40:59 +02:00
Hiroyuki OYAMA 47f74df29c avformat/rtmpproto: Fix RTMP control message handling error in listen mode.
Fix problem to fail by a RTMP Control Message except "Set Chunk Size (1)" after an RTMP handshake. When 'nginx-rtmp-module' relays an RTMP, it sends not only control message 'Set Chunk Size (1)' but also 'Window Acknowledgement Size (5)'.

Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-21 16:16:32 +02:00
Rodger Combs ecb53e1101
lavf/segment: decide whether to rename based on list URI
This fixes the case of writing segments to local files, but the list
over a network protocol.
2016-10-21 01:43:59 -05:00
Matt Oliver 798c6ecce5 openssl: Support version 1.1.0.
Fixes #5675

Signed-off-by: Matt Oliver <protogonoi@gmail.com>
2016-10-21 15:16:44 +11:00
Mark Reid 6902e1c7fa libavformat/mxfdec: add metadata streams for external referenced sourclips
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-21 02:04:19 +02:00
Mark Reid 263f8fd7e5 libavformat/mxfdec: don't assume first stream index to be primary
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-21 02:04:16 +02:00
Mark Reid 3b82be9e3b libavformat/mxfdec: export track name metadata
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-21 02:04:01 +02:00
Tobias Rapp e3196b6862 avformat/mxfdec: Detect field_order based on video_line_map
Read video_line_map from MXF generic picture essence descriptor and use
it to derive the coded field order. Use field_dominance to derive the
display field order from coded field order. If field_dominance is not
available the default value "1" is used as defined in SMPTE S377-1.

Fixes field_order detection for a bunch of DV/DVCPRO files. The heuristic
for deriving coded field order from video_line_map is inspired by
MediaInfo.

Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-21 02:00:56 +02:00
Andreas Cadhalpun ee5f0f1d35 rsd: limit number of channels
Negative values don't make sense and too large values can cause
overflows. For AV_CODEC_ID_ADPCM_THP this leads to a too small extradata
buffer being allocated, causing out-of-bounds writes.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-10-20 19:54:54 +02:00
Steven Liu 5702416c57 avformat/flvenc: do not attempt to write duration and filesize when not seekable
Its impossible to update the filesize & duration values if seekback is not
possible as with live streams

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-20 18:07:24 +02:00
Carl Eugen Hoyos d8716864f9 lavf/riff: Document the interleaving of VSM4 video. 2016-10-19 23:39:19 +02:00
Andreas Cadhalpun a5b4476a60 avformat: prevent triggering request_probe assert in ff_read_packet
If probe_codec is called with pkt == NULL, it sets probe_packets to 0
and request_probe to -1.
However, request_probe can change when calling s->iformat->read_packet
and thus a probe_packets value of 0 doesn't guarantee a request_probe
value of -1.
In that case calling probe_codec again is necessary to prevent
triggering the assert.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-10-19 23:13:28 +02:00
Derek Buitenhuis dfe7e5501d FATE: Add test for muxing discontinuous MP4 fragments with large timestamps
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-10-19 13:25:21 +02:00
Michael Niedermayer 18ad44d145 avformat/movenc: Skip duration check for discontinuous fragments
Found-by: Daemon404
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-19 13:25:21 +02:00
Jean Caillé 6498549fd7 lavf/mov: support gopro hero moments udta tag
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-19 13:25:21 +02:00
James Almer 0ad71ed6f9 avformat/matroskadec: fix BitsPerChannel element's default value
The element is currently ignored, so there's no effective functionality
change with this.

Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-18 23:55:32 -03:00
James Almer f5cfc0cc54 avformat/matroskadec: clarify some Colour element defaults using enum values
This way it's more clear what the default values refer to, as
Undetermined/Unspecified is 0 for some, 2 for others.

Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-18 23:55:05 -03:00
James Almer ea201ad14c avformat/mov: pass the demuxer's AVFormatContext to avpriv_request_sample()
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-18 23:09:02 -03:00
James Almer 47ee6f1a59 avformat/matroskadec: support parsing Chroma Location elements
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-18 20:39:07 -03:00
Jon Toohill 3b02f6dd7b lavf/mp3enc: write encoder delay/padding upon closing
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-10-18 20:19:43 +02:00
Carl Eugen Hoyos 31a0a84216 lavf/avidec: Be more verbose when ignoring very large tag size. 2016-10-18 15:01:50 +02:00
Zhao Zhili 7853d838a6 avformat/tests/gitignore: add fifo_muxer entry
Reviewed-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-18 03:38:37 +02:00
Carl Eugen Hoyos a20f3238be lavf/avidec: Do not fail for very large idx1 tags.
Fixes demuxing the sample file from github pull request 197,
the size of its idx1 tag is 6171936 bytes, followed by a JUNK
tag of 9505704 bytes.
2016-10-18 00:25:41 +02:00
Andreas Cadhalpun bc7e128a6e westwood_aud: prevent division by zero
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-10-17 20:42:18 +02:00
Andreas Cadhalpun 9959a52b14 astdec: fix division by zero
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-10-17 20:41:26 +02:00
Andreas Cadhalpun c143a9c96f aiffdec: fix division by zero
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-10-17 18:24:48 +02:00
Andreas Cadhalpun eb751f06db matroskadec: fix NULL pointer dereference
The problem was introduced in commit 1273bc6.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-10-17 15:50:26 +02:00
Hendrik Leppkes 656feb641d mov: move stsd finalization to an appropriate place
mov_finalize_stsd_codec parses stream information from the ALAC extradata,
so run it after the extradata processing is completed in mov_read_stsd.

Fixes playback of 96kHz ALAC streams muxed by qaac or the reference alac encoder.
Fixes trac ticket #5826
2016-10-17 12:49:36 +02:00
James Almer 8b59ce0342 Partially revert "avformat/matroskadec: set aspect ratio only when DisplayWidth and DisplayHeight are in pixels"
The code works just fine regardless of unit, so only make sure DisplayUnit
is not "unknown".

Found-by: Nicolas George <george@nsup.org>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-16 14:19:05 -03:00
James Almer 90826031a2 avformat/matroskaenc: write a DisplayUnit element when aspect ratio is unknown
We don't currently support values 1 (centimeters), 2 (inches) or 3 (DAR),
only the default value 0 (pixels) which doesn't need to be written.

The fate refs are updated as unknown SAR is now signaled in the output
files with the addition of the new element.

Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-15 20:48:03 -03:00
James Almer bad8bbc26a avformat/matroskadec: set aspect ratio only when DisplayWidth and DisplayHeight are in pixels
A missing DisplayUnit element or one with the default value of 0 means
DisplayWidth and DisplayHeight should be interpreted as pixels.

The current code setting st->sample_aspect_ratio is wrong when DisplayUnit
is anything else.

Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-15 20:42:07 -03:00
Jean Caillé 4599e11651 lavf/mov: support gopro firmware udta tag
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-15 00:59:08 +02:00
James Almer 1273bc6d26 avformat/matroskadec: workaround the field_order bug in the Matroska muxer
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-13 14:22:07 -03:00
Carl Eugen Hoyos 4d81f9631d lavf/riff: Support Verint NetDVR II ("VSM4") h263 video in asf. 2016-10-13 12:17:48 +02:00
James Almer 7cf0ed32fa avformat: bump minor version after the Matroska field order enum fix
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-12 19:40:42 -03:00
James Almer dc781459cc avformat/matroska: fix MatroskaVideoFieldOrder enum values
The spec says

9: Interlaced with bottom field displayed first and top field stored first
14: Interlaced with top field displayed first and bottom field stored first

And avcodec.h states

AV_FIELD_TB,          //< Top coded first, bottom displayed first
AV_FIELD_BT,          //< Bottom coded first, top displayed first

Reviewed-by: Dave Rice <dave@dericed.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-12 18:26:22 -03:00
Carl Eugen Hoyos fe8959bbec lavf/riffenc: Always write unexpected channel_mask.
Allows to write arbitrary channel masks also for 16bit 48kHz pcm.
2016-10-12 12:34:48 +02:00
James Almer 8063978bfc avformat/matroskaenc: don't write a FlagInterlaced element if it would write the default value
The spec says:
"Mandatory elements with a default value may be left out of the file. In the absence
of a mandatory element, the element's default value is used."

Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-11 19:49:19 -03:00
Carl Eugen Hoyos 5781256c01 lavf/matroskaenc: Always write V_QUICKTIME extradata.
Fixes ticket #5872.
2016-10-11 10:07:18 +02:00
Carl Eugen Hoyos 34aa145468 lavf/aiffenc: Write extradata also for qcelp.
Fixes ticket #4009.
2016-10-11 09:52:34 +02:00
Carl Eugen Hoyos 4147d8efe5 lavf/aiffdec: Default to full rate qcelp as QT does.
Fixes decoding of the output file from ticket #4009.
2016-10-11 09:49:35 +02:00
Carl Eugen Hoyos d0c1b9821a lavf/mxfenc: Do not print a useless error message.
The option d10_channelcount only exists for mxf_d10.
2016-10-11 09:45:37 +02:00
James Almer c44eae157f avformat/matroskaenc: fix targets for attachment tags
Attachment tags were being written targeting non-existent streams in the
output file.
Also filter filename and mimetype entries, as they are standard elements
in the Attachment master.

Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-10 23:18:36 -03:00
Michael Niedermayer ed2112fb36 avformat/movenc: Check frame rate in mov_write_uuidprof_tag()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-10 00:58:16 +02:00
Michael Niedermayer 21bffa93a6 avformat/movenc: Switch mov_write_uuidprof_tag() to avg_frame_rate
Using the stream timebase simply overflows
Fix integer overflow in psp framerate computation

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-10 00:58:16 +02:00
Michael Niedermayer 987690799d avformat/utils: Update codec_id before using it in the parser init
Fixes assertion failure

Fixes: input.avi

Found-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-10 00:58:16 +02:00
Moritz Barsnick 468c596a31 lavf: fix typos
Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-09 20:09:00 +02:00
James Almer c45ba265fc avformat/matroskaenc: fix Tags master on seekable output if there are tags after the last stream duration
The dynamic AVIOContext would get closed pointing to the wrong position
in the buffer.
This is a regression since 650e17d88b.

Reviewed-by: Dave Rice <dave@dericed.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-07 16:46:45 -03:00
Michael Niedermayer 572f16e100 avformat/matroskaenc: Fix () error
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-07 14:56:53 +02:00
James Almer 711bfb33df avformat/matroskaenc: add an option to disable writting CRC32 elements
Also add missing Changelog entry.

Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-06 18:42:10 -03:00
James Almer 3bcadf8227 avformat/matroskaenc: write a CRC32 element on Info
Finishes implementing ticket #4347

Tested-by: Dave Rice <dave@dericed.com>
Tested-by: Jerome Martinez <jerome@mediaarea.net>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-06 17:16:12 -03:00
James Almer 650e17d88b avformat/matroskaenc: write a CRC32 element on Tags
Implements part of ticket #4347

Tested-by: Dave Rice <dave@dericed.com>
Tested-by: Jerome Martinez <jerome@mediaarea.net>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-06 17:13:59 -03:00
James Almer 4687240d52 avformat/matroskaenc: write a CRC32 element on Attachments
Implements part of ticket #4347

Tested-by: Dave Rice <dave@dericed.com>
Tested-by: Jerome Martinez <jerome@mediaarea.net>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-06 17:10:51 -03:00
James Almer eccefece61 avformat/matroskaenc: write a CRC32 element on Chapters
Implements part of ticket #4347

Tested-by: Dave Rice <dave@dericed.com>
Tested-by: Jerome Martinez <jerome@mediaarea.net>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-06 17:08:14 -03:00
James Almer 87ce2595de avformat/matroskaenc: write a CRC32 element on Tracks
Implements part of ticket #4347

Tested-by: Dave Rice <dave@dericed.com>
Tested-by: Jerome Martinez <jerome@mediaarea.net>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-06 17:05:03 -03:00
James Almer 79248795d4 avformat/matroskaenc: write a CRC32 element on Cues
Implements part of ticket #4347

Tested-by: Dave Rice <dave@dericed.com>
Tested-by: Jerome Martinez <jerome@mediaarea.net>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-06 17:01:20 -03:00
James Almer 3b189fae73 avformat/matroskaenc: write a CRC32 element on SeekHead
Implements part of ticket #4347

Tested-by: Dave Rice <dave@dericed.com>
Tested-by: Jerome Martinez <jerome@mediaarea.net>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-06 16:59:09 -03:00
James Almer 6724525a15 avformat/matroskaenc: write a CRC32 element on each Cluster
Implements part of ticket #4347

Tested-by: Dave Rice <dave@dericed.com>
Tested-by: Jerome Martinez <jerome@mediaarea.net>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-06 16:54:07 -03:00
James Almer 4e3bdf729a avformat/matroskaenc: always use a dynamic buffer when writting clusters
Tested-by: Dave Rice <dave@dericed.com>
Tested-by: Jerome Martinez <jerome@mediaarea.net>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-06 16:30:56 -03:00
James Almer d41aeea8a6 avformat/matroskaenc: print debug message with cluster offsets only if the output is seekable
Printing the dynamic buffer offset is useless.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-06 16:30:56 -03:00
James Almer a4044498f7 avformat/matroskadec: check for more reserved values on some Colour elements
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-06 13:49:29 -03:00
James Almer 9b8ac526f6 avformat/matroskaenc: don't write an empty Colour master element
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-06 13:49:10 -03:00
Rodger Combs a6bce3ca90
lavf/utils: avoid using programs for duration when there's only one
This allows us to be more selective about the streams we derive durations from
(specifically, ignoring text streams with outlier end times) in the common case
2016-10-06 01:36:05 -05:00
Rodger Combs 4c9c4fe8b2
lavf/utils: ignore outlier subtitle and data stream end times as well 2016-10-06 01:36:05 -05:00
Florian Diemer db4c1bee96 avformat/riffenc: added possibility to set first to ninth audio language for RIFF taged files (e.g. avi files)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-05 23:38:21 +02:00
James Almer b33369b612 avformat/matroskaenc: don't reserve space for stream duration tags if the output is not seekable
The durations are never written in that situation.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-04 21:19:58 -03:00
James Almer 3cc9d6d382 avformat/matroska: write FlagInterlaced element in WebM
It's listed as supported in both https://www.webmproject.org/docs/container/
and https://matroska.org/technical/specs/index.html

Reviewed-by: Dave Rice <dave@dericed.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-04 19:42:55 -03:00
Rodger Combs 14fe54bbfb
lavf/mpegtsenc: fix autobsf when the first NAL is 0x1<XX> bytes 2016-10-04 01:20:20 -05:00
Steven Liu be1d32492e avformat/hlsenc: support multi level path in m3u8 with filename
before patch:

localhost:osx liuqi$ tree 20160926/
20160926/
└── file-20160909
    └── 26
        └── 16
            └── 15
                ├── 46
                │   ├── 13.ts
                │   ├── 25.ts
                │   ├── 36.ts
                │   ├── 45.ts
                │   └── 54.ts
                └── 47
                    ├── 04.ts
                    ├── 14.ts
                    ├── 24.ts
                    └── 35.ts

6 directories, 9 files
localhost:osx liuqi$ cat out.m3u8
 #EXTM3U
 #EXT-X-VERSION:3
 #EXT-X-TARGETDURATION:12
 #EXT-X-MEDIA-SEQUENCE:0
 #EXTINF:11.360000,
 13.ts
 #EXTINF:10.800000,
 25.ts
 #EXTINF:9.120000,
 36.ts
 #EXTINF:8.760000,
 45.ts
 #EXTINF:10.200000,
 54.ts
 #EXTINF:10.720000,
 04.ts
 #EXTINF:9.600000,
 14.ts
 #EXTINF:10.600000,
 24.ts
 #EXTINF:8.760000,
 35.ts
 #EXT-X-ENDLIST

after patch:

localhost:osx liuqi$ tree 20160926/
20160926/
└── file-20160909
    └── 26
        └── 16
            └── 15
                ├── 46
                │   ├── 13.ts
                │   ├── 25.ts
                │   ├── 36.ts
                │   ├── 45.ts
                │   └── 54.ts
                └── 47
                    ├── 04.ts
                    ├── 14.ts
                    ├── 24.ts
                    └── 35.ts

6 directories, 9 files
localhost:osx liuqi$ cat out.m3u8
 #EXTM3U
 #EXT-X-VERSION:3
 #EXT-X-TARGETDURATION:12
 #EXT-X-MEDIA-SEQUENCE:0
 #EXTINF:11.360000,
 20160926/file-20160909/26/16/15/46/13.ts
 #EXTINF:10.800000,
 20160926/file-20160909/26/16/15/46/25.ts
 #EXTINF:9.120000,
 20160926/file-20160909/26/16/15/46/36.ts
 #EXTINF:8.760000,
 20160926/file-20160909/26/16/15/46/45.ts
 #EXTINF:10.200000,
 20160926/file-20160909/26/16/15/46/54.ts
 #EXTINF:10.720000,
 20160926/file-20160909/26/16/15/47/04.ts
 #EXTINF:9.600000,
 20160926/file-20160909/26/16/15/47/14.ts
 #EXTINF:10.600000,
 20160926/file-20160909/26/16/15/47/24.ts
 #EXTINF:8.760000,
 20160926/file-20160909/26/16/15/47/35.ts
 #EXT-X-ENDLIST

Signed-off-by: Steven Liu <lingjiujianke@gmail.com>
2016-10-04 06:41:53 +08:00
Stephan Holljes d0be0cbebc lavf/aviobuf.c: Adapt avio_accept and avio_handshake to new AVIOContext API
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
2016-10-03 23:28:48 +02:00
Adriano Pallavicino f4e692a0e9 lavf/bink.c: fix warning due to misleading indentation
Signed-off-by: Adriano Pallavicino <adriano.pallavicino@gmail.com>
Signed-off-by: Josh de Kock <josh@itanimul.li>
2016-10-03 15:42:27 +01:00
Steven Liu 0d2dd5d96d avformat/hlsenc: support mkdir_p for use_localtime_mkdir
when use use_localtime_mkdir to create multi level dir,
ffmpeg give error message:
ffmpeg -re -i ~/Movies/objectC/facebook.mp4 -c copy -use_localtime 1
 -use_localtime_mkdir 1 -hls_segment_filename '%Y%m%d/file-%Y%m%d/%s.ts'
out.m3u8
error message:
Could not create directory 20160926/file-20160926 with use_localtime_mkdir
add mkdir_p for support the multi level dir

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Tested-by: Zuo Genyu <1515161258@qq.com> (Windows)
Signed-off-by: Steven Liu <lingjiujianke@gmail.com>
2016-10-01 05:37:19 +08:00
Jan Sebechlebsky 81bab1074f avformat/tee: Copy interrupt callback and flags to slave
Copy interrupt callback to slave format context to allow
user to interrupt IO. Copy format flags as well.

Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
2016-09-29 17:17:26 +02:00
Carl Eugen Hoyos e84eeca577 lavf/movenc: Put correct display aspect ratio in ARES atom. 2016-09-29 15:41:17 +02:00
Carl Eugen Hoyos fcce25ee5d lavf/mov: Read display aspect ratio from ares atom also for dnxhd.
Fixes aspect ratio of sample in ticket #2125.
Fixes aspect ratio of sample in ticket #5325.
2016-09-29 15:29:03 +02:00
Jan Ekström cc725ebe48 movenc: Add support for writing language codes into ISML manifests
Streaming servers appear to ignore all other language metadata.

Signed-off-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Josh de Kock <josh@itanimul.li>
2016-09-29 10:32:03 +01:00
Sasi Inguva dba2db6c0e lavf/mov.c: Make audio timestamps strictly monotonically increasing inside an edit list.
Fixes gapless decoding. Adjust skip_samples field correctly in case of DISCARDed audio frames.

Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-29 02:25:41 +02:00
Jan Ekström 6c10f8fe76 movenc: use similar logic to DASH when writing bit rate to ISML
This way, in case of bit rate not being set, max_bitrate will be
used instead. This enables, for example, re-using max_bitrate
information from the input or doing transcoding with a rate
control mode that is not bit rate based.

Signed-off-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-28 23:45:11 +02:00
raymondzheng1412@gmail.com 2366efce3c avformat/concatdec: don't call open_file when seek position within a file 2016-09-28 20:31:22 +02:00
Sylvain Laurent 58776ccbdb lavf/mpegtsenc: Set min PID for data pkt to 0x0010.
Fixes ticket #1673.
2016-09-28 17:29:11 +02:00
Michael Niedermayer 2679ad4773 avformat/avidec: Check nb_streams in read_gab2_sub()
Fixes null pointer dereference
Fixes: 1/null_point.avi

Found-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-28 16:46:24 +02:00
Michael Niedermayer 14bac7e00d avformat/avidec: Remove ancient assert
This assert can with crafted files fail, a warning is already printed
for this case.

Fixes assertion failure
Fixes:1/assert.avi

Found-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-28 16:46:24 +02:00
James Almer 29b6c2be29 avformat/matroskadec: set AVCodecParameters.field_order on progressive video
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-09-27 20:30:11 -03:00
Sophia Wang 8c83062acb avformat/matroskadec: retain error codes in matroska_resync() and matroska_read_packet()
Signed-off-by: Sophia Wang <skw@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-28 01:24:51 +02:00
James Almer f0b6f7253f avformat: add av_stream_get_codec_timebase()
This will allow ffmpeg.c to stop using AVStream.codec in some cases

Signed-off-by: James Almer <jamrial@gmail.com>
2016-09-27 10:42:39 -03:00
Carl Eugen Hoyos 46aae84616 lavf/movenc: Allow to disable writing the timecode track.
Fixes ticket #5492.
2016-09-26 08:50:48 +02:00
James Almer aa0dc698db avformat/avidec: remove warning about deprecated declarations
Signed-off-by: James Almer <jamrial@gmail.com>
2016-09-25 16:03:21 -03:00
Michael Niedermayer b98dafe045 avformat/avidec: Fix memleak with dv in avi
Found-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-25 19:06:51 +02:00
Carl Eugen Hoyos 267da70ea8 lavf/utils: Avoid an overflow for huge negative durations.
Fixes ticket #5135.
2016-09-24 21:01:46 +02:00
Carl Eugen Hoyos 04fa20d53c lavf/aacdec: Do not autodetect a single frame inside the file. 2016-09-24 18:33:55 +02:00
Anssi Hannula a6f5e25ad9 avformat/hls: Fix handling of EXT-X-BYTERANGE streams over 2GB
Replace uses of atoi() with strtoll() when trying to read values into
int64_t variables.

Fixes Kodi trac #16926:
http://trac.kodi.tv/ticket/16926
2016-09-24 09:46:32 +03:00
Steven Liu 1212e3468e avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
refine EXT-X-BYTERANGE tag,
the spec link:
https://tools.ietf.org/html/draft-pantos-http-live-streaming-19#section-4.3.2.2
the apple doc:
https://developer.apple.com/library/ios/technotes/tn2288/_index.html#
//apple_ref/doc/uid/DTS40012238-CH1-BYTE_RANGE_SUPPORT_FOR_SEGMENTS

command line:
./ffmpeg -i ~/Movies/objectC/a.mp4 -c copy -f hls -hls_time 7
 -hls_list_size 0 -hls_segment_size 2500000 -t 40 output-test.m3u8
output:
localhost:ffmpeg liuqi$ ll *.ts ;cat output-test.m3u8
 -rw-r--r--  1 liuqi  staff  2792176  9 12 14:44 output-test0.ts
 -rw-r--r--  1 liuqi  staff  3112528  9 12 14:44 output-test3.ts
 -rw-r--r--  1 liuqi  staff  3377420  9 12 14:44 output-test6.ts
 -rw-r--r--  1 liuqi  staff  1228016  9 12 14:44 output-test7.ts
 #EXTM3U
 #EXT-X-VERSION:4
 #EXT-X-TARGETDURATION:10
 #EXT-X-MEDIA-SEQUENCE:0
 #EXTINF:9.021000,
 #EXT-X-BYTERANGE:1334988@0
 output-test0.ts
 #EXTINF:3.000000,
 #EXT-X-BYTERANGE:721356@1334988
 output-test0.ts
 #EXTINF:3.000000,
 #EXT-X-BYTERANGE:735832@2056344
 output-test0.ts
 #EXTINF:6.000000,
 #EXT-X-BYTERANGE:1645940@0
 output-test3.ts
 #EXTINF:3.000000,
 #EXT-X-BYTERANGE:715152@1645940
 output-test3.ts
 #EXTINF:3.000000,
 #EXT-X-BYTERANGE:751436@2361092
 output-test3.ts
 #EXTINF:9.000000,
 #EXT-X-BYTERANGE:3377420@0
 output-test6.ts
 #EXTINF:3.960000,
 #EXT-X-BYTERANGE:1228016@0
 output-test7.ts
 #EXT-X-ENDLIST
 localhost:ffmpeg liuqi$

 ticket-id: #5839

Signed-off-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-24 04:28:02 +02:00
Timo Rothenpieler 9777ba33f5 avformat/utils: avoid using marked decoders for probing
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-23 11:16:26 +02:00
Paul B Mahol 88d79dbd16 avformat/movenc: write pasp atom even if sar.num == sar.den
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-09-22 23:59:46 +02:00
Timo Rothenpieler 6d9a46e884 avformat/utils: force native h264 decoder for probing
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-22 13:16:00 +02:00
Clément Bœsch 955b818cf9 ffmpeg: switch to codecpar
This commit is largely based on commit 15e84ed3 from Anton Khirnov
<anton@khirnov.net> which was previously skipped in bbf5ef9d.

There are still a bunch of things raising codecpar related warnings that
need fixing, such as:
- the use of codec->debug in the interactive debug mode
- read_ffserver_streams(): it's probably broken now but there is no test
- lowres stuff
- codec copy apparently required by bitstream filters

The matroska references are updated because they now properly forward
the field_order (previously unknown, now progressive).

Thanks to James Almer for fixing a bunch of FATE issues in this commit.

Signed-off-by: Clément Bœsch <clement@stupeflix.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-09-21 15:39:28 +02:00
Mark Reid d8d4333217 avformat/mxfdec: use first valid sourceclip found if material track has multiple components
This commit fixes a issue with mxf footage having multiple
components on a material track.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-21 01:29:20 +02:00
Sasi Inguva ca6cae73db lavf/mov: Add support for edit list parsing.
Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-19 19:52:05 +02:00
Sasi Inguva b518d809f1 lavf/utils: Support av_index_search_timestamp in case of AVIndexEntry with discarded packets.
Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-19 19:51:13 +02:00
Sasi Inguva 778af68c70 avformat/avframe.h: Add a flag in AVIndexEntry to discard frame after decoding.
Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-19 19:51:13 +02:00
Michael Niedermayer a880923170 avformat/http: Fix #ifdef FF_API_HTTP_USER_AGENT
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-17 20:14:10 +02:00
Steven Liu 27714b462d lavf/http: deprecate user-agent option 2016-09-17 13:48:34 +02:00
Michael Niedermayer 51000b9945 avformat/movenc: Make the packet check more tolerant
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-16 11:44:13 +02:00
Michael Niedermayer 2834313933 avformat/movenc: Check packet in mov_write_single_packet() too
Fixes assertion failure

Found-by: durandal117
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-16 11:43:56 +02:00
Michael Niedermayer deabcd2c05 avformat/movenc: Factor check_pkt() out
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-16 11:43:47 +02:00
Vignesh Venkatasubramanian 7238c53048 libavformat/webm_chunk: Option to specify HTTP header
Add an option to specify HTTP header in the WebM Chunk Muxer (this
works the same way as the 'method' parameter in the HLS muxer).

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-16 03:13:21 +02:00
Paul B Mahol 4d677c7ae3 avformat/msf: add support for ATRAC3 codec
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-09-15 16:59:31 +02:00
Martin Storsjö f8a13c7213 lavf/rtsp: Fix a crash with the RTSP muxer.
Introduced in 00e122bc / bc2a3296
The whole block that the statement was added to is only
relevant when used as a demuxer, but the other statements
there have had other if statements guarding them. Make
sure to only run this whole block if being used as a
demuxer.

Fixes ticket #5844.
2016-09-15 13:50:57 +02:00
Michael Niedermayer 6f062eb8d0 avformat/hlsenc: Emulate strftime("%z") using other functions if it does not work
This should fix the code on windows

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-15 02:31:42 +02:00
Xinzheng Zhang ecc04b4f2f avformat/utils: fix timebase error in avformat_seek_file()
When there is only one stream and stream_index has not specified,
The ts has been transferd by the timebase of stream0 without modifying the stream_index
In this condation it cause seek failure.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-14 15:50:07 +02:00
Steven Liu c8528e54e5 avformat/flvenc: add no_sequence_end flags for flvflags
when split flv file by flv format at first, and cat flvs file
into one flv file, the flv sequence end is be used,
then the whole flv have many flv sequence end TAG.
this flags can give user an option to ignore write sequence end TAG

Signed-off-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-14 15:50:07 +02:00
Michael Niedermayer e85c4a4706 avformat/flvenc: Add () around &
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-14 15:50:07 +02:00
Clément Bœsch 415f907ce8 lavf/utils: add missing ismv in MOV-like formats 2016-09-14 10:00:08 +02:00
Clément Bœsch 9112822e71 lavf/utils: simplify matching MOV-like formats 2016-09-14 09:59:22 +02:00
Clément Bœsch ae1dd0c9a6 lavf: add avformat_transfer_internal_stream_timing_info() and use it in ffmpeg
In lavf we have access to st->internal->avctx so it's a better place
than in ffmpeg*.c and will allow moving to codecpar.
2016-09-14 09:57:55 +02:00
Steven Liu 84aebfc74e avformat/flvenc: add FLVFlags for flvflags options
add FLVFlags type, be used to add new FLVFlags options

Signed-off-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-14 01:45:40 +02:00
Michael Niedermayer 9f18a970b2 avformat/hlsenc: Assume UTC if "%z" is unsupported in strftime()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-13 23:44:35 +02:00
Michael Niedermayer 22ba9a3cb8 avformat/hlsenc: Avoid "%T" "%F" in strftime() to improve compatibility
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-13 23:44:35 +02:00
Rodger Combs 1f6d7eb470
lavf: add a flag to enable/disable automatic bitstream filtering
This is mostly useful for muxers that wrap other muxers, such as dashenc
and segment. The actual duplicated bitstream filtering is largely harmless,
but delaying the header can cause problems when the muxer intended the header
to be written to a separate file.
2016-09-12 21:50:32 -05:00
Jan Sebechlebsky b7760dd8d4 avformat/tee: Use BSF list API
Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
2016-09-12 00:06:17 +02:00
Michael Niedermayer cb114ed464 avformat/mux: implement AVFMT_FLAG_SHORTEST
This will allow fixing several bugs with the -shortest option

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-11 23:17:31 +02:00
Alex Converse 09317e3e06 ivfenc: Add VPX codec tags.
This fixes remuxing VPX from MP4 without manually overwriting the tag.
2016-09-10 16:40:47 -07:00
Michael Niedermayer 68f4c2163e avformat/movenc: Check first DTS similar to dts difference
Fixes assertion failure
Fixes: b84b53855a0b74560e64c6f45f505a13/signal_sigabrt_7ffff6ae7c37_3837_ef4e243ea5b4fa8d0becf4afe9166604.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-10 00:50:36 +02:00