]> git.sesse.net Git - ffmpeg/log
ffmpeg
4 years agoavcodec/adpcm: remove unused shift parameter from adpcm_ima_qt_expand_nibble()
Zane van Iperen [Sat, 11 Apr 2020 08:12:40 +0000 (08:12 +0000)]
avcodec/adpcm: remove unused shift parameter from adpcm_ima_qt_expand_nibble()

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
4 years agolavc/amrwbdec: Add a comment about the missing muting technique.
Carl Eugen Hoyos [Sat, 11 Apr 2020 12:23:51 +0000 (14:23 +0200)]
lavc/amrwbdec: Add a comment about the missing muting technique.

4 years agolavc/amrwbdec: Output silence for frames marked as corrupt.
Carl Eugen Hoyos [Sun, 5 Apr 2020 15:35:38 +0000 (17:35 +0200)]
lavc/amrwbdec: Output silence for frames marked as corrupt.

Fixes ticket #7113.

4 years agolavc/amrwbdec: Remove a dead comparison.
Carl Eugen Hoyos [Sat, 11 Apr 2020 12:08:49 +0000 (14:08 +0200)]
lavc/amrwbdec: Remove a dead comparison.

Modes > MODE_SID are already filtered out at this point.
Simplifies the following change.

4 years agoavcodec/aacdec: fix compilation under soft float MIPS
Rosen Penev [Mon, 6 Apr 2020 03:37:10 +0000 (20:37 -0700)]
avcodec/aacdec: fix compilation under soft float MIPS

Place HAVE_MIPSFPU further up so that functions that use floating point
ASM are defined away. Otherwise compilation failures result when soft
float in enabled on the toolchain.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years agolavfi/telecine: Mark telecined frames as interlaced.
Carl Eugen Hoyos [Sat, 4 Apr 2020 23:00:44 +0000 (01:00 +0200)]
lavfi/telecine: Mark telecined frames as interlaced.

4 years agolavf/oggparsevorbis: Use case-insensitive key compare for vorbis picture
Mattias Wadman [Sat, 11 Apr 2020 10:56:21 +0000 (12:56 +0200)]
lavf/oggparsevorbis: Use case-insensitive key compare for vorbis picture

Regression since 8d3630c5402fdda2889fe4f74f7dcdd50ebca654 where keys were changed
to not be touppered but the picture block strcmp was not changed to be case-insensitive.

Fixes ticket #8608.

4 years agolibavformat/mov: restore use of mfra time as dts
John Stebbins [Mon, 6 Apr 2020 17:42:26 +0000 (11:42 -0600)]
libavformat/mov: restore use of mfra time as dts

This was inadvertantly removed in 4a9d32baca

Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro>
4 years agoavfilter/delogo: correct indentation for option show.
Gyan Doshi [Fri, 10 Apr 2020 19:29:18 +0000 (00:59 +0530)]
avfilter/delogo: correct indentation for option show.

4 years agoavfilter/delogo: remove deprecated options
Gyan Doshi [Fri, 10 Apr 2020 18:43:04 +0000 (00:13 +0530)]
avfilter/delogo: remove deprecated options

Deprecated in 2015 in 8bc708fcee1

4 years agolavc/xsubenc: return meaningfull error codes
John Stebbins [Fri, 10 Apr 2020 18:48:01 +0000 (12:48 -0600)]
lavc/xsubenc: return meaningfull error codes

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/webvttenc: return more meaningful error codes
John Stebbins [Fri, 10 Apr 2020 18:36:23 +0000 (12:36 -0600)]
lavc/webvttenc: return more meaningful error codes

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/srtenc: return more meaninful error codes
John Stebbins [Fri, 10 Apr 2020 18:34:30 +0000 (12:34 -0600)]
lavc/srtenc: return more meaninful error codes

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: return more meaningful error codes
John Stebbins [Fri, 10 Apr 2020 18:30:10 +0000 (12:30 -0600)]
lavc/movtextenc: return more meaningful error codes

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/assenc: return more meaningful error code
John Stebbins [Fri, 10 Apr 2020 18:15:26 +0000 (12:15 -0600)]
lavc/assenc: return more meaningful error code

