Commit Graph

19723 Commits

Author SHA1 Message Date
Carl Eugen Hoyos
fca3083282 lavf/img2dec: Reduce the probe score for incomplete jpgs.
Ensures that probing doesn't finish prematurely for small files.
2017-01-27 08:31:07 +01:00
James Almer
1ae39429e4 avformat/matroskadec: ProjectionPrivate is optional on Equirectangular projections
This reflects a recent change to the spec draft.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-01-26 19:28:19 -03:00
Joel Cunningham
f3778108d3 tcp: set socket buffer sizes before listen/connect/accept
From e24d95c0e06a878d401ee34fd6742fcaddeeb95f Mon Sep 17 00:00:00 2001
From: Joel Cunningham <joel.cunningham@me.com>
Date: Mon, 9 Jan 2017 13:37:51 -0600
Subject: [PATCH] tcp: set socket buffer sizes before listen/connect/accept

Attempting to set SO_RCVBUF and SO_SNDBUF on TCP sockets after connection
establishment is incorrect and some stacks ignore the set call on the socket at
this point.  This has been observed on MacOS/iOS.  Windows 7 has some peculiar
behavior where setting SO_RCVBUF after applies only if the buffer is increasing
from the default while decreases are ignored.  This is possibly how the incorrect
usage has gone unnoticed

Unix Network Programming Vol. 1: The Sockets Networking API (3rd edition, seciton 7.5):

"When setting the size of the TCP socket receive buffer, the ordering of the
function calls is important.  This is because of TCP's window scale option,
which is exchanged with the peer on SYN segments when the connection is
established. For a client, this means the SO_RCVBUF socket option must be
set before calling connect.  For a server, this means the socket option must
be set for the listening socket before calling listen.  Setting this option
for the connected socket will have no effect whatsoever on the possible window
scale option because accept does not return with the connected socket until
TCP's three-way handshake is complete.  This is why the option must be set on
the listening socket. (The sizes of the socket buffers are always inherited from
the listening socket by the newly created connected socket)"

Signed-off-by: Joel Cunningham <joel.cunningham@me.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-01-26 20:19:18 +01:00
Frank Liberato
95bde49982 avformat/flacdec: Check avio_read result when reading flac block header.
Return AVERROR_INVALIDDATA if all four bytes aren't present.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-01-25 22:08:28 +01:00
Paul B Mahol
45ff6ef50e avformat: add Scenarist Closed Captions demuxer
Fixes #4767.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-01-25 12:00:02 +01:00
Paul B Mahol
b953aec3c4 avformat: add Sample Dump eXchange demuxer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-01-25 12:00:02 +01:00
Carl Eugen Hoyos
a135b017de lavf/mov: Unscramble dref debug output. 2017-01-25 11:49:04 +01:00
compn
5316ed899f isom: map xalg and avlg to h264, fixes ticket #6099 2017-01-24 23:46:38 -05:00
Carl Eugen Hoyos
75bd4ea024 lavf/rtmpproto: Make bytes_read variables 64bit.
When bytes_read overflowed, last_bytes_read did not yet overflow
and no bytes-read report was created leading to a timeout.

Analyzed-by: Thomas Bernhard

Fixes ticket #5836.
2017-01-25 00:39:13 +01:00
Steven Liu
1033f56b07 avformat/hlsenc: improve to write m3u8 head block
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-01-24 22:25:29 +08:00
Steven Liu
1bb192ef6c avformat/flvenc: refine the flvenc shift_data code
refine the flvenc shift_data move data option

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-01-24 12:31:36 +08:00
Steven Liu
2f7cc21b61 avformat/hlsenc: refine the code readable for time unit
Reviewed-by: Bodecs Bela <bodecsb@vivanet.hu>
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-01-24 12:29:01 +08:00
Felipe Astroza
b7665642f1 libavformat/tee: tee was passing a wrong option name for fifo's format_options
If fifo is enabled on tee muxer, ffmpeg exits because of an unknown option passed to fifo muxer.
Option name "format_options" was replaced by "format_opts" on tee muxer.

Signed-off-by: Felipe Astroza <felipe@astroza.cl>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-01-24 02:36:51 +01:00
Rodger Combs
2b20290061
lavf/segment: fix crash when failing to open segment list
This happens because segment_end() returns an error, so seg_write_packet
never proceeds to segment_start(), and seg->avf->pb is never re-set,
so we crash with a null pb when av_write_trailer flushes the packet
queue.

This doesn't seem to be clearly recoverable, so I'm just failing more
gracefully.

Repro:
ffmpeg -i input.ts -f segment -c copy -segment_list /noaxx.m3u8 test-%05d.ts

