1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-02 03:06:28 +02:00
Commit Graph

94962 Commits

Author SHA1 Message Date
Aman Gupta
bad8365b2b avcodec/v4l2_context: return {decoder,encoder}_cmd errors
Signed-off-by: Aman Gupta <aman@tmm1.net>
2019-09-02 15:06:45 -07:00
Aman Gupta
6852b85020 avcodec/v4l2_m2m_enc: fix typo in log message
Signed-off-by: Aman Gupta <aman@tmm1.net>
2019-09-02 15:06:38 -07:00
Aman Gupta
dc180cd815 avcodec/v4l2_m2m_enc: log errno on v4l2_set_ext_ctrl failures
Signed-off-by: Aman Gupta <aman@tmm1.net>
2019-09-02 15:06:32 -07:00
Aman Gupta
5e2436c6de avcodec/v4l2_buffers: fix minor typos and whitespace
Signed-off-by: Aman Gupta <aman@tmm1.net>
2019-09-02 15:06:28 -07:00
Aman Gupta
87daee944b avcodec/v4l2_context: log VIDIOC_REQBUFS failures
Signed-off-by: Aman Gupta <aman@tmm1.net>
2019-09-02 15:06:22 -07:00
Aman Gupta
7b092a074b avcodec/v4l2_m2m: remove trailing whitespace in output identifier
Signed-off-by: Aman Gupta <aman@tmm1.net>
2019-09-02 15:06:17 -07:00
Aman Gupta
3a5bcb1d13 avcodec/v4l2_m2m: log requested pixel formats
Signed-off-by: Aman Gupta <aman@tmm1.net>
2019-09-02 15:06:12 -07:00
Andriy Gelman
ef43a4d6b3 avformat: Add ZeroMQ as a protocol
When ffmpeg was streaming, multiple clients were only supported by using a
multicast destination address. An alternative was to stream to a server which
re-distributes the content. This commit adds ZeroMQ as a protocol, which allows
multiple clients to connect to a single ffmpeg instance.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-09-02 23:08:43 +02:00
Aman Gupta
b022d9ba28 avcodec/omx: fix xFramerate calculation
Integer overflow in the Q16 framerate calculation was sending
invalid values to the OMX encoder.

On the RPI4, this manifested as bitrate controls being ignored
on video streams with 60000/1001 framerates. Video streams with
30000/1001 framerates were not affected.

Signed-off-by: Aman Gupta <aman@tmm1.net>
2019-09-02 13:46:11 -07:00
Marton Balint
f4eb7d84a7 avformat/mpegtsenc: fix flushing of audio packets
7d097a0fc5 had the same purpose as
3700f655c5 but the former is much simpler, so
let's remove the latter.

Unfortunately both checks were wrong, because in order to make sure DTS > PCR
we have to give us some headroom, so instead of using a dts_difference <
max_delay check let's use a dts_difference < max_delay/2 check.

Fixes DTS < PCR errors with this command line:

./ffmpeg -loglevel verbose -y -f lavfi -i \
  "testsrc=s=64x64:d=20,split=2[out0][tmp1];[tmp1]vflip[out1];sine=d=20,asetnsamples=1000[out2]" \
  -flags +bitexact -fflags +bitexact -sws_flags +accurate_rnd+bitexact  \
  -codec:v libx264 -codec:a mp2 -b:a 32k -pix_fmt yuv420p \
  -map '0✌️0' \
  -map '0✌️1' \
  -map '0🅰️0'  \
  -muxrate 800000 \
  -program st=0:st=2 -program st=1:st=2 -program st=2 -program st=0 -f mpegts out1.ts

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-09-02 21:44:25 +02:00
Marton Balint
73e0035812 docs/formats: fix max_interleave_delta default
Signed-off-by: Marton Balint <cus@passwd.hu>
2019-09-02 21:44:25 +02:00
Michael Niedermayer
4778407ab3 avcodec/ralf: fix undefined shift in extend_code()
Fixes: left shift of negative value -3
Fixes: 16147/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5658392722407424

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-02 21:37:18 +02:00
Michael Niedermayer
0ee886988e avcodec/ralf: fix undefined shift
Fixes: left shift of negative value -2
Fixes: 16145/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5146671058518016

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-02 21:37:18 +02:00
Michael Niedermayer
361b3c873e avcodec/pngdec: Optimize has_trns code
add inner loop specialisations for 2 bpp and 4 bpp
These are all cases for which i found testsamples.

30M cycles -> 5M cycles