When the buffer is too small, return AVERROR_BUFFER_TOO_SMALL

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/dvbsub: return meaningful error codes
John Stebbins [Fri, 10 Apr 2020 18:08:46 +0000 (12:08 -0600)]
lavc/dvbsub: return meaningful error codes

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/dvbsub: fix potential encode buffer overflow
John Stebbins [Fri, 10 Apr 2020 18:07:59 +0000 (12:07 -0600)]
lavc/dvbsub: fix potential encode buffer overflow

encode buffer size was ignored

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agoChangelog: Add entry for expanded styling support in movtext
Philip Langdale [Fri, 10 Apr 2020 16:30:53 +0000 (09:30 -0700)]
Changelog: Add entry for expanded styling support in movtext

4 years agolavc/movtextenc: handle changes to hilight alpha
John Stebbins [Thu, 9 Apr 2020 19:12:39 +0000 (13:12 -0600)]
lavc/movtextenc: handle changes to hilight alpha

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: add option to scale fontsize with height
John Stebbins [Sun, 5 Apr 2020 21:02:27 +0000 (15:02 -0600)]
lavc/movtextenc: add option to scale fontsize with height

If the video dimensions are different than the ASS play_res then the
font sizes need to be adjusted to get the same apparent render size.

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: add font name handling
John Stebbins [Sun, 5 Apr 2020 20:26:02 +0000 (14:26 -0600)]
lavc/movtextenc: add font name handling

Initializes the mov text sample description from the ASS header and
creates an mov font table from the fonts available in the ASS Styles.

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: simplify initialization of new style record
John Stebbins [Sun, 5 Apr 2020 14:44:24 +0000 (08:44 -0600)]
lavc/movtextenc: simplify initialization of new style record

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: handle cancel overrides callback
John Stebbins [Sun, 5 Apr 2020 14:34:45 +0000 (08:34 -0600)]
lavc/movtextenc: handle cancel overrides callback

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: add font size tag handling
John Stebbins [Sat, 4 Apr 2020 22:46:40 +0000 (16:46 -0600)]
lavc/movtextenc: add font size tag handling

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: add alpha tag handling
John Stebbins [Sat, 4 Apr 2020 22:34:16 +0000 (16:34 -0600)]
lavc/movtextenc: add alpha tag handling

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: add color tag handling
John Stebbins [Sat, 4 Apr 2020 22:05:18 +0000 (16:05 -0600)]
lavc/movtextenc: add color tag handling

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: init style record from ASS dialog style
John Stebbins [Sat, 4 Apr 2020 21:23:34 +0000 (15:23 -0600)]
lavc/movtextenc: init style record from ASS dialog style

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: fix unclosed style records
John Stebbins [Sat, 4 Apr 2020 20:52:00 +0000 (14:52 -0600)]
lavc/movtextenc: fix unclosed style records

The last record at the end of each dialog was never closed

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: simplify style record updates
John Stebbins [Sat, 4 Apr 2020 20:43:25 +0000 (14:43 -0600)]
lavc/movtextenc: simplify style record updates

Makes style update code easier to extend for style types not yet handled

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: keep values in native byte order till written
John Stebbins [Sat, 4 Apr 2020 19:52:44 +0000 (13:52 -0600)]
lavc/movtextenc: keep values in native byte order till written

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: use correct color component order
John Stebbins [Sat, 4 Apr 2020 19:36:51 +0000 (13:36 -0600)]
lavc/movtextenc: use correct color component order

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/ass_split: fix parsing utf8 scripts
John Stebbins [Sat, 4 Apr 2020 19:17:33 +0000 (13:17 -0600)]
lavc/ass_split: fix parsing utf8 scripts

The [Script Info] section was skipped if starts with UTF8 BOM

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: allow setting subtitle frame dimensions
John Stebbins [Sat, 4 Apr 2020 18:33:54 +0000 (12:33 -0600)]
lavc/movtextdec: allow setting subtitle frame dimensions

