1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

95667 Commits

Author SHA1 Message Date
Jun Zhao
a23c8d75ec lavf/dashenc: enable probesize/max_analyze_duration setting in sub-demuxer
Enable probesize/max_analyze_duration setting when open the sub-demuxer,
it's will be used to minimizing the initial delay.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-11-08 11:39:02 +08:00
Jun Zhao
5307c12acb lavf/hls: support probesize/max_analyze_duration when open sub-demuxer
Add probesize/max_analyze_duration support when open the sub-demuxer,
it's will be used to minimizing the initial delay.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-11-08 11:39:02 +08:00
Jun Zhao
d44c7235a8 lavf/flvenc: Cosmetics: fix indentation
fix indentation

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-11-08 11:39:02 +08:00
Jun Zhao
3dce89e55e lavf/mov: add log context dump in log message
add log context dump in log message.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-11-08 11:39:02 +08:00
Jun Zhao
bbf061c7ca lavf/hls: fix the log context setting in log message
Fix the log context setting in log message

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-11-08 11:39:02 +08:00
Guo, Yejun
4d980a8ceb avfilter/vf_dnn_processing: add a generic filter for image proccessing with dnn networks
This filter accepts all the dnn networks which do image processing.
Currently, frame with formats rgb24 and bgr24 are supported. Other
formats such as gray and YUV will be supported next. The dnn network
can accept data in float32 or uint8 format. And the dnn network can
change frame size.

The following is a python script to halve the value of the first
channel of the pixel. 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
import imageio
in_img = imageio.imread('in.bmp')
in_img = in_img.astype(np.float32)/255.0
in_data = in_img[np.newaxis, :]
filter_data = np.array([0.5, 0, 0, 0, 1., 0, 0, 0, 1.]).reshape(1,1,3,3).astype(np.float32)
filter = tf.Variable(filter_data)
x = tf.placeholder(tf.float32, shape=[1, None, None, 3], 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())
output = sess.run(y, feed_dict={x: in_data})
graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, ['dnn_out'])
tf.train.write_graph(graph_def, '.', 'halve_first_channel.pb', as_text=False)
output = output * 255.0
output = output.astype(np.uint8)
imageio.imsave("out.bmp", np.squeeze(output))

To do the same thing with ffmpeg:
- generate halve_first_channel.pb with the above script
- generate halve_first_channel.model with tools/python/convert.py
- try with following commands
  ./ffmpeg -i input.jpg -vf dnn_processing=model=halve_first_channel.model:input=dnn_in:output=dnn_out:fmt=rgb24:dnn_backend=native -y out.native.png
  ./ffmpeg -i input.jpg -vf dnn_processing=model=halve_first_channel.pb:input=dnn_in:output=dnn_out:fmt=rgb24:dnn_backend=tensorflow -y out.tf.png

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
2019-11-07 15:46:00 -03:00
Andreas Rheinhardt
fc7b6d5574 fftools/ffmpeg_opt: Fix mixed declarations and code
Introduced in ed3c317d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-11-06 20:38:03 +01:00
leozhang
84c27c8c08 avcodec/extract_extradata_bsf: fix typo in comments
Signed-off-by: leozhang <leozhang@qiyi.com>
Reviewed-by: Gyan <ffmpeg@gyani.pro>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-11-06 20:38:03 +01:00
Andriy Gelman
7b2ce27e56 avdevice/v4l2: Remove av_assert0 when format not supported
Before this commit an av_assert0 would fail if a v4l2 device did not
support a target format.
For example,
./ffmpeg -f v4l2 -codec:v h264 -i /dev/video0 -f mpegts -
would signal an abort if /dev/video0 did not support h264.

The new behaviour is to return an AVERROR(EINVAL) error code. An
av_assert0 has been added to verify this return.