Testcase: fate-rgbapng-4816
Testcase: 16097/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5664690889293824

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-02 21:37:18 +02:00
Michael Niedermayer
8ae5d2cbb2 vcodec/apedec: Fix integer overflow in filter_3800()
Fixes: signed integer overflow: 2021654528 + 2032575680 cannot be represented in type 'int'
Fixes: 16270/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5732438816325632

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-02 21:37:18 +02:00
Michael Niedermayer
64ac8a6e69 avcodec/apedec: Fix integer overflow in filter_fast_3320()
Fixes: signed integer overflow: -1094994793 * 2 cannot be represented in type 'int'
Fixes: 16139/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5663911036059648

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-02 21:37:18 +02:00
Pavel Koshevoy
6b57a294a3 lavc/v4l2_m2m: don't close the file descriptor we don't own
ff_v4l2_m2m_create_context initialized V4L2m2mContext.fd to 0
which is a valid file descriptor value. Next ff_v4l2_m2m_codec_init
failed and v4l2_m2m_destroy_context closed file descriptor 0 even
though it didn't belong to V4L2m2mContext.

Signed-off-by: Pavel Koshevoy <pkoshevoy@gmail.com>
2019-09-02 11:28:43 -06:00
Andrey Semashev
7ea2710ec4 configure: Update libmysofa check with a new symbol.
The current code in libavfilter/af_sofalizer.c requires
mysofa_neighborhood_init_withstepdefine function, which only appeared
in libmysofa 0.7. Use this function in configure script to bail out
early if a too old libmysofa is found in the system instead of failing
at compile time.
2019-09-02 19:06:24 +02:00
Michael Niedermayer
b54031a6e9 avcodec/bgmc: Check input space in ff_bgmc_decode_init()
Fixes: Infinite loop
Fixes: 16608/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5636229827133440

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-02 18:09:11 +02:00
Michael Niedermayer
daf92cc074 avcodec/vp3: Check for end of input in 2 places of vp4_unpack_macroblocks()
Fixes: Timeout (82sec -> 1sec)
Fixes: 16411/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP3_fuzzer-5166958151991296

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-02 18:09:11 +02:00
Paul B Mahol
fbaa395917 avfilter/vf_v360: remove not needed items from ThreadData 2019-09-02 16:45:55 +02:00
Paul B Mahol
6b09030756 avfilter/vf_delogo: unbreak fate
It is not clear what was real intention of previous commit to this filter.
It was not working correctly, hopefully this is fixed now.
It never checked that new x/y/w/h are actually valid, hopeffully this is fixed now.
It uses named variables in expressions that are never set, still not fixed.
It does not set named variables that uses actual frame widht/height, making actual
expressions less usable for our users, still now fixed.
2019-09-02 16:17:46 +02:00
Paul B Mahol
e0fab59624 avfilter/vf_v360: set much smaller limit to w/h 2019-09-02 10:47:29 +02:00
Paul B Mahol
067e632349 avfilter/vf_v360: fix some small code style issues 2019-09-02 10:43:37 +02:00
Paul B Mahol
6037dfa47a avfilter/vf_v360: extend description of eac format 2019-09-02 10:36:45 +02:00
Paul B Mahol
30f4464e22 avfilter/vf_v360: rename fb format to barrel 2019-09-02 10:35:25 +02:00
Paul B Mahol
cae2982077 avcodec/tiff: rewrite lut handling
Remove endianess hack.
2019-09-02 09:26:53 +02:00
Paul B Mahol
d7529b03ba avcodec/tiff: set color_trc, remove sRGB conversion 2019-09-02 09:26:53 +02:00
Nick Renieris
63689b16ad lavc/tiff: Enable decoding of LinearRaw images
"LinearRaw" is a value that the PhotometricInterpretation tag can be set
to on DNG images that contain color information for all channels instead
of being bayer-encoded ("CFA" value).

The DNG decoder is complete enough that we can enable this now.

Sample:
- http://www.rawsamples.ch/raws/nikon/SCANNER_NIKON_LS5000.DNG

Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02 09:26:52 +02:00
Nick Renieris
15776ca182 lavc/tiff: Default-initialize WhiteLevel DNG tag value
Initialized to `(2 ^ BitsPerSample) - 1` as per the DNG Specification.

Also make sure that `BlackLevel < WhiteLevel`.