Font sizes are relative to the subtitle frame dimensions. If the
expected frame dimensions are not known, the font sizes will most
likely be incorrect.

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: restore active style color after hilite
John Stebbins [Sat, 4 Apr 2020 18:14:48 +0000 (12:14 -0600)]
lavc/movtextdec: restore active style color after hilite

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: add color and alpha style tags
John Stebbins [Sat, 4 Apr 2020 18:06:39 +0000 (12:06 -0600)]
lavc/movtextdec: add color and alpha style tags

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: add alpha default to ass header colors
John Stebbins [Sat, 4 Apr 2020 17:53:59 +0000 (11:53 -0600)]
lavc/movtextdec: add alpha default to ass header colors

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: make sure default font name is set
John Stebbins [Sat, 4 Apr 2020 17:45:20 +0000 (11:45 -0600)]
lavc/movtextdec: make sure default font name is set

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: only write fontsize, fontID tags if not default
John Stebbins [Sat, 4 Apr 2020 17:40:57 +0000 (11:40 -0600)]
lavc/movtextdec: only write fontsize, fontID tags if not default

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: handle changes to default style flags
John Stebbins [Sat, 4 Apr 2020 17:29:53 +0000 (11:29 -0600)]
lavc/movtextdec: handle changes to default style flags

Style flags were only being turned on.  If the default was on and style
record turned off, style flag remained on.

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: fix bold, italic, underline flags
John Stebbins [Sat, 4 Apr 2020 17:21:16 +0000 (11:21 -0600)]
lavc/movtextdec: fix bold, italic, underline flags

They should be 0 or 1 so that 0 or -1 is written to the ass header

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: simplify style record walk
John Stebbins [Sat, 4 Apr 2020 17:01:43 +0000 (11:01 -0600)]
lavc/movtextdec: simplify style record walk

It's not necessary to walk the style record list twice per subtitle
character.  style records are in order and do not overlap.

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: fix ass header colors
John Stebbins [Sat, 4 Apr 2020 16:51:04 +0000 (10:51 -0600)]
lavc/movtextdec: fix ass header colors

A conversion from rgb to bgr is necessary

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc: install codec_desc.h
Anton Khirnov [Fri, 10 Apr 2020 15:06:15 +0000 (17:06 +0200)]
lavc: install codec_desc.h

Forgotten in 672946c7fe6de56ccf5d2271ad1bfeb2290f394f

4 years agoh264dec: do not set picture_structure on init
Anton Khirnov [Sun, 30 Jul 2017 12:43:33 +0000 (14:43 +0200)]
h264dec: do not set picture_structure on init

This has been cargo culted from mpegvideo and serves no useful purpose.
It will be initialize correctly in h264_field_start()

4 years agoh264dec: rename flush_dpb()
Anton Khirnov [Sat, 29 Jul 2017 19:21:50 +0000 (21:21 +0200)]
h264dec: rename flush_dpb()

The name is misleading, this function does a lot more than just flushing
the DPB.

4 years agoh264_ps: make the PPS hold a reference to its SPS
Anton Khirnov [Mon, 1 May 2017 19:42:54 +0000 (21:42 +0200)]
h264_ps: make the PPS hold a reference to its SPS

It represents the relationship between them more naturally and will be
useful in the following commits.

Allows significantly more frames in fate-h264-attachment-631 to be
decoded.

4 years agoh264_sei: parse the picture timing SEIs correctly
Anton Khirnov [Fri, 19 May 2017 08:44:59 +0000 (10:44 +0200)]
h264_sei: parse the picture timing SEIs correctly

Those SEIs refer to the currently active SPS. However, since the SEI
NALUs precede the coded picture data in the bitstream, the active SPS is
in general not known when we are decoding the SEI.

Therefore, store the content of the picture timing SEIs and actually
parse it when the active SPS is known.

4 years agoh264_sei: use a separate reader for the individual SEI messages
Anton Khirnov [Fri, 19 May 2017 08:25:08 +0000 (10:25 +0200)]
h264_sei: use a separate reader for the individual SEI messages

This tells the parsing functions the payload size and prevents them from
overreading.

