summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* avformat: remove unneeded avio_flush() calls before calling avio_close_dyn_buf()Marton Balint2020-01-07
| | | | | | avio_close_dyn_buf() also does avio_flush(). Signed-off-by: Marton Balint <cus@passwd.hu>
* vf_dnn_processing: add support for more formats gray8 and grayf32Guo, Yejun2020-01-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following is a python script to halve the value of the gray image. It demos how to setup and execute dnn model with python+tensorflow. It also generates .pb file which will be used by ffmpeg. import tensorflow as tf import numpy as np from skimage import color from skimage import io in_img = io.imread('input.jpg') in_img = color.rgb2gray(in_img) io.imsave('ori_gray.jpg', np.squeeze(in_img)) in_data = np.expand_dims(in_img, axis=0) in_data = np.expand_dims(in_data, axis=3) filter_data = np.array([0.5]).reshape(1,1,1,1).astype(np.float32) filter = tf.Variable(filter_data) x = tf.placeholder(tf.float32, shape=[1, None, None, 1], name='dnn_in') y = tf.nn.conv2d(x, filter, strides=[1, 1, 1, 1], padding='VALID', name='dnn_out') sess=tf.Session() sess.run(tf.global_variables_initializer()) graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, ['dnn_out']) tf.train.write_graph(graph_def, '.', 'halve_gray_float.pb', as_text=False) print("halve_gray_float.pb generated, please use \ path_to_ffmpeg/tools/python/convert.py to generate halve_gray_float.model\n") output = sess.run(y, feed_dict={x: in_data}) output = output * 255.0 output = output.astype(np.uint8) io.imsave("out.jpg", np.squeeze(output)) To do the same thing with ffmpeg: - generate halve_gray_float.pb with the above script - generate halve_gray_float.model with tools/python/convert.py - try with following commands ./ffmpeg -i input.jpg -vf format=grayf32,dnn_processing=model=halve_gray_float.model:input=dnn_in:output=dnn_out:dnn_backend=native out.native.png ./ffmpeg -i input.jpg -vf format=grayf32,dnn_processing=model=halve_gray_float.pb:input=dnn_in:output=dnn_out:dnn_backend=tensorflow out.tf.png Signed-off-by: Guo, Yejun <yejun.guo@intel.com> Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
* vf_dnn_processing: remove parameter 'fmt'Guo, Yejun2020-01-07
| | | | | | | | | | | | do not request AVFrame's format in vf_ddn_processing with 'fmt', but to add another filter for the format. command examples: ./ffmpeg -i input.jpg -vf format=bgr24,dnn_processing=model=halve_first_channel.model:input=dnn_in:output=dnn_out:dnn_backend=native -y out.native.png ./ffmpeg -i input.jpg -vf format=rgb24,dnn_processing=model=halve_first_channel.model:input=dnn_in:output=dnn_out:dnn_backend=native -y out.native.png Signed-off-by: Guo, Yejun <yejun.guo@intel.com> Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
* avcodec/libvpxenc,cosmetics: prefer sizeof(var)James Zern2020-01-06
| | | | | Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: James Zern <jzern@google.com>
* avcodec/vmdaudio: Check block_align moreMichael Niedermayer2020-01-07
| | | | | | | | | Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' Fixes: 19788/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMDAUDIO_fuzzer-5743379690553344 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_showinfo: Fix erroneous results for mean and stdev with pixel ↵Limin Wang2020-01-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bits >8 Have tested with be and le pixel format on be and le system for >8bit. System: lmwang@ubuntu:~/ffmpeg.git.mips$ grep HAVE_BIGENDIAN config.h ffmpeg.git git:(showinfo) ✗ grep HAVE_BIGENDIAN config.h Test result: 1, yuv420p ./ffmpeg -f lavfi -i color=black:duration=1:r=1:size=1280x720,format=yuv420p,showinfo Master: mean:[16 128 128] stdev:[0.0 0.0 0.0] After applied the patch: mean:[16 128 128] stdev:[0.0 0.0 0.0] 2, yuv420p10le ./ffmpeg -f lavfi -i color=black:duration=1:r=1:size=1280x720,format=yuv420p10le,showinfo Master: mean:[32 1 1] stdev:[32.0 1.0 1.0] After applied the patch: mean:[64 512 512] stdev:[0.0 0.0 0.0] 3, yuv420p10be ./ffmpeg -f lavfi -i color=black:duration=1:r=1:size=1280x720,format=yuv420p10be,showinfo Master: mean:[32 1 1] stdev:[32.0 1.0 1.0] After applied the patch: mean:[64 512 512] stdev:[0.0 0.0 0.0] Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/aviobuf: Honor avio_open[2] documentationAndreas Rheinhardt2020-01-07
| | | | | | | | | | | The documentation of both avio_open() as well as avio_open2() states that on failure, the pointer to an AVIOContext given to this function (via a pointer to a pointer to an AVIOContext) will be set to NULL. Yet it didn't happen upon failure of ffurl_open_whitelist() or when allocating the internal buffer failed. This commit changes this. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/decode: replace avctx->internal with avci for better readabilityLimin Wang2020-01-07
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* vf_tonemap_vaapi: Fix memory leak in error caseMark Thompson2020-01-07
| | | | Fixes CID 1457236.
* configure: Change the configure check for tonemap_vaapiXinpeng Sun2020-01-07
| | | | | | | | "VAProcFilterParameterBufferHDRToneMapping" was defined in libva 2.4.1, which will lead to build failure for the filter tonemap_vaapi for libva 2.3.0 with current check. This patch is to fix this build error. Signed-off-by: Xinpeng Sun <xinpeng.sun@intel.com>
* lavc/vdpau_vp9: Do not mix declarations and code.Carl Eugen Hoyos2020-01-06
| | | | | Fixes the following gcc warning: libavcodec/vdpau_vp9.c:45:5: warning: ISO C90 forbids mixed declarations and code
* Silence "string-plus-int" warning shown by clang.Carl Eugen Hoyos2020-01-06
| | | | libswscale/utils.c:89:42: warning: adding 'unsigned long' to a string does not append to the string [-Wstring-plus-int]
* avfilter/af_sidechaincompress: add support for commandsPaul B Mahol2020-01-06
|
* doc/filters: mention commands for crystalizer filterPaul B Mahol2020-01-06
|
* doc/filters: indicate commands for scale2refGyan Doshi2020-01-06
|
* doc/filters: indicate commands for zscaleGyan Doshi2020-01-06
|
* avfilter/af_dynaudnorm: add support for commandsPaul B Mahol2020-01-06
|
* doc/filters: add entry for mean and stdev in showinfoLimin Wang2020-01-06
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
* lavc/ffv1: Properly check that the 4th and 5th quant tables are zeroesDerek Buitenhuis2020-01-06
| | | | | | | | | | | | | | | | | | | | | | Currently, the decoder checks the 128th value of the 4th quant table during while deriving the context on each sample, in order to speed itself up. This is due to relying on the behavior of FFmpeg's FFV1 encoder, in which if that value is zero, the entire 4th and 5th quant tables are assumed to be entirely zero. This does not match the FFV1 spec, which has no such restriction, and after some discussion, it was decided to fix FFmpeg to abide by the spec, rather than change the spec. We will now check whether the 4th and 5th quant tables are zero properly, by checking the 128th valye of both tables (which means they are zero due to the way they're coded in the bitstream). For further context, the FFV1 issue in question is located at: https://github.com/FFmpeg/FFV1/issues/169 Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* libavformat: fix spelling in ID3v1 genres and extend the list of Winamp ↵Ulrich Spörlein2020-01-05
| | | | | | | | | | | | | | | extensions. Sources include various lists on the Internet, as well as the current Wikipedia page at https://en.wikipedia.org/w/index.php?title=List_of_ID3v1_Genres&oldid=896774343 but most importantly the list as used by taglib at https://github.com/taglib/taglib/commit/3e60e339a4bc46e2a1a7aea782502480561a8acf#diff-f86455366624350770f41b4940925dde Further patches to harmonize the spelling have been sent to taglib and libid3tag. See also https://github.com/taglib/taglib/pull/942/ Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pgssubdec: Free subtitle on errorMichael Niedermayer2020-01-05
| | | | | | | | | Fixes: Assertion failure Fixes: 19753/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGSSUB_fuzzer-5688461843759104 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* doc/volume: correct placement of replaygain_noclipGyan Doshi2020-01-05
| | | | | | In the merge commit 878f8b0d26, entry for replaygain_noclip was placed in commands, which it is not, instead of among the options.
* avfilter/af_dynaudnorm: use already available pointerPaul B Mahol2020-01-05
| | | | Instead of dereferencing same thing again.
* avfilter/af_dynaudnorm: move channels variable setup firstPaul B Mahol2020-01-05
|
* ffmpeg: don't force source-tracked keyframes for duplicatesGyan Doshi2020-01-05
| | | | | Prevents a run of consecutive duplicate frames from all being encoded as keyframes, when force_key_frames is set to source.
* ffmpeg: remove premature rescaling of forced_keyframe timesGyan Doshi2020-01-05
| | | | | The user-set forced KF times are parsed *after* this deleted loop and rescaled right after parsing.
* doc/ffmpeg: document value source for -force_key_framesGyan Doshi2020-01-05
| | | | Also clarify behaviour in case of specified timestamps
* swscale/aarch64: use multiply accumulate and shift-right narrowSebastian Pop2020-01-04
| | | | | | | | | | | | | | | | | | | This patch rewrites the innermost loop of ff_yuv2planeX_8_neon to avoid zips and horizontal adds by using fused multiply adds. The patch also uses ld1r to load one element and replicate it across all lanes of the vector. The patch also improves the clipping code by removing the shift right instructions and performing the shift with the shift-right narrow instructions. I see 8% difference on an m6g instance with neoverse-n1 CPUs: $ ffmpeg -nostats -f lavfi -i testsrc2=4k:d=2 -vf bench=start,scale=1024x1024,bench=stop -f null - before: t:0.014015 avg:0.014096 max:0.015018 min:0.013971 after: t:0.012985 avg:0.013013 max:0.013996 min:0.012818 Tested with `make check` on aarch64-linux. Signed-off-by: Sebastian Pop <spop@amazon.com> Reviewed-by: Clément Bœsch <u@pkh.me> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/bsf: replace ctx->internal-> with bsfi-> for better readabilityLimin Wang2020-01-04
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* doc: Fix a typo.Carl Eugen Hoyos2020-01-04
|
* lavfi/buffersrc: Remove redundant free after ff_filter_frame() failureJun Zhao2020-01-04
| | | | | | | | | ff_filter_frame() always frees the frame in case of error, so we don't need to free the frame after ff_filter_frame() fails. Fix CID 1457230. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avfilter/af_dynaudnorm: fix another clipping with custom peak valuePaul B Mahol2020-01-04
| | | | | This always happened at start with alternative boundary mode disabled. The clipping only occurred if starting samples where high enough.
* avfilter/af_dynaudnorm: implement threshold optionPaul B Mahol2020-01-04
|
* avfilter/af_dynaudnorm: do not clip audioPaul B Mahol2020-01-04
| | | | | | Clipping can happen when smoothed gain is higher than maximum allowed gain factor for current frame and peak value option is set to enough low value.
* libavutil/opt: fix memory leak after av_dict_parse_string failJun Zhao2020-01-04
| | | | | | | | | In case of failure, all the successfully set entries are stored in *pm. We need to manually free the created dictionary to avoid memory leak. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavfi/coreimage: fix memory leak after av_dict_parse_string failJun Zhao2020-01-04
| | | | | | | | In case of failure, all the successfully set entries are stored in *pm. We need to manually free the created dictionary to avoid memory leak. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavc/libkvazaar: fix memory leak after av_dict_parse_string failJun Zhao2020-01-04
| | | | | | | | In case of failure, all the successfully set entries are stored in *pm. We need to manually free the created dictionary to avoid memory leak. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavc/bsf: fix memory leak after av_dict_parse_string failJun Zhao2020-01-04
| | | | | | | | | In case of failure, all the successfully set entries are stored in *pm. We need to manually free the created dictionary to avoid memory leak. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avdevice/decklink: deprecate the -list_devices optionMarton Balint2020-01-03
| | | | | | The user should use ffmpeg -sources decklink or ffmpeg -sinks decklink instead. Signed-off-by: Marton Balint <cus@passwd.hu>
* avdevice/decklink_dec: remove -bm_v210 optionMarton Balint2020-01-03
| | | | | | Deprecated since Sep 28, 2017. Signed-off-by: Marton Balint <cus@passwd.hu>
* avdevice/decklink_dec: remove the @mode syntaxMarton Balint2020-01-03
| | | | | | Deprecated since March 28, 2017. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/img2enc: fix writing multiple streams in write_muxed_fileMarton Balint2020-01-03
| | | | | | Maybe we should just reject multiple streams for the image2 muxer instead? Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/img2enc: minor simplificationMarton Balint2020-01-03
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/img2enc: cleanup IO contexts on errorMarton Balint2020-01-03
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/img2enc: reindent after last commitMarton Balint2020-01-03
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/img2enc: factorize piped write_packetMarton Balint2020-01-03
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/img2enc: factorize writing fully muxed fileMarton Balint2020-01-03
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* doc/muxers: fix order of options and examples for image2 muxerMarton Balint2020-01-03
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avfilter/af_dynaudnorm: fix previous commitPaul B Mahol2020-01-02
| | | | We still need to analyze frame for amplification at EOF.
* avfilter/af_dynaudnorm: do not enqueue flush buffersPaul B Mahol2020-01-02
|