1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

19790 Commits

Author SHA1 Message Date
Sasi Inguva
7e538c9475 lavf/mov.c: Correct keyframe search in edit list to return the very first keyframe/frame with matching timestamp. Fixes ticket#5904
Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-20 17:15:36 +01:00
Marton Balint
8985e4af2b avformat/fifo: assert on disallowed message type and state combinations
Fixes Coverity CID 1396277.

Signed-off-by: Marton Balint <cus@passwd.hu>
2017-02-19 16:41:43 +01:00
Michael Niedermayer
3206ea4ba3 avformat/utils: Also fill dts==RELATIVE_TS_BASE packets in update_initial_durations()
This dts value can end up in the list in the absence of durations and is in that
case semantically identical to AV_NOPTS_VALUE. We can alternatively prevent
storing RELATIVE_TS_BASE if there is no duration.

Fixes Ticket3640

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-19 02:07:12 +01:00
Michael Niedermayer
6baee21eb7 avformat/m4vdec: Detect raw mpeg4video with unidentified non mpeg headers with a very low score
Fixes Ticket 6018

This fixes a regression, and allows playback of files containing mpeg4video that are otherwise
not supported

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-18 04:18:30 +01:00
Steven Liu
965f35b111 avformat/hlsenc: set default http method to PUT when method is null
When the http method is not set, the method will use POST for ts,
PUT for m3u8, it is not unify, now set it unify.
This ticket id: #5315

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-02-18 09:42:51 +08:00
Thierry Foucu
4bc7268f2b lavf/riff: Support decoding files with broken mediasubtype base guid.
Fixes ticket #6100.
2017-02-17 14:24:53 +01:00
Thomas Stephens
5fe2b43702 avformat/dashenc: Only use temporary files when outputting to file protocol
Skips using temporary files when outputting to a protocol other than
"file", which enables dash to output content over network
protocols. The logic has been copied from the HLS format.

Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-14 17:00:30 +01:00
Joel Cunningham
8c8e5d5286 HTTP: improve performance by reducing forward seeks
This commit optimizes HTTP performance by reducing forward seeks, instead
favoring a read-ahead and discard on the current connection (referred to
as a short seek) for seeks that are within a TCP window's worth of data.
This improves performance because with TCP flow control, a window's worth
of data will be in the local socket buffer already or in-flight from the
sender once congestion control on the sender is fully utilizing the window.

Note: this approach doesn't attempt to differentiate from a newly opened
connection which may not be fully utilizing the window due to congestion
control vs one that is. The receiver can't get at this information, so we
assume worst case; that full window is in use (we did advertise it after all)
and that data could be in-flight

The previous behavior of closing the connection, then opening a new
with a new HTTP range value results in a massive amounts of discarded
and re-sent data when large TCP windows are used.  This has been observed
on MacOS/iOS which starts with an initial window of 256KB and grows up to
1MB depending on the bandwidth-product delay.

When seeking within a window's worth of data and we close the connection,
then open a new one within the same window's worth of data, we discard
from the current offset till the end of the window.  Then on the new
connection the server ends up re-sending the previous data from new
offset till the end of old window.

Example (assumes full window utilization):

TCP window size: 64KB
Position: 32KB
Forward seek position: 40KB

      *                      (Next window)
32KB |--------------| 96KB |---------------| 160KB
        *
  40KB |---------------| 104KB

Re-sent amount: 96KB - 40KB = 56KB

For a real world test example, I have MP4 file of ~25MB, which ffplay
only reads ~16MB and performs 177 seeks. With current ffmpeg, this results
in 177 HTTP GETs and ~73MB worth of TCP data communication.  With this
patch, ffmpeg issues 4 HTTP GETs and 3 seeks for a total of ~22MB of TCP data
communication.

To support this feature, the short seek logic in avio_seek() has been
extended to call a function to get the short seek threshold value.  This
callback has been plumbed to the URLProtocol structure, which now has
infrastructure in HTTP and TCP to get the underlying receiver window size
via SO_RCVBUF.  If the underlying URL and protocol don't support returning
a short seek threshold, the default s->short_seek_threshold is used

This feature has been tested on Windows 7 and MacOS/iOS.  Windows support
is slightly complicated by the fact that when TCP window auto-tuning is
enabled, SO_RCVBUF doesn't report the real window size, but it does if
SO_RCVBUF was manually set (disabling auto-tuning). So we can only use
this optimization on Windows in the later case

Signed-off-by: Joel Cunningham <joel.cunningham@me.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-14 17:00:30 +01:00
Michael Niedermayer
8fa18e042a avformat/http: Check for truncated buffers in http_connect()
Reported-by: SleepProgger <security@gnutp.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-14 04:02:51 +01:00
Bela Bodecs
2b9f92fcc5 avformat/hlsenc: fix stream level metadata handling
hls-encoder currenlty does not provide stream level metadata to mpegts
muxer. This patch fixes track #3848 bug.

Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-02-13 07:33:48 +08:00
Jan Ekström
763e823754 movenc: add support for track names in ISML manifests
This enables having multiple tracks of the same type which would
be treated as different things by the media server (as opposed to
different bit rate versions of the same track). According to the
smooth streaming specification, just setting the systemLanguage
tag is not enough to note that a track with the same attributes
differs from another one.