4 years agoh264dec: do not abort if decoding extradata fails
Anton Khirnov [Sat, 5 Aug 2017 16:36:12 +0000 (18:36 +0200)]
h264dec: do not abort if decoding extradata fails

Such errors are not necessarily fatal and decoding might still be
possible, e.g. it happens for MVC streams where we do not handle the
subset SPS thus failing to parse its corresponding PPS.

4 years agolavc: do not implicitly share the frame pool between threads
Anton Khirnov [Tue, 17 Jan 2017 15:28:30 +0000 (16:28 +0100)]
lavc: do not implicitly share the frame pool between threads

Currently the frame pool used by the default get_buffer2()
implementation is a single struct, allocated when opening the decoder.
A pointer to it is simply copied to each frame thread and we assume that
no thread attempts to modify it at an unexpected time. This is rather
fragile and potentially dangerous.

With this commit, the frame pool is made refcounted, with the reference
being propagated across threads along with other context variables. The
frame pool is now also immutable - when the stream parameters change we
drop the old reference and create a new one.

4 years agopthread_frame: do not copy a range of AVCodecContext fields at once
Anton Khirnov [Sun, 15 Jan 2017 12:56:42 +0000 (13:56 +0100)]
pthread_frame: do not copy a range of AVCodecContext fields at once

This is extremely fragile against reordering and hides what is actually
being copied. Copy all the fields manually instead.

4 years agopthread_frame: do not embed full AVFrame structs into per-thread contexts
Anton Khirnov [Sun, 15 Jan 2017 12:46:27 +0000 (13:46 +0100)]
pthread_frame: do not embed full AVFrame structs into per-thread contexts

Use the AVFrame API to properly allocate and free frames for delayed
release.

4 years agopthread_frame: do not share priv_data between multiple codec contexts
Anton Khirnov [Sun, 15 Jan 2017 13:52:04 +0000 (14:52 +0100)]
pthread_frame: do not share priv_data between multiple codec contexts

Specifically, between the user-facing one and the first frame thread
one.

This is fragile and dangerous, allocate separate private data for each
per-thread context.

4 years agopthread_frame: merge the functionality for normal decoder init and init_thread_copy
Anton Khirnov [Mon, 9 Jan 2017 17:04:42 +0000 (18:04 +0100)]
pthread_frame: merge the functionality for normal decoder init and init_thread_copy

The current design, where
- proper init is called for the first per-thread context
- first thread's private data is copied into private data for all the
  other threads
- a "fixup" function is called for all the other threads to e.g.
  allocate dynamically allocated data
is very fragile and hard to follow, so it is abandoned. Instead, the
same init function is used to init each per-thread context. Where
necessary, AVCodecInternal.is_copy can be used to differentiate between
the first thread and the other ones (e.g. for decoding the extradata
just once).

4 years agolavc: replace AVCodecInternal.allocate_progress with an internal cap
Anton Khirnov [Mon, 9 Jan 2017 17:01:02 +0000 (18:01 +0100)]
lavc: replace AVCodecInternal.allocate_progress with an internal cap

This is a constant codec property, so a capability flag is more appropriate.

4 years agompeg4videodec: do not copy a range of fields at once
Anton Khirnov [Wed, 11 Mar 2020 17:08:28 +0000 (18:08 +0100)]
mpeg4videodec: do not copy a range of fields at once

This is extremely fragile against reordering and hides what is actually
being copied. Copy all the fields manually instead.

4 years agoavcodec.h: split AVCodecDescriptor API into its own header
Anton Khirnov [Tue, 7 Apr 2020 14:41:48 +0000 (16:41 +0200)]
avcodec.h: split AVCodecDescriptor API into its own header

4 years agoavcodec.h: split codec IDs into their own header
Anton Khirnov [Tue, 7 Apr 2020 14:41:48 +0000 (16:41 +0200)]
avcodec.h: split codec IDs into their own header

4 years agoavcodec.h: split AVPacket API into its own header
Anton Khirnov [Tue, 7 Apr 2020 14:41:48 +0000 (16:41 +0200)]
avcodec.h: split AVPacket API into its own header

4 years agowavpack: fully support stream parameter changes
Anton Khirnov [Sun, 5 Apr 2020 20:01:40 +0000 (22:01 +0200)]
wavpack: fully support stream parameter changes