This fixes decoding for "X7 CinemaDNG" samples here:
- https://www.dji.com/gr/zenmuse-x7/info#downloads

Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02 09:26:52 +02:00
Nick Renieris
9280e4b291 lavc/tiff: Support DNGs with striped (non-tiled) JPEGs images
DNG samples here can now be decoded:
- https://www.photographyblog.com/previews/pentax_k1_photos

Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02 09:26:52 +02:00
Nick Renieris
fcf0ebc4a9 lavc/mjpegdec: Skip unknown APPx marker on bayer images
Samples:
- Embedded JPEG images in the DNG images here:
  https://www.photographyblog.com/previews/pentax_k1_photos

Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02 09:26:52 +02:00
Nick Renieris
c44aa7f176 lavc/tiff: Decode 10-bit and 14-bit DNG images
10-bit sample: http://www.rawsamples.ch/raws/phones/RAW_ONEPLUS_ONE-A0001.DNG
14-bit sample: https://drive.google.com/open?id=0B4JyRT3Lth5HVndyOTVOdWktM3J4TFEydTk1MnY3RWlpSzVB

Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02 09:26:52 +02:00
Nick Renieris
31acdf4351 lavc/tiff: Support decoding of DNGs with single-component JPEGs
This enables decoding of DNG images generated by the 'DJI Zenmuse X7'
digital camera
Samples: https://www.dji.com/gr/zenmuse-x7/info#downloads

Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02 09:26:52 +02:00
Nick Renieris
a75a9e8f64 lavc/mjpegdec: Enable decoding of single-component bayer images
Also, ensure no false positives when determining DNG bayer images, by
setting them in tiff.c instead of relying on a heuristic.  There's no
way to determine this just from the JPEG data, so we have to pass this
information from outside the MJPEG decoder.

Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02 09:26:52 +02:00
Nick Renieris
c510ed2ee8 lavc/tiff: Force DNG pixel data endianness on an edge case
This fixes "X7 RAW" and "X7 CinemaDNG" samples here:
- https://www.dji.com/gr/zenmuse-x7/info#downloads

Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02 09:26:52 +02:00
Nick Renieris
33b6752a70 lavc/tiff: Don't apply strips-related logic to tiled images
Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02 09:26:52 +02:00
Nick Renieris
f98a8666de lavc/tiff: Fix edge case with full-length/width tiles
When the height is equal to the tile length (full-height tile)
after `height % tile_length` is applied with the current code,
it results in the operating tile_length to be 0.  This commit
makes this leftover logic only applies if it's necessary.

Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02 09:26:52 +02:00
Nick Renieris
03f95403eb lavc/jpegtables: Handle multiple mappings to the same value
Some JPEGs [1] have incorrect DHT entries that map 2 codes to
the same value.

The second (last) mapping does not ever actually appear in the
code stream, therefore ignoring any mappings after the first one
fixes this.

Without this, an "mjpeg_decode_dc: bad vlc: 0:0" error is thrown.

In all known files, the 2 codes are mapped to symbol 0 so only
that case is checked.

[1]: Embedded JPEGs in "X7 RAW" and "X7 CinemaDNG" samples here:
     https://www.dji.com/gr/zenmuse-x7/info#downloads

Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02 09:26:52 +02:00
Nick Renieris
6763192cff lavc/tiff: Apply color scaling to uncompressed DNGs
Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02 09:26:52 +02:00
Nick Renieris
4c8c4f2d43 lavc/tiff: Convert DNGs to sRGB color space
Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02 09:26:52 +02:00
Nick Renieris
c31c708929 lavc/tiff: Decode embedded JPEGs in DNG images
Used a technique similar to lavc/tdsc.c for invoking the MJPEG decoder.

This commit adds support for:
- DNG tiles
- DNG tile huffman lossless JPEG decoding
- DNG 8-bpp ("packed" as dcraw calls it) decoding
- DNG color scaling [1]
  - LinearizationTable tag
  - BlackLevel tag

[1]: As specified in the DNG Specification - Chapter 5

Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02 09:26:52 +02:00
Nick Renieris
40abff05d2 lavc/mjpegdec: Decode Huffman-coded lossless JPEGs embedded in DNGs
Main image data in DNGs is usually comprised of tiles, each of which is a Huffman-encoded lossless JPEG.

Tested for ljpeg regressions with:
`ffmpeg -f lavfi -i testsrc=d=1 -vcodec ljpeg test.avi`
`ffmpeg test.avi out.avi`
The modified code in ljpeg_decode_rgb_scan runs without issues.

Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02 09:26:52 +02:00
Steven Liu
2a21487b9e avformat/dashdec: start from the root uri when baseURL is start with '/'
fix ticket: 8097

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-09-02 13:40:19 +08:00
Steven Liu
2183def1a5 avfilter/vf_delogo: support expr in delogo filter
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-09-02 13:35:32 +08:00
Limin Wang
75aea52a10 lavf/hlsenc: refine the get_relative_url function to avoid extra malloc for relation path
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2019-09-02 13:28:08 +08:00
Raphaël Zumer
a12b629ae1 avcodec: Support EBU Tech. 3213-E primaries values
Signed-off-by: Raphaël Zumer <rzumer@tebako.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-09-01 20:00:58 -03:00
Raphaël Zumer
08dfd57fd8 avfilter: Support EBU Tech. 3213-E primaries values
Signed-off-by: Raphaël Zumer <rzumer@tebako.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-09-01 20:00:53 -03:00
Raphaël Zumer
8821d1f56e avutil/pixfmt: Add EBU Tech. 3213-E AVColorPrimaries value
This is an alias for JEDEC P22.

The name associated with the value is also changed
from jedec-p22 to ebu3213 to match ITU-T H.273.

Signed-off-by: Raphaël Zumer <rzumer@tebako.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-09-01 19:56:05 -03:00
Michael Niedermayer
cc78783ce5 avcodec/truemotion2: Fix multiple integer overflows in tm2_null_res_block()
Fixes: signed integer overflow: 1795032576 + 598344192 cannot be represented in type 'int'
Fixes: 16196/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5636723419119616

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-31 18:34:05 +02:00