Reviewed-by: Martin
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-12 20:18:32 +01:00
Carl Eugen Hoyos
79d232fc9f lavf/mpegts: Make a pointer cast explicit.
Silences an "assignment discards ‘const’ qualifier" warning.

Reviewed-by: Marton Balint
2017-02-12 13:57:59 +01:00
Paul B Mahol
8259f8a720 avcodec: add FM Screen Capture Codec decoder
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-02-12 10:43:45 +01:00
Paul B Mahol
25d9cb4621 avformat/flic: fix handling of EOF case
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-02-11 20:20:07 +01:00
Carl Eugen Hoyos
5b2c0eebee lavf/omadec: Fix packet duration for Atrac 3 lossless. 2017-02-11 19:01:14 +01:00
Carl Eugen Hoyos
ed491db3e5 lavf/rtpdec_mpeg4: Constify a function parameter.
Silences an "assignment discards ‘const’ qualifier" warning.
2017-02-11 16:19:37 +01:00
Carl Eugen Hoyos
7ff445874b lavf/omadec: Remove an unsed variable. 2017-02-11 15:55:11 +01:00
Paul B Mahol
280a40dd27 avcodec: add ATRAC Advanced Lossless decoders
Only lossy part is decoded for now.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-02-11 12:00:38 +01:00
Steven Liu
d96ebc5ef8 avformat/hlsenc: deprecate hls_wrap option
When user use the hls_wrap, there have many problem:
1. some platform refersh the old but usefull segment
2. CDN(Content Delivery Network) Deliver HLS not friendly

The hls_wrap is used to wrap segments for use little space,
now user can use hls_list_size and hls_flags delete_segments
instead it.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-02-11 12:32:31 +08:00
James Almer
7b3f0b3de4 avformat/apetag: bump micro version
In case parsers care about the version that started writing
correct flags.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-02-10 21:03:24 -03:00
James Almer
33ab1d4c6f avformat/apetag: reorder some code to improve readability
This way it's clear the size field accounts for the footer length plus every
tag entry, but not the header.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-02-10 18:33:30 -03:00
James Almer
84d874a680 avformat/apetag: account for header size if present when returning the start position
The size field in the header/footer accounts for the entire APE tag
structure except the 32 bytes from header, for compatibility with
APEv1.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-02-10 18:33:29 -03:00
James Almer
e8d6fef316 avformat/apetag: fix flag value to signal footer presence
According to the spec[1], a value of 0 means the footer is present and a value
of 1 means it's absent, the exact opposite of header presence flag where 1
means present and 0 absent.
The reason for this is compatibility with APEv1 tags, where there's no header,
footer presence was mandatory for all files, and the flags field was a zeroed
reserved field.

[1] http://wiki.hydrogenaud.io/index.php?title=Ape_Tags_Flags

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-02-10 18:33:29 -03:00
Carl Eugen Hoyos
74c576957a lavf/movenc: Remove two unused variables. 2017-02-10 12:40:43 +01:00
Matt Wolenetz
36aba43bd5 lavf/mov.c: Avoid heap allocation wraps in mov_read_{senc,saiz}()
Core of patch is from paul@paulmehta.com
Reference https://crbug.com/643952 (senc,saiz portions)

Signed-off-by: Matt Wolenetz <wolenetz@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-10 12:04:41 +01:00
Matt Wolenetz
9bbdf5d921 lavf/mov.c: Avoid OOB in mov_read_udta_string()
Core of patch is from paul@paulmehta.com
Reference https://crbug.com/643952 (udta_string portion)

Signed-off-by: Matt Wolenetz <wolenetz@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-10 12:04:41 +01:00
Matt Wolenetz
2d453188c2 lavf/mov.c: Avoid heap allocation wrap in mov_read_uuid
Core of patch is from paul@paulmehta.com
Reference https://crbug.com/643951

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Check value reduced as the code does not support values beyond INT_MAX
Also the check is moved to a more common place and before integer truncation
2017-02-08 03:57:10 +01:00
Matt Wolenetz
fd30e4d57f lavf/mov.c: Avoid heap allocation wrap in mov_read_hdlr
Core of patch is from paul@paulmehta.com
Reference https://crbug.com/643950

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Check value reduced as the code does not support larger lengths
2017-02-08 03:31:01 +01:00
Petri Hintukainen
dface53497 matroska: demux BluRay text subtitles
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-07 21:32:08 +01:00
Aman Gupta
606eac7b07 avformat/hlsenc: add hls_flag option to write segments to temporary file until complete
Adds a `-hls_flags +temp_file` which will write segment data to
filename.tmp, and then rename to filename when the segment is complete.