Fix invalid memory access on DSD streams with changing channel count.

4 years agodecode: make sure ff_get_buffer() cleans the frame on failure
Anton Khirnov [Sun, 5 Apr 2020 08:48:33 +0000 (10:48 +0200)]
decode: make sure ff_get_buffer() cleans the frame on failure

Merge ff_get_buffer() and get_buffer_internal() to simplify the code.

4 years agopthread_frame: make sure ff_thread_release_buffer always cleans the frame
Anton Khirnov [Sun, 5 Apr 2020 08:41:35 +0000 (10:41 +0200)]
pthread_frame: make sure ff_thread_release_buffer always cleans the frame

4 years agolavc/libopenh264enc: fix the if-else coding style
Linjie Fu [Mon, 6 Apr 2020 11:14:45 +0000 (19:14 +0800)]
lavc/libopenh264enc: fix the if-else coding style

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agoavcodec/zerocodec: use init cleanup internal cap
Paul B Mahol [Thu, 9 Apr 2020 08:48:35 +0000 (10:48 +0200)]
avcodec/zerocodec: use init cleanup internal cap

4 years agoavcodec/zerocodec: implement flushing
Paul B Mahol [Thu, 9 Apr 2020 08:45:55 +0000 (10:45 +0200)]
avcodec/zerocodec: implement flushing

4 years agoavcodec: add MV30 decoder
Paul B Mahol [Tue, 18 Feb 2020 18:33:33 +0000 (19:33 +0100)]
avcodec: add MV30 decoder

4 years agoavformat/hlsenc: return media_url directly if failed to get seperator
Limin Wang [Thu, 9 Apr 2020 01:50:46 +0000 (09:50 +0800)]
avformat/hlsenc: return media_url directly if failed to get seperator

Fix ticket: 8606
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavformat/matroskaenc: Remove unnecessary headers
Andreas Rheinhardt [Thu, 9 Apr 2020 22:25:14 +0000 (00:25 +0200)]
avformat/matroskaenc: Remove unnecessary headers

subtitles.h has been included in order to use ff_subtitles_next_line()
to help parsing srt subtitles which at that time had their timing as
part of the payload and not as part of the AVPacket fields. When this
changed (in 55180b32) it has been forgotten to remove this header.

libavcodec/internal.h meanwhile has been added in bb47aa5850c and has
never been used at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/jpeg2000dec: Fix mixed declaration and code
Andreas Rheinhardt [Thu, 9 Apr 2020 12:37:37 +0000 (14:37 +0200)]
avcodec/jpeg2000dec: Fix mixed declaration and code

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/mpeg: Don't use unintialized value
Andreas Rheinhardt [Tue, 22 Oct 2019 12:54:09 +0000 (14:54 +0200)]
avformat/mpeg: Don't use unintialized value

vobsub_read_packet() didn't check whether an array of AVPackets was
valid and therefore used uninitialized values.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavfilter/ebur128: prefer to use variable instead of type for sizeof
Limin Wang [Thu, 9 Apr 2020 11:07:20 +0000 (19:07 +0800)]
avfilter/ebur128: prefer to use variable instead of type for sizeof

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolibavcodec/jpeg2000dec.c: Add support for PPT marker
Gautam Ramakrishnan [Tue, 7 Apr 2020 16:57:13 +0000 (22:27 +0530)]
libavcodec/jpeg2000dec.c: Add support for PPT marker

This patch adds functional changes to support the
PPT marker. This patch fixes bug ticket #4610.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/v4l2_context: Use av_freep()
Andriy Gelman [Sun, 5 Apr 2020 05:36:13 +0000 (01:36 -0400)]
avcodec/v4l2_context: Use av_freep()

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years agoavfilter/vf_drawtext: only test available exceptions
Rosen Penev [Tue, 7 Apr 2020 00:38:59 +0000 (17:38 -0700)]
avfilter/vf_drawtext: only test available exceptions

soft float systems do not define these macros under musl.

