1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00
Commit Graph

19707 Commits

Author SHA1 Message Date
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
Carl Eugen Hoyos
38e4bcae09 lavf/matroska: Fix the codec_id for mkv tag A_MPEG/L1.
When the mapping was originally added AV_CODEC_ID_MP1 did not exist.
2017-01-04 12:48:09 +01:00
Bela Bodecs
557c0df9a8 avformat/hlsenc: size and duration in segment filenames
1st:
This patch makes it possible to put actual segment file size (measured
in bytes) and/or duration (calculated in microseconds) into segment
filenames. This feature is useful when post-processing live streaming
access log files. New behaviour works only when -use_localtime option
is set and second_level_segment_size or/and
second_level_segment_duration new hls_flags are specified. %%s is the
placeholder for size and %%t for duration in hls_segment_filename
option. Fix sized trailing zeropadding also works eg. %%09s or %%023t.

A command to test new features:
./ffmpeg -loglevel info -y -f lavfi -i color=c=red:size=640x480:r=25 -f
lavfi -i sine=f=440:b=4:r=44100 -c:v mpeg2video -g 25 -acodec aac
-cutoff 20000 -ac 2 -ar 44100 -ab 192k -f hls -hls_time 3 -hls_list_size
5 -hls_flags
second_level_segment_index+second_level_segment_size+second_level_segment_duration
-use_localtime 1 -use_localtime_mkdir 1 -hls_segment_filename
"segment_%Y%m%d%H%M%S_%%04d_%%08s_%%013t.ts" stream.m3u8

2nd:
doc/muxers: beside second_level_segment_duration and second_level_segment_size,
added some more details and example to hls_segment_filename,
use_localtime, use_localtime_mkdir, hls_flags. hls_flags option list
reformatted to table

Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-01-03 22:57:51 +08:00
Tobias Rapp
5796048f6a avformat/avidec: clean-up identifier names
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-01-03 13:46:55 +01:00
Michael Niedermayer
4221c68edb avformat/flvenc: Check for extradata allocation failure
Fixes CID1396539

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-01-03 03:25:25 +01:00
Steven Liu
16ff54664a avformat/rtmphttp: fix bug for rtmphttp
if the http server don't response the http command,
then the thread will be blocked and never be interrupted.

Reported-by: yinyunjiang <yinyunjiang1991@qq.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-01-02 19:35:47 +01:00
Carl Eugen Hoyos
375a22a472 lavf/img2dec: Increase detection score of jpgs without EOI.
Also increases the score for large jpeg files.
Fixes autodetection for the file from mpv issue 3973.
2017-01-01 18:59:57 +01:00
Bela Bodecs
03a69bd897 avformat/hlsenc: Duplicated segment filenames and use_localtime_mkdir
Current implementation of finding duplicate segment filenames may fail
if use_localtime_mkdir and use_localtime are in effect and
segment_filename option expression contains subdirectories with
date/time specifiers. This patch fixes this false behaviour.

Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-01-01 20:22:34 +08:00
Bela Bodecs
8fd3e02eee libavformat/hlsenc: default segment name and use_localtime
in hlcenc.c, in the hls_write_header() function the default format
string for strftime() function contains %s specifier when use_localtime
is true. This %s specifier will insert the seconds since EPOCH. But %s
is not available on all system/environment. This patch check %s
availabilty at runtine and alter the default format string if necessary.

Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-01-01 11:00:45 +08:00
Matt Wolenetz
fe7547d69e lavf/utils.c Protect against accessing entries[nb_entries]
In ff_index_search_timestamp(), if b == num_entries,
m == num_entries - 1, and entries[m].flags & AVINDEX_DISCARD_FRAME is
true, then the search for the next non-discarded packet could access
entries[nb_entries], exceeding its bounds. This change adds a protection
against that scenario. Reference: https://crbug.com/666770

Reviewed-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-30 00:11:18 +01:00
Bela Bodecs
9ec52a0a9b libavformat/hlsenc: fix delete_segments when use_localtime_mkdir
When delete_segments hls_flag is specified, deleting old segments may
fail in certain cases when use_localtime_mkdir is in effect and
hls_segment_filename expression contains subdirs. This patch fixes this
behaviour.

Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2016-12-29 12:00:20 +08:00
Jan Sebechlebsky
7c91ee01cc libavformat/tee: Add fifo support for tee
Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
2016-12-28 16:18:15 +01:00
Bodecs Bela
0ff8c6b6d5 avformat/hlsenc: strftime identifiers and segment index
in filenames

Putting date/time values into segment filenames is very usefull.
But to produce non-conflicting segment filenames with -use_localtime
option with date/time
values in hls_segment_filename option, sometimes is not enough.
Like in cases when multiple segments produced in the same second.
But hlsenc currently does not make possible to use segment index (%d) at
the

same time whe use_localtime is in effect, due to identifier conflict.
This patch makes possible to use strftime identifiers and still put
segment index (%d) at same time in segment filenames by introducing
second_level_segment_index flag. When -use_localtime is active,
identifier %d is for month day index, so %%d is the segment index
placeholder. This enhanced behaviour only exists when new
second_level_segment_index flag is specified.
For instance putting 'segment_%Y%m%d%H%M%S_%%05d.ts' value into
-hls_segment_filename option and specifing -hls_flags
second_level_segment_index and -use_localtime 1, may produce segment
filename as 'segment_20161230235758_00002.ts'

An example:

ffmpeg -loglevel info -y -f lavfi -i color=c=red:size=640x480:r=25 -f
lavfi -i anullsrc=r=44100:cl=stereo -c:v mpeg2video -g 25 -acodec aac
-cutoff 20000 -ac 2 -ar 44100 -ab 192k -f hls -hls_time 3 -hls_list_size
5 -hls_flags delete_segments+second_level_segment_index -use_localtime 1
-hls_segment_filename "segment_%Y%m%d%H%M%S_%%05d.ts" stream.m3u8

will produce segments filenames:

....
segment_20161227005902_00013.ts
segment_20161227005902_00014.ts
segment_20161227005902_00015.ts
segment_20161227005903_00016.ts
segment_20161227005903_00017.ts
segment_20161227005903_00018.ts
segment_20161227005903_00019.ts
segment_20161227005903_00020.ts
....

Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
2016-12-27 10:40:35 +08:00
Jesper Ek
c7c0046efc Fix bug when incrementing initial_prog_date_time when removing segments
initial_prog_date_time shouldn't be adjusted when deleting segments
from disk, but rather when segments are removed from the playlist.

Signed-off-by: Jesper Ek <deadbeef84@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2016-12-27 10:10:44 +08:00
Michael Niedermayer
b347ca9341 avformat/matroskadec: Fix OOM on long streams
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-27 02:48:19 +01:00
Bela Bodecs
e7fbd70189 avformat/hlsenc: detecting duplicated segment filenames
ffmpeg-devel

with use_localtime parameter hlsenc may produce identical filenames for
different but still existing segments. It happens when
hls_segment_filename contains
syntacticaly correct but inadequate format parameters. Currently there
is no any log message when such a situaton occurs but these cases should
be avoided in most times. This patch generate warning log messages in
these cases.

ticketID: #6043

Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lingjiujianke@gmail.com>
2016-12-26 18:14:40 +08:00
Tobias Rapp
6d579d7c1b avformat/avidec: skip odml master index chunks in avi_sync
Fixes pts gaps when reading AVI files > 256GiB generated by FFmpeg.

Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-23 21:47:47 +01:00