This patch is similar in spirit to one used in Plex's ffmpeg fork, and
allows a transcoding webserver to ensure incomplete segment files are
never served up accidentally.

Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Reviewed-by: Bodecs Bela <bodecsb@vivanet.hu>
Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-02-07 11:58:43 +08:00
Chris Cunningham
ac25840ee3 lavf/matroskadec: fix is_keyframe for early Blocks
Blocks are marked as key frames whenever the "reference" field is
zero. This breaks for non-keyframe Blocks with a reference timestamp
of zero.

The likelihood of reference timestamp being zero is increased by a
longstanding bug in muxing that encodes reference timestamp as the
absolute time of the referenced frame (rather than relative to the
current Block timestamp, as described in MKV spec).

Now using INT64_MIN to denote "no reference".

Reported to chromium at http://crbug.com/497889 (contains sample)
2017-02-06 09:33:28 +01:00
Marton Balint
85169a75e1 avformat/segment: remove last_cut check when detecting a new segment
Not starting a new segment if the elapsed microsecs since the start of the day
equals the the elapsed microsecs since the start of the day at the time of the
last cut seems plain wrong to me, Deti do you remember the original reason
behind this check?

Signed-off-by: Marton Balint <cus@passwd.hu>
2017-02-04 23:36:45 +01:00
Carl Eugen Hoyos
7d169ba1d8 lavf/isom: Support DTS Express in mov.
Fixes ticket #6124.
2017-02-03 19:01:59 +01:00
Clément Bœsch
f475405237 Merge commit '7f549b8338ed3775fec4bf10421ff5744e5866dd'
* commit '7f549b8338ed3775fec4bf10421ff5744e5866dd':
  riff: don't overwrite bps from WAVEFORMATEX if EXTENSIBLE doesn't contain that data.

Only cosmetics, the change was already present.

Merged-by: Clément Bœsch <cboesch@gopro.com>
2017-02-02 11:36:34 +01:00
Paul B Mahol
c279c44a3a avformat/msf: support codec 1, which is 16 bit pcm le
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-02-01 19:21:01 +01:00
Clément Bœsch
e26e6240b6 Merge commit '90bc423212396e96a02edc1118982ab7f7766a63'
* commit '90bc423212396e96a02edc1118982ab7f7766a63':
  mov: Wrap stsc index and count compare in a separate function

The mov_stsc_index_valid() function is replaced with a macro to prevent
signdness issues (index is not always signed, and count is always
unsigned currently).

The comparison is also adjusted to reduce the risk of overflows.

Merged-by: Clément Bœsch <u@pkh.me>
2017-02-01 15:50:02 +01:00
erankor
0101d29095 mov: fix decryption with edit list
Retain the ranges of frame indexes when applying edit list in
mov_fix_index. The index ranges are then used to keep track of the frame
index of the current sample. In case of a discontinuity in frame indexes
due to edit, update the auxiliary info position accordingly.

Reviewed-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-01 15:09:38 +01:00
Andreas Cadhalpun
4bd5d824e9 boadec: remove log messages
Requested-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2017-02-01 02:57:40 +01:00
Moritz Barsnick
0478728db0 lavf/xwma: fix incorrect format specifier
Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
2017-01-31 10:42:14 +01:00
Tobias Rapp
e65db4ce59 avformat/avienc: add reserve_index_space option
Allows the user to reserve space for the ODML master index. A sufficient
sized master index in the AVI header avoids storing follow-up master
indexes within the 'movi' data later. If the option is omitted or zero
the index size is estimated from output duration and bitrate.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2017-01-31 09:00:23 +01:00
Andreas Cadhalpun
3d673078a0 ircamdec: prevent overflow during block alignment calculation
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2017-01-31 02:11:17 +01:00
Michael Niedermayer
06c143e505 avformat/mov: Fix integer truncation in mov_read_uuid()
Fixes Ticket6102

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-01-30 23:19:01 +01:00
bnnm
ebb83e2dc0 avformat/msf: fix codec 4 (joint stereo ATRAC3) and align
Codec 4 (frame size 98) uses joint stereo per spec and examples.
Also removed an incorrect "align" var which wasn't used anyway (it was overwrittern).

Probably all/only .AT3 of frame size 98 are JS, too.

Signed-off-by: bnnm <bananaman255@gmail.com>
2017-01-30 13:01:07 +01:00
Tobias Rapp
ec33ade7d3 avformat/Makefile: fix compilation of testprogs when networking is disabled
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2017-01-30 12:14:43 +01:00
Paul B Mahol
036e12b225 avformat: add SCC muxer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-01-30 11:00:58 +01:00
Paul B Mahol
76331361a5 avformat/sccdec: simplify 2 sscanf calls
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-01-30 11:00:58 +01:00
Andreas Cadhalpun
cba4f0e97e xvag: prevent overflow during block alignment calculation
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2017-01-30 01:40:48 +01:00
Andreas Cadhalpun
74bd17d316 epafdec: prevent overflow during block alignment calculation
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2017-01-30 01:40:48 +01:00
Andreas Cadhalpun
5b0ae88ca6 genh: prevent overflow during block alignment calculation
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2017-01-30 01:40:48 +01:00
Andreas Cadhalpun
9ec8790ac4 boadec: prevent overflow during block alignment calculation
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2017-01-29 01:20:52 +01:00