Fixes: Ticket7102
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years agoavformat/segment: always use interleaved writes for formats with custom interleaving
Marton Balint [Tue, 31 Mar 2020 23:03:29 +0000 (01:03 +0200)]
avformat/segment: always use interleaved writes for formats with custom interleaving

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/hlsenc: use av_asprintf()
Limin Wang [Thu, 26 Mar 2020 13:57:00 +0000 (21:57 +0800)]
avformat/hlsenc: use av_asprintf()

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavformat/hlsenc: Factor out deleting files from deleting segments
Andreas Rheinhardt [Wed, 8 Apr 2020 13:23:03 +0000 (15:23 +0200)]
avformat/hlsenc: Factor out deleting files from deleting segments

Removes code duplication.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat: add subtitle support in master playlist m3u8
Limin Wang [Sun, 29 Mar 2020 11:13:44 +0000 (19:13 +0800)]
avformat: add subtitle support in master playlist m3u8

Test with the following command for the webvtt subtitle:
$ ./ffmpeg -y -i input_with_subtitle.mkv \
 -b:v:0 5250k -c:v h264 -pix_fmt yuv420p -profile:v main -level 4.1 \
 -b:a:0 256k \
 -c:s webvtt -c:a mp2 -ar 48000 -ac 2 -map 0:v -map 0:a:0 -map 0:s:0 \
 -f hls -var_stream_map "v:0,a:0,s:0,sgroup:subtitle" \
 -master_pl_name master.m3u8 -t 300 -hls_time 10 -hls_init_time 4 -hls_list_size \
 10 -master_pl_publish_rate 10  -hls_flags \
 delete_segments+discont_start+split_by_time ./tmp/video.m3u8

Check the master m3u8:
$ cat tmp/master.m3u8
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitle",NAME="subtitle_0",DEFAULT=YES,URI="video_vtt.m3u8"
#EXT-X-STREAM-INF:BANDWIDTH=6056600,RESOLUTION=1280x720,CODECS="avc1.4d4829,mp4a.40.33",SUBTITLES="subtitle"
video.m3u8

Check the result by convert to mkv:
$ ./ffmpeg -strict experimental -i ./tmp/master.m3u8 -c:v copy -c:a mp2 -c:s srt ./test.mkv

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavformat/hlsplaylist: simplify code for checking whether the string is empty
Limin Wang [Thu, 26 Mar 2020 13:56:58 +0000 (21:56 +0800)]
avformat/hlsplaylist: simplify code for checking whether the string is empty

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavformat/hlsenc: remove the first slash of the relative path line in the master m3u8...
Limin Wang [Thu, 26 Mar 2020 13:56:57 +0000 (21:56 +0800)]
avformat/hlsenc: remove the first slash of the relative path line in the master m3u8 file

Please testing with the following command:
./ffmpeg -y -i input.mkv \
 -b:v:0 5250k -c:v h264 -pix_fmt yuv420p -profile:v main -level 4.1 \
 -b:a:0 256k \
 -c:a mp2 -ar 48000 -ac 2 -map 0:v -map 0:a:0\
 -f hls -var_stream_map "v:0,a:0" \
 -master_pl_name master.m3u8 -t 300 -hls_time 10 -hls_init_time 4 -hls_list_size \
 10 -master_pl_publish_rate 10  -hls_flags \
 delete_segments+discont_start+split_by_time ./tmp/video.m3u8

then cat ./tmp/master.m3u8
before:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=6056600,RESOLUTION=1280x720,CODECS="avc1.4d4829,mp4a.40.33"
/video.m3u8

$ ./ffmpeg -i  ./tmp/master.m3u8 -c:v copy -c:a mp2 ./test.mkv
[hls @ 0x7f82f9000000] Skip ('#EXT-X-VERSION:3')
[hls @ 0x7f82f9000000] Opening '/video.m3u8' for reading
[hls @ 0x7f82f9000000] parse_playlist error No such file or directory [/video.m3u8]
./tmp/master.m3u8: No such file or directory

after:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=6056600,RESOLUTION=1280x720,CODECS="avc1.4d4829,mp4a.40.33"
video.m3u8

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavformat/hlsenc: Use AVBPrint to avoid allocations of strings
Andreas Rheinhardt [Wed, 8 Apr 2020 11:14:17 +0000 (13:14 +0200)]
avformat/hlsenc: Use AVBPrint to avoid allocations of strings

when deleting old segments.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/hlsenc: Fix memleak when deleting old segments
Andreas Rheinhardt [Wed, 8 Apr 2020 10:19:39 +0000 (12:19 +0200)]
avformat/hlsenc: Fix memleak when deleting old segments

if the directory name of the segments contains "%v".

This memleak is caused by masking the pointer that will eventually
be freed by a variable of the same name in a smaller scope.
Therefore the pointer that gets freed is always NULL when it is
freed and the allocated data leaks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/smacker: Cosmetics
Andreas Rheinhardt [Sun, 29 Mar 2020 08:28:29 +0000 (10:28 +0200)]
avformat/smacker: Cosmetics

This is mainly about improving legibility of the code and getting rid of
overlong lines by using variables for st->codecpar instead of accessing
the codecparameters via st->codecpar->.

Also, some code has been moved to better fitting places.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/smacker: Remove unused structure
Andreas Rheinhardt [Sun, 29 Mar 2020 07:03:02 +0000 (09:03 +0200)]
avformat/smacker: Remove unused structure

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/smacker: Only store what is needed later
Andreas Rheinhardt [Sun, 29 Mar 2020 06:42:15 +0000 (08:42 +0200)]
avformat/smacker: Only store what is needed later

This commit removes data that is only used during smacker_read_header()
from the demuxer's context and replaces the data that is used by local
variables. The other data is completely dropped.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/smacker: Create audio streams immediately
Andreas Rheinhardt [Sun, 29 Mar 2020 06:19:45 +0000 (08:19 +0200)]
avformat/smacker: Create audio streams immediately

The Smacker demuxer currently parses several fields that indicate
how many audio streams a file contains. This data is parsed and stored
into arrays in the demuxer's context and although the data is used only
to initialize the audio streams, it is kept for the whole lifetime of
the demuxer.

This has been changed: The data is used directly to create
the audio streams and no longer kept at all.

This also simplifies error handling in case adding a new stream fails:
Several arrays which until now have been allocated between parsing the
data determining how many audio streams to create and actually creating
them would need to be freed in this case. Now the streams are created
first, so freeing is no longer an issue.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/smacker: Read extradata directly into extradata
Andreas Rheinhardt [Sun, 29 Mar 2020 04:40:57 +0000 (06:40 +0200)]
avformat/smacker: Read extradata directly into extradata

The Smacker demuxer reads four consecutive 32bit values from the file
header into its demux context (as four uint32_t), converting it to
native endianness in the process and then writing these four values
later (after extradata has been allocated) to extradata as four 32bit
values (converting to little endian in the process).

This commit changes this: The stream and the extradata are allocated
earlier, so that the data destined for extradata can be read directly
into extradata.

Furthermore, given that these values are not needed for demuxing itself
they are now no longer kept as part of the demuxing context.

Finally, a check regarding the number of frames has been moved up,
too, in order to exit early before unnecessarily allocating the
stream and the extradata.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/flacdsp_template: Fix invalid shifts in decorrelate
Michael Niedermayer [Sat, 1 Feb 2020 21:52:13 +0000 (22:52 +0100)]
avcodec/flacdsp_template: Fix invalid shifts in decorrelate

Fixes: left shift of negative value -2
Fixes: 20303/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLAC_fuzzer-5096829297623040
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agotools/target_dec_fuzzer: Adjust threshold for screenpresso
Michael Niedermayer [Wed, 29 Jan 2020 18:25:31 +0000 (19:25 +0100)]
tools/target_dec_fuzzer: Adjust threshold for screenpresso

Fixes: Timeout (332 -> 21 sec)
Fixes: 20280/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SCREENPRESSO_fuzzer-6238663432470528
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/xvididct: Fix integer overflow in MULT()
Michael Niedermayer [Fri, 31 Jan 2020 22:43:57 +0000 (23:43 +0100)]
avcodec/xvididct: Fix integer overflow in MULT()