(assuming you don't have write access to /)
2017-01-23 05:44:49 -06:00
Paul B Mahol
7f9978b0bd avformat: add MIDI Sample Dump Standard demuxer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-01-22 13:00:25 +01:00
Paul B Mahol
8869f5efec avformat/wavdec: enable seeking with XMA2
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-01-20 13:58:41 +01:00
Steven Liu
1c1031003b avformat/hlsenc: fix too many open files bug
When use http method to delete the old segments,
there is only io_open, hove not io_close yet,
this patch is used to fix it

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-01-20 12:12:02 +08:00
Piotr Bandurski
bcfa8551a1 avformat/caf: add 'aacl' codec tag
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-01-19 02:40:43 +01:00
Tobias Rapp
c324e2c5db ffmpeg: pass output stream duration as a hint to the muxer
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-01-19 01:54:49 +01:00
Paul B Mahol
6c43f33ac2 avcodec/wmaprodec: >2 channel support for XMA
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-01-19 00:37:26 +01:00
Steven Liu
b05d0274ce avformat/hlsenc: fix bug of hlsenc http delete old segments
when push hls to http server, the old segemnts can not delete by hls formats.
so add the http option into hls_delete_old_segments

Reported-by: Yin Jiaoyuan <yinjiaoyuan@163.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-01-19 07:06:50 +08:00
Steven Liu
83a9cf3603 avformat/hlsenc: remove debug message used error level log
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-01-18 23:18:41 +08:00
Michael Niedermayer
b05d8e7184 libavformat/mpegtsenc: support hevc with missing in stream headers like h.264
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-01-17 20:36:34 +01:00
Carl Eugen Hoyos
e664730271 configure: Fix standalone compilation of aiff and caf muxers. 2017-01-16 12:03:21 +01:00
Paul B Mahol
591be9e384 avformat/aadec: use avio_get_str()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-01-16 10:24:02 +01:00
Paul B Mahol
e0665d385e avformat/aadec: stop ignoring file metadata
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-01-16 10:24:01 +01:00
Paul B Mahol
40cf943714 avcodec: add SIPR parser
Fixes #2056.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-01-16 10:24:01 +01:00
Andreas Cadhalpun
367cac7827 libopenmpt: add missing avio_read return value check
This fixes heap-buffer-overflows in libopenmpt caused by interpreting
the negative size value as unsigned size_t.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Reviewed-by: Jörn Heusipp <osmanx@problemloesungsmaschine.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-01-16 02:54:04 +01:00
Rostislav Pehlivanov
e7dec52d4d matroskaenc: remove unofficial compliance on color information
When support for this was added the details weren't yet finalized.
This is no longer the case.
Fixes writing of mkv/webm files with HDR.

Reported-by: Kagami Hiiragi <kagami@genshiken.org>
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Reviewed-by: James Almer <jamrial@gmail.com>
2017-01-15 17:49:21 +00:00
Carl Eugen Hoyos
935404923d Cosmetics: Reindent after last commit. 2017-01-14 06:07:06 +01:00
Carl Eugen Hoyos
c723108e25 lavf/matroskaenc: Do not write two CodecID elements for rawvideo.
Fixes ticket #6068.
2017-01-14 06:06:05 +01:00
Steven Liu
3222786c5a avformat/hlsenc: refine the hlsenc code
because the oc have been  potint to hls->avf or hls->vtt_avf
here is not needed point once again

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-01-13 07:59:48 +08:00
Steven Liu
b97e9cba0b avformat/hlsenc: fix hlsenc bug at windows system
when hlsenc use flag second_level_segment_index,
second_level_segment_size and second_level_segment_duration,
the rename is ok but the output filename always use the old filename
so move the rename operation after the close the ts file and
before open new segment

Reported-by: Christian Johannesen <chrisjohannesen@gmail.com>
Reviewed-by: Bodecs Bela <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-01-13 07:57:22 +08:00
Carl Eugen Hoyos
2f94b305ac lavf/mxf: Add a universal label for ProRes used in FCP.
Fixes ticket #6075.
2017-01-12 23:24:39 +01:00
Carl Eugen Hoyos
f31bac596f lavf/dss: Do not fail randomly if dss_sp input contains 0xff.
Fixes decoding the sample from ticket #6072 with ffmpeg.
2017-01-12 15:02:42 +01:00
Nicolas George
57789cfb9d lavf/hlsenc: fix typo in last commit. 2017-01-12 14:01:22 +01:00
Bodecs Bela
8811d6d9a0 avformat/hlsenc: hls_start_number_source and start_number
start_number option starts the playlist sequence number
(#EXT-X-MEDIA-SEQUENCE) from the specified number. Unless hls_flags
single_file is set, it also specifies starting sequence numbers of
segment and subtitle filenames. Sometimes it is usefull to have unique
starting numbers at each run, but currently it is only achiveable by
setting this parameter manually.
This patch enables to specify start_number source parameter by
introducing hls_start_number_source with 3 possible values:
generic/epoch/datetime. This ensures to set start sequence number
automatically for practically unique numbers. Generic option is the
default and this is the curent behaviour: start_number option value
specifies the start sequence number. (start_number default value is 0)
If hls_start_number_source is set to epoch, then the start number will
be the seconds since epoch (1970-01-01 00:00:00). If set to datetime,
then the start sequence number will be based on the current date/time
value as YYYYmmddHHMMSS. e.g. 20161231235659.
Hls speficication allows 64 bit integers as sequence numbers. This patch
also changes some code where only 32 bit integer values were handled
correctly.

Reviewed-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-01-12 20:43:10 +08:00
Carl Eugen Hoyos
f55da2200d lavf/dss: Support version 3 files / files with larger header.
Fixes ticket #6072.
2017-01-11 18:27:00 +01:00
Steinar H. Gunderson
2a293ec7ac avcodec: add Newtek SpeedHQ decoder
This decoder can decode all existing SpeedHQ formats (SHQ0–5, 7, and 9),
including correct decoding of the alpha channel.

1080p is decoded in 142 fps on one core of my i7-4600U (2.1 GHz Haswell),
about evenly split between bitstream reader and IDCT. There is currently
no attempt at slice or frame threading, even though the format trivially
supports both.

NewTek very helpfully provided a full set of SHQ samples, as well as
source code for an SHQ2 encoder (not included) and assistance with
understanding some details of the format.
2017-01-11 16:02:10 +01:00
Steven Liu
daff04bd18 avformat/hlsenc: fix the bug when the largest segment duration pointer right value is 0
when the segments largest duration value is look like 4.000000, the
EXT-X-TARGETDURATION value should equ 4.
it's wrong when hlsenc use ceil, so fix it.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-01-11 04:38:34 +08:00
Steven Liu
2deafd9898 avformat/hlsenc: fix hls start and tail segment duration
problem

fix ticket: #6067

Tested-by: Pero
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-01-11 04:33:13 +08:00
Paul B Mahol
fd010406c0 avformat/riff: extend MagicYUV fourcc list
Newer version of encoder can create such files.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-01-07 17:26:33 +01:00
softworkz
20e8be0c20 avformat/matroskaenc: Regression fix for invalid MKV headers
The following three commits created a regression by writing initially
invalid mkv headers:

650e17d88b avformat/matroskaenc: write a
CRC32 element on Tags
3bcadf8227 avformat/matroskaenc: write a
CRC32 element on Info
ee888cfbe7 avformat/matroskaenc: postpone
writing the Tracks master

Symptoms:

- You can no longer playback a file that is still processed by ffmpeg,
e.g. VLC fails playback
- You can no longer stream a file to a client while if is still being
processed
- Various diagnosing tools show header errors or incomplete headers
(e.g. ffprobe, mediainfo, mkvalidator)

Note: The symptoms do not apply to completed files or ffmpeg runs that
were interrupted with 'q'

Cause:

The mentioned commits made changes in a way that some header elements
are only partially written in
mkv_write_header, leaving the header in an invalid state. Only in
mkv_write_trailer, these elements
are finished correctly, but that does only occur at the end of the
process.

Regression:

Before these commits were applied, mkv headers have always been valid,
even before completion of ffmpeg.
This has worked reliably over many versions of ffmpeg, to it was an
obvious regression.

Bugtracker:

This issue has been recorded as #5977 which is resolved by this patch

Patch:

The patch adds a new function 'end_ebml_master_crc32_preliminary' that
preliminarily finishes the ebml
element without destroying the buffer. The buffer can be used to update
the ebml element later during
mkv_write_trailer. But most important: mkv_write_header finishes with a
valid mkv header again.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-01-07 11:20:36 -03:00
softworkz
9488032e10 libavformat/avio: Add avio_get_dyn_buf function
This commit adds the avio_get_dyn_buf function which allows accessing
the
content of a DynBuffer without destroying it.

This is required in matroskaenc for preliminary writing (correct) mkv
headers.

Context for this change is fixing regression bug #5977.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-01-07 13:04:05 +01:00
Andreas Cadhalpun
d74c471a39 omadec: fix overflows during bit rate calculation
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2017-01-06 19:58:42 +01:00
Steven Liu
d1f3e475f9 avformat/test/fifo_muxer: add check for FailingMuxerPacketData alloc
CID: 1396257

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-01-06 06:35:32 +08:00
Steven Liu
57ae94a3c0 avformat/hlsenc: fix Explicit null dereferenced in hlsenc
CID: 1398228
Passing null pointer dirname to strlen, which dereferences it.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-01-06 06:29:12 +08:00
Bela Bodecs
4c63910bdb vformat/hlsenc: typo in default localtime pattern
in get_default_pattern_localtime_fmt the default pattern contains
%Y%m%d%H%I%S but the original intention was %Y%m%d%H%M%S

Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-01-05 19:25:38 +08:00
Steven Liu
93593674bc avformat/hlsenc: fix memleak in hlsenc
fix CID: 1398364 Resource leak
refine the code of the new options

Reviewed-by: Bodecs Bela <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-01-05 17:08:09 +08:00
Bela Bodecs
8c9c43fc43 avformat/hlsenc: bugfix in duplicate filename detection
A wrong, unitialized variable is used for testing. This patch fixes this
typo.

Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-01-05 07:39:00 +08:00