Fixes #6629

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-11-06 20:38:03 +01:00
Lou Logan
a0c7406075 avcodec/Makefile: add missing msmpeg4* dependencies to wmv1 encoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-06 09:49:59 -09:00
Lou Logan
b973d27952 avcodec/Makefile: add missing h263data dependency to snow encoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-06 09:49:59 -09:00
Lou Logan
9022a5e0c2 avcodec/Makefile: add missing vorbis_data dependency to opus encoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-06 09:49:59 -09:00
Lou Logan
0663f0e0da configure: select mdct for dca encoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-06 09:49:59 -09:00
Baptiste Coudurier
004ebd4b37 avcodec/dvdec: correctly decode bottom mb row in 1080i field mode 2019-11-06 08:40:36 -08:00
Baptiste Coudurier
33203a08e0 avcodec/dvdec: correctly set interlaced and tff 2019-11-06 08:40:08 -08:00
Marton Balint
c54268ce02 avcodec/libvpxdec: reject video and alpha dimension mismatches
Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: James Zern <jzern@google.com>
2019-11-05 23:14:24 -08:00
Marton Balint
5478e2cc57 avcodec/libvpxdec: decode to custom framebuffers for vp9
This avoids copying the full frame after decoding.

Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: James Zern <jzern@google.com>
2019-11-05 23:14:24 -08:00
Marton Balint
98aa1eb1cb avcodec/libvpxdec: pass decoder instances to vpx_init directly
If the alpha decoder init failed we presented the error message from the normal
decoder. This change should prevent such mistakes.

Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: James Zern <jzern@google.com>
2019-11-05 23:14:24 -08:00
Marton Balint
99e0007046 avcodec/libvpxdec: make sure BlockAdditional side data size >= 8
Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: James Zern <jzern@google.com>
2019-11-05 23:14:24 -08:00
Marton Balint
6b54477072 avcodec/libvpxenc: only allocate alpha U/V planes on size changes
Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: James Zern <jzern@google.com>
2019-11-05 23:14:24 -08:00
Marton Balint
4255032914 avcodec/libvpxenc: fix alpha stride
Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: James Zern <jzern@google.com>
2019-11-05 23:14:24 -08:00
Michael Niedermayer
e4fdeb3fce avformat/nutenc: Do not pass NULL to memcmp() in get_needed_flags()
This compared to the other suggestions is cleaner and easier to understand
keeping the condition in the if() simple.

This affects alot of fate tests.

See: [FFmpeg-devel] [PATCH 05/11] avformat/nutenc: Don't pass NULL to memcmp
See: [FFmpeg-devel] [PATCH]lavf/nutenc: Do not call memcmp() with NULL argument

Fixes: Ticket 7980

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-11-05 21:21:59 +01:00
Limin Wang
377fa6612a doc/bitstream_filters: Fix copy an paste typo
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-11-05 21:21:32 +01:00
Lou Logan
121326d7b8 configure: select bswapdsp for ylc decoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-05 09:40:27 -09:00
Lou Logan
c69ade947a configure: select fft for qdmc decoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-05 09:40:27 -09:00
Lou Logan
16503a933d configure: select bswapdsp for mdec decoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-05 09:40:08 -09:00
Lou Logan
04e23e027e configure: select bswapdsp for imm4 decoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-05 09:38:52 -09:00
Lou Logan
3bfd12d84c avcodec/Makefile: add missing ass dependency to ccaption decoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-04 14:12:24 -09:00
Lou Logan
1c7e661adb configure: select audiodsp for acelp_kelvin decoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-04 14:10:11 -09:00
Lou Logan
e8e788da97 configure: select mdct for atrac3al decoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-04 14:06:22 -09:00
Lou Logan
e5511bc1bd configure: select mdct & sinewin for atrac3pal decoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-04 14:01:45 -09:00
Lou Logan
cae7f6658c avformat/Makefile: add missing pcm dependency to sdx demuxer
Signed-off-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
2019-11-04 12:13:48 -09:00
Lou Logan
5f78ca83d6 avformat/Makefile: add missing pcm dependency to nsp demuxer
Signed-off-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
2019-11-04 12:13:48 -09:00
Lou Logan
82bb7900db avformat/Makefile: add missing pcm dependency to hcom demuxer
Signed-off-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
2019-11-04 12:13:48 -09:00
Lou Logan
16ccafad95 configure: select riffdec for act demuxer
Signed-off-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
2019-11-04 12:13:48 -09:00
Lou Logan
132bc8817e configure: select jpegtables for rtp muxer
Signed-off-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
2019-11-04 12:13:48 -09:00
Zhong Li
8ff432eb44 tools/enum_options: replace the deprecated API
Signed-off-by: Zhong Li <zhongli_dev@126.com>
2019-11-04 23:27:50 +08:00
Zhong Li
f52e15df0f tools/probetest: replace the deprecated API
Signed-off-by: Zhong Li <zhongli_dev@126.com>
2019-11-04 23:27:35 +08:00
zhongli_dev@126.com
fcbfdeeabe lavc/qsvenc: add the missing vp9 file
It is missed in commit 3358380