Fixes: signed integer overflow: 23170 * 95058 cannot be represented in type 'int'
Fixes: 20295/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEG_fuzzer-5800212870463488
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/ffwavesynth: Correct undefined overflow of PINK_UNIT
Michael Niedermayer [Fri, 17 Jan 2020 22:42:08 +0000 (23:42 +0100)]
avcodec/ffwavesynth: Correct undefined overflow of PINK_UNIT

Fixes: signed integer overflow: 9223372036854775775 + 128 cannot be represented in type 'long'
Fixes: 20054/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFWAVESYNTH_fuzzer-5686385113825280
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/ilbc: Add missing #if for muxer
Michael Niedermayer [Tue, 7 Apr 2020 14:55:41 +0000 (16:55 +0200)]
avformat/ilbc: Add missing #if for muxer

Fixes: building without muxers
Fixes: 21594
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/webmdashenc: Use AVCodecDescriptors for codec names
Andreas Rheinhardt [Mon, 30 Mar 2020 01:09:41 +0000 (03:09 +0200)]
avformat/webmdashenc: Use AVCodecDescriptors for codec names

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/webmdashenc: Check codec types
Andreas Rheinhardt [Mon, 30 Mar 2020 00:50:02 +0000 (02:50 +0200)]
avformat/webmdashenc: Check codec types

The WebM DASH Manifest muxer only supports VP8, VP9, Vorbis and Opus,
but there was no check for this. The codec type is used to get a pointer
to a string containing the codec name or NULL if it is not one of those
four codecs. Said pointer has then been used without further checks as
string for the %s conversion specifier in an avio_printf()) call which
is undefined behaviour.

This commit adds a check for the supported codec types.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agomov: Support fake moov boxes disguised as hoov
Vittorio Giovara [Thu, 8 Aug 2019 20:28:26 +0000 (22:28 +0200)]
mov: Support fake moov boxes disguised as hoov

Some broken apps generate files that have a fake box named 'hoov'
instead of a proper 'moov' one. This is speculation but it seems like
this box contains data to be modified later (eg as file grows in size,
data gets re-written) and its name is supposed to be changed to 'moov'
once it can be used as a 'moov', but for some reason this step is skipped.

Since this is not the first time this happens ('moov' boxes can be found
in 'free' ones) extend the existing hacks to search for the moov in such
boxes and skip the moov_retry since it needs to be found right away.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
4 years agohwcontext_vulkan: only use one semaphore per image
Lynne [Mon, 6 Apr 2020 17:18:50 +0000 (18:18 +0100)]
hwcontext_vulkan: only use one semaphore per image

The idea was to allow separate planes to be filtered independently, however,
in hindsight, literaly nothing uses separate per-plane semaphores and it
would only work when each plane is backed by separate device memory.

4 years agoavfilter/vf_xfade: add slice transitions
Paul B Mahol [Tue, 7 Apr 2020 11:48:38 +0000 (13:48 +0200)]
avfilter/vf_xfade: add slice transitions

4 years agoavcodec/vp3: propagate error codes
Peter Ross [Sun, 5 Apr 2020 05:44:44 +0000 (15:44 +1000)]
avcodec/vp3: propagate error codes

throughout vp3_decode_frame the error code was being captured (ret) but never returned.

Signed-off-by: Peter Ross <pross@xvid.org>
Reviewed-by: Anton Khirnov <anton@khirnov.net>
4 years agoavfilter/vf_derain.c: put all the calculation in model file.
Guo, Yejun [Fri, 20 Mar 2020 12:54:07 +0000 (20:54 +0800)]
avfilter/vf_derain.c: put all the calculation in model file.

currently, the model outputs the rain, and so need a subtraction
in filter c code to get the final derain result.

I've sent a PR to update the model file and accepted, see at
https://github.com/XueweiMeng/derain_filter/pull/3

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agodnn-layer-mathbinary-test: add unit test for subtraction
Guo, Yejun [Sat, 21 Mar 2020 02:58:11 +0000 (10:58 +0800)]
dnn-layer-mathbinary-test: add unit test for subtraction

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>