Signed-off-by: Zhong Li <zhongli_dev@126.com>
2019-11-04 23:24:20 +08:00
Jun Zhao
ec3d3fc65d lavf/asfdec: Simplify the check conditions
Simplify the check conditions

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-11-04 10:24:58 +08:00
Jun Zhao
8f7a043609 lavf/mpegtsenc: fix logic check error
fix the logic check error

fix #6751

Reviewed-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-11-04 10:22:11 +08:00
Nicolas Frattaroli
a8ec0685ac avformat/ftp: add AVOptions for authentication
This introduces two new AVOption options for the FTP protocol,
one named ftp-user to supply the username to be used for auth,
one named ftp-password to supply the password to be used for auth.

These are useful for when an API user does not wish to deal with
URL manipulation and percent encoding.

Setting them while also having credentials in the URL will use the
credentials from the URL. The rationale for this is that credentials
embedded in the URL are probably more specific to what the user is
trying to do than anything set by some API user.

Signed-off-by: Nicolas Frattaroli <ffmpeg@fratti.ch>
Signed-off-by: Marton Balint <cus@passwd.hu>
2019-11-03 12:24:19 +01:00
Andriy Gelman
5e3229df4c avformat: Add max_probe_packets option
Allows user to set maximum number of buffered packets when
probing a codec. It was a hard-coded parameter before this commit.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-11-03 11:52:32 +01:00
Zhong Li
33583803e1 lavc/qsvenc: enable vp9 encoder
1. must enable low_power mode since just VDENC can be supported by iHD
driver right now
2. Coding option1 and extra_data are not supported by MSDK
3. IVF header will be inserted in MSDK by default, but it is not needed
for FFmpeg, so disable it.

Signed-off-by: Zhong Li <zhongli_dev@126.com>
2019-11-03 16:45:35 +08:00
Linjie Fu
e786e37326 lavc/qsvenc: Fix bitrate_limit to allow AVC encode in limited bitrate
MFXVideoENCODE_Query calls CheckVideoParamQueryLike in MSDK and
will determine whether to set param.mfx.TargetKbps to the allowed
minTargetKbps according to the bitrate_limit in extco2 buffer.

Thus q->param.ExtParam must be set before MFXVideoENCODE_Query in case
minTargetKbps is written to TargetKbps by default.

1080P AVC encoding with option "-bitrate_limit 0 -b:v 100k":
Before patch:
            902 kbps
After patch:
            156 kbps
Signed-off-by: Linjie Fu <linjie.fu@intel.com>
2019-11-03 16:22:47 +08:00
Andriy Gelman
53c21c2d6b avcodec/v4l2_m2m: Fix indentation
Signed-off-by: Aman Gupta <aman@tmm1.net>
2019-11-01 15:19:55 -07:00
Andriy Gelman
1aec1183f3 avcodec/v4l2_buffers: Fix infinite loop
This part of the code counts the number of planes returned by the v4l2
device for each queried capture/output buffer.
When testing the GPU h264 encoder on Nvidia's Jetson Nano, this caused an
infinite loop because avbuf->buf.length included some empty buffers (i.e.
where avbuf->buf.m.planes[i].length = 0), meaning that the counter was
never incremented and break was never reached.
This is fixed in the commit by using a well defined iteration range.

Signed-off-by: Aman Gupta <aman@tmm1.net>
2019-11-01 15:19:55 -07:00
Michael Niedermayer
fd3ee7a92e tools/target_dec_fuzzer: Adjust threshold for G2M
G2M allows large images from small input and also reallocates
multiple buffers on any resolution change.

Fixes: Timeout (22sec -> 5sec)
Fixes: 18022/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G2M_fuzzer-5089192530411520

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-11-01 20:15:33 +01:00
Michael Niedermayer
98a257c323 avcodec/aptx: Check the number of channels
Fixes: store to null pointer of type 'uint32_t' (aka 'unsigned int')
Fixes: 18021/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APTX_HD_fuzzer-5761738313564160

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-11-01 20:15:32 +01:00
Michael Niedermayer
47a017aaaa avcodec/rv10: Check input for minimal frame size
Fixes: Timeout (18sec -> 4sec)
Fixes: 18012/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV20_fuzzer-5767486145822720

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-11-01 20:15:31 +01:00