Re: [FFmpeg-devel] [PATCH v2 16/36] vaapi_encode: Clean up rate control configuration
On Thu, 2018-06-14 at 07:22 +, Li, Zhong wrote: > > -Original Message- > > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf > > Of Xiang, Haihao > > Sent: Thursday, June 14, 2018 2:08 PM > > To: ffmpeg-devel@ffmpeg.org > > Subject: Re: [FFmpeg-devel] [PATCH v2 16/36] vaapi_encode: Clean up rate > > control configuration > > > > On Wed, 2018-06-13 at 23:42 +0100, Mark Thompson wrote: > > > On 13/06/18 08:03, Xiang, Haihao wrote: > > > > On Fri, 2018-06-08 at 00:43 +0100, Mark Thompson wrote: > > > > > Query which modes are supported and select between VBR and CBR > > > > > based on that - this removes all of the codec-specific rate > > > > > control mode selection code. > > > > > --- > > > > > doc/encoders.texi | 2 - > > > > > libavcodec/vaapi_encode.c | 173 > > > > --- > > > > > > > > > > - > > > > > libavcodec/vaapi_encode.h | 6 +- > > > > > libavcodec/vaapi_encode_h264.c | 18 + > > > > > libavcodec/vaapi_encode_h265.c | 14 +--- > > > > > libavcodec/vaapi_encode_mjpeg.c | 3 +- > > > > > libavcodec/vaapi_encode_mpeg2.c | 9 +-- > > > > > libavcodec/vaapi_encode_vp8.c | 13 +-- > > > > > libavcodec/vaapi_encode_vp9.c | 13 +-- > > > > > 9 files changed, 137 insertions(+), 114 deletions(-) > > > > > > > > > > ... > > > > > diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c > > > > > index f4c063734c..5de5483454 100644 > > > > > --- a/libavcodec/vaapi_encode.c > > > > > +++ b/libavcodec/vaapi_encode.c > > > > > ... > > > > > @@ -1313,44 +1286,144 @@ static av_cold int > > > > > vaapi_encode_config_attributes(AVCodecContext *avctx) static > > > > > av_cold int vaapi_encode_init_rate_control(AVCodecContext *avctx) > > > > > { > > > > > VAAPIEncodeContext *ctx = avctx->priv_data; > > > > > -int rc_bits_per_second; > > > > > -int rc_target_percentage; > > > > > -int rc_window_size; > > > > > -int hrd_buffer_size; > > > > > -int hrd_initial_buffer_fullness; > > > > > +int64_t rc_bits_per_second; > > > > > +int rc_target_percentage; > > > > > +int rc_window_size; > > > > > +int64_t hrd_buffer_size; > > > > > +int64_t hrd_initial_buffer_fullness; > > > > > int fr_num, fr_den; > > > > > +VAConfigAttrib rc_attr = { VAConfigAttribRateControl }; > > > > > +VAStatus vas; > > > > > + > > > > > +vas = vaGetConfigAttributes(ctx->hwctx->display, > > > > > +ctx->va_profile, > > > > ctx->va_entrypoint, > > > > > +&rc_attr, 1); > > > > > +if (vas != VA_STATUS_SUCCESS) { > > > > > +av_log(avctx, AV_LOG_ERROR, "Failed to query rate control > > > > " > > > > > + "config attribute: %d (%s).\n", vas, vaErrorStr(vas)); > > > > > +return AVERROR_EXTERNAL; > > > > > +} > > > > > > > > > > -if (avctx->bit_rate > INT32_MAX) { > > > > > -av_log(avctx, AV_LOG_ERROR, "Target bitrate of 2^31 bps > > > > or " > > > > > - "higher is not supported.\n"); > > > > > +if (rc_attr.value == VA_ATTRIB_NOT_SUPPORTED) { > > > > > +av_log(avctx, AV_LOG_VERBOSE, "Driver does not report > > > > any " > > > > > + "supported rate control modes: assuming constant- > > > > > quality.\n"); > > > > > > > > How about logging it as warning message? > > > > > > What would a user do about it? > > > > > > > User may know what is not supported in the driver and he/she might get > > wrong result, he/she may file an issue to the driver. > > > > > (Note that it gets logged for JPEG encoding on all versions of the > > > i965 driver except the most recent, so if it were a warning it would > > > be seen by everyone using those versions.) > > > > > > > > +ctx->va_rc_mode = VA_RC_CQP; > > > > > +return 0; > > > > > +} > > > > > +if (avctx->flags & AV_CODEC_FLAG_QSCALE || > > > > > +avctx->bit_rate <= 0) { > > > > > +if (rc_attr.value & VA_RC_CQP) { > > > > > +av_log(avctx, AV_LOG_VERBOSE, "Using > > > > constant-quality > > > > > mode.\n"); > > > > > +ctx->va_rc_mode = VA_RC_CQP; > > > > > +return 0; > > > > > +} else { > > > > > +av_log(avctx, AV_LOG_ERROR, "Driver does not > > > > support " > > > > > + "constant-quality mode (%#x).\n", > > > > rc_attr.value); > > > > > +return AVERROR(EINVAL); > > > > > +} > > > > > +} > > > > > + > > > > > +if (!(rc_attr.value & (VA_RC_CBR | VA_RC_VBR))) { > > > > > +av_log(avctx, AV_LOG_ERROR, "Driver does not support any > > > > " > > > > > + "bitrate-targetted rate control modes.\n"); > > > > > return AVERROR(EINVAL); > > > > > } > > > > > > > > > > if (avctx->rc_buffer_size) > > > > > hrd_buffer_size = avctx->rc_buffer_size; > > > > > +else if (avctx->rc_max_rate > 0
Re: [FFmpeg-devel] [PATCH 1/2] avcodec/vaapi: slice_vertical_position starts from zero for the second field
On Fri, Jun 15, 2018 at 07:29:31AM +0200, Jerome Borsboom wrote: > Is your VAAPI library and VAAPI driver new enough? You need at least > libva-2.1.0 (VA-API version 1.1.0) and intel-vaapi-driver-2.1.0 for > interlaced VC-1 decoding. From the output, I think you are using an > older version and the error is just the libva library bailing out for > not supporting interlaced VC-1. yes, it seems its 1.7.0, thats whats in ubuntu 16.04 [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If you drop bombs on a foreign country and kill a hundred thousand innocent people, expect your government to call the consequence "unprovoked inhuman terrorist attacks" and use it to justify dropping more bombs and killing more people. The technology changed, the idea is old. signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavc/nvenc: enable nvenc encoder instance reuse (v2)
applied smime.p7s Description: S/MIME Cryptographic Signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avcodec/qsvenc: fix version detection on cygwin
--- libavcodec/qsvenc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h index d48272224c..bb175c5df8 100644 --- a/libavcodec/qsvenc.h +++ b/libavcodec/qsvenc.h @@ -45,7 +45,7 @@ #define QSV_HAVE_LA_DS QSV_VERSION_ATLEAST(1, 8) #define QSV_HAVE_LA_HRD QSV_VERSION_ATLEAST(1, 11) -#if defined(_WIN32) +#if defined(_WIN32) || defined(__CYGWIN__) #define QSV_HAVE_AVBR QSV_VERSION_ATLEAST(1, 3) #define QSV_HAVE_ICQQSV_VERSION_ATLEAST(1, 8) #define QSV_HAVE_VCMQSV_VERSION_ATLEAST(1, 8) -- 2.17.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/libx265: apply lavc maxrate and bufsize
On 13-06-2018 07:08 PM, Gyan Doshi wrote: Default for both parameters in both libs is 0. Ping. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] fate: qt-faststart target doesn't include PROGSSUF
The recently added qt-faststart references the tool using $(PROGSSUF). However, that tool isn't built with the suffix when supplied, and so the test fails for me. Patch fixes it. From df8ac19a005524bc152c9fae53b4dddc29dc9257 Mon Sep 17 00:00:00 2001 From: Gyan Doshi Date: Fri, 15 Jun 2018 22:38:26 +0530 Subject: [PATCH] fate: qt-faststart target doesn't include PROGSSUF Fixes qt-faststart test for when PROGSSUF is supplied. --- tests/Makefile | 2 +- tests/fate/mov.mak | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index 409d88a9f1..e564279b0a 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -194,7 +194,7 @@ $(FATE_FFMPEG) $(FATE_SAMPLES_AVCONV) $(FATE_SAMPLES_FFMPEG): ffmpeg$(PROGSSUF)$ $(FATE_FFPROBE) $(FATE_SAMPLES_FFPROBE): ffprobe$(PROGSSUF)$(EXESUF) -$(FATE_SAMPLES_FASTSTART): tools/qt-faststart$(PROGSSUF)$(EXESUF) +$(FATE_SAMPLES_FASTSTART): tools/qt-faststart$(EXESUF) ifdef SAMPLES FATE += $(FATE_FULL) $(FATE_FULL-yes) diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak index b9c1ad9d3a..6f0e28d21e 100644 --- a/tests/fate/mov.mak +++ b/tests/fate/mov.mak @@ -113,6 +113,6 @@ fate-mov-guess-delay-1: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries stre fate-mov-guess-delay-2: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries stream=has_b_frames -select_streams v $(TARGET_SAMPLES)/h264/h264_3bf_pyramid_nobsrestriction.mp4 fate-mov-guess-delay-3: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries stream=has_b_frames -select_streams v $(TARGET_SAMPLES)/h264/h264_4bf_pyramid_nobsrestriction.mp4 -fate-mov-faststart-4gb-overflow: CMD = run tools/qt-faststart$(PROGSSUF)$(EXESUF) $(TARGET_SAMPLES)/mov/faststart-4gb-overflow.mov faststart-4gb-overflow-output.mov > /dev/null ; md5sum faststart-4gb-overflow-output.mov | cut -d " " -f1 ; rm faststart-4gb-overflow-output.mov +fate-mov-faststart-4gb-overflow: CMD = run tools/qt-faststart$(EXESUF) $(TARGET_SAMPLES)/mov/faststart-4gb-overflow.mov faststart-4gb-overflow-output.mov > /dev/null ; md5sum faststart-4gb-overflow-output.mov | cut -d " " -f1 ; rm faststart-4gb-overflow-output.mov fate-mov-faststart-4gb-overflow: CMP = oneline fate-mov-faststart-4gb-overflow: REF = bc875921f151871e787c4b4023269b29 -- 2.12.2.windows.2___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] ffmpeg.c: allow ffmpeg to output stats for each video stream
On Fri, Jun 15, 2018 at 13:37:31 +0800, Wang Cao wrote: > Make ffmpeg to output stats for each video/audio streams and each > ouptut file ffmpeg output log in print_report. The report of > video/audio sizes is clear now as previously all output video/audio > sizes were combined to report and it is unclear such stats is for one > output files or aggregates for all output files. (This needs some cleaing up of the grammar, but that's beside the point right now.) Somehow, this changes the stats while running. I no longer see the overall stats. If I map video first, I see only the video stats, but it seems like the audio stats flicker through. If I map audio first, I see a duplicated line (extended), which shows video and audio stat lines side by side. I don't think this is what you intended. You only wanted to show the *final* stats differently, correct? If it is intended, I'd like to point out that the status line does not have enough space on most screens to hold twice or more of its current content. I would still like to see overall stats, also at the end, because it says something about e.g. the total size. In the summary report, per file and per stream stats may be nice though. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] ffmpeg.c: allow ffmpeg to output stats for each video stream - Make ffmpeg to output stats for each video/audio streams and each ouptut file ffmpeg output log in print_repor
On Thu, Jun 14, 2018 at 08:35:48PM +0800, Wang Cao wrote: > Signed-off-by: Wang Cao > --- > fftools/ffmpeg.c | 45 +++-- > 1 file changed, 31 insertions(+), 14 deletions(-) this adds some warnings: CC fftools/ffmpeg.o fftools/ffmpeg.c:1533:13: warning: function declaration isn’t a prototype [-Wstrict-prototypes] static void print_final_stats() ^ fftools/ffmpeg.c: In function ‘print_report’: fftools/ffmpeg.c:1672:22: warning: unused variable ‘oc’ [-Wunused-variable] AVFormatContext *oc; ^ also the commit message should not be one very long line thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB What does censorship reveal? It reveals fear. -- Julian Assange signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] fate: qt-faststart target doesn't include PROGSSUF
On Fri, Jun 15, 2018 at 10:44:57PM +0530, Gyan Doshi wrote: > > The recently added qt-faststart references the tool using $(PROGSSUF). > > However, that tool isn't built with the suffix when supplied, and so the > test fails for me. Patch fixes it. > Makefile |2 +- > fate/mov.mak |2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > a9a8590fdbfdc362f7f758d15bdb34abe2733087 > 0001-fate-qt-faststart-target-doesn-t-include-PROGSSUF.patch > From df8ac19a005524bc152c9fae53b4dddc29dc9257 Mon Sep 17 00:00:00 2001 > From: Gyan Doshi > Date: Fri, 15 Jun 2018 22:38:26 +0530 > Subject: [PATCH] fate: qt-faststart target doesn't include PROGSSUF > > Fixes qt-faststart test for when PROGSSUF is supplied. > --- > tests/Makefile | 2 +- > tests/fate/mov.mak | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) tested with mingw64+wine and qemu-mips, seems to work thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The misfortune of the wise is better than the prosperity of the fool. -- Epicurus signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/4] avcodec/decode: Consider STRIDE_ALIGN in get_buffer_internal() when checking width
On Thu, Jun 14, 2018 at 05:15:15PM +0200, Michael Niedermayer wrote: > STRIDE_ALIGN is not known in libavutil so av_image_check_size* cannot > consider it > > Fixes: OOM > Fixes: > 8291/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-5176528009691136 will apply patchset [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Does the universe only have a finite lifespan? No, its going to go on forever, its just that you wont like living in it. -- Hiranya Peiri signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] qt-faststart - print errors to stderr
On Thu, Jun 14, 2018 at 11:08:47AM +, Eran Kornblau wrote: > This patch makes qt-faststart output errors to stderr instead of stdout, > following a discussion with Michael on another thread... > > Thanks! > > Eran > qt-faststart.c | 34 +- > 1 file changed, 17 insertions(+), 17 deletions(-) > 821e89a92fdccbf582cf4050248ecfc2f62ed87e > 0001-qt-faststart-print-errors-to-stderr.patch > From f80f9682035e8ba4dcf876394bec2c72308da7e9 Mon Sep 17 00:00:00 2001 > From: erankor > Date: Thu, 14 Jun 2018 14:06:14 +0300 > Subject: [PATCH] qt-faststart - print errors to stderr > > instead of stdout > --- > tools/qt-faststart.c | 34 +- > 1 file changed, 17 insertions(+), 17 deletions(-) will apply thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I do not agree with what you have to say, but I'll defend to the death your right to say it. -- Voltaire signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2] avcodec/mediacodecdec: work around for decoding h264 with coded fields
On Tue, Jun 12, 2018 at 2:37 PM Aman Gupta wrote: > From: Aman Gupta > > This is a hacky work-around for #7092, where the lavc h264 > parser splits coded fields into separate video packets, only one > of which has a PTS set. > > The MediaCodec#queueInputBuffer API expects a PTS along with > incoming video packets, and breaks badly when the PTS is missing > or incorrect (previously it would be passed in as AV_NOPTS_VALUE, > but the same breakage happens if you pass in 0 instead). > > Since it seems there's no easy fix for #7092, this patch stores > the previous PTS in the decoder context and re-uses it for the > second packet. This emulates the behavior of other Android video > From the MediaCodec documentation ( https://developer.android.com/reference/android/media/MediaCodec.html): Upon obtaining an input buffer, fill it with data and submit it to the codec using queueInputBuffer – or queueSecureInputBuffer if using decryption. **Do not submit multiple input buffers with the same timestamp** (unless it is codec-specific data marked as such). So it seems it is not valid to store and re-use the previous PTS when submitting a new input buffer. Though it works on some devices, others will print "Repeating PTS" warnings and corrupt the playback stream. Ideally the mediacodec decoder could simply ask the parser to pass it the original video packet without splitting it up, though I'm not sure how feasible that is. @JEEB also mentioned a possible work-around where intermediary timestamps could be generated by looking at the poc.frame_num of the field picture that is split off into its own packet. Aman > players that don't split the coded fields, and pass them as a single > buffer with the same timestamp. > > Signed-off-by: Aman Gupta > --- > libavcodec/mediacodecdec_common.c | 9 + > libavcodec/mediacodecdec_common.h | 2 ++ > 2 files changed, 11 insertions(+) > > diff --git a/libavcodec/mediacodecdec_common.c > b/libavcodec/mediacodecdec_common.c > index 40a2ee6778..80cbb7afbd 100644 > --- a/libavcodec/mediacodecdec_common.c > +++ b/libavcodec/mediacodecdec_common.c > @@ -448,6 +448,7 @@ static int mediacodec_dec_flush_codec(AVCodecContext > *avctx, MediaCodecDecContex > s->eos = 0; > atomic_fetch_add(&s->serial, 1); > atomic_init(&s->hw_buffer_count, 0); > +s->last_pts = AV_NOPTS_VALUE; > s->current_input_buffer = -1; > > status = ff_AMediaCodec_flush(codec); > @@ -476,6 +477,7 @@ int ff_mediacodec_dec_init(AVCodecContext *avctx, > MediaCodecDecContext *s, > atomic_init(&s->refcount, 1); > atomic_init(&s->hw_buffer_count, 0); > atomic_init(&s->serial, 1); > +s->last_pts = AV_NOPTS_VALUE; > s->current_input_buffer = -1; > > pix_fmt = ff_get_format(avctx, pix_fmts); > @@ -609,6 +611,13 @@ int ff_mediacodec_dec_send(AVCodecContext *avctx, > MediaCodecDecContext *s, > } > > pts = pkt->pts; > +if (pts == AV_NOPTS_VALUE && s->last_pts != AV_NOPTS_VALUE) { > +pts = s->last_pts; > +} else if (pts == AV_NOPTS_VALUE) { > +av_log(avctx, AV_LOG_WARNING, "Packet is missing PTS!\n"); > +pts = 0; > +} > +s->last_pts = pkt->pts; > if (pts != AV_NOPTS_VALUE && avctx->pkt_timebase.num && > avctx->pkt_timebase.den) { > pts = av_rescale_q(pts, avctx->pkt_timebase, AV_TIME_BASE_Q); > } > diff --git a/libavcodec/mediacodecdec_common.h > b/libavcodec/mediacodecdec_common.h > index d280236b8e..9f22006e12 100644 > --- a/libavcodec/mediacodecdec_common.h > +++ b/libavcodec/mediacodecdec_common.h > @@ -69,6 +69,8 @@ typedef struct MediaCodecDecContext { > bool delay_flush; > atomic_int serial; > > +int64_t last_pts; > + > } MediaCodecDecContext; > > int ff_mediacodec_dec_init(AVCodecContext *avctx, > -- > 2.14.2 > > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]lavf/aviobuf: Raise Statistics verbosity to VERBOSE.
2018-06-14 11:33 GMT+02:00, Carl Eugen Hoyos : > Attached patch makes debugging a little easier Patch applied. > (ticket #7257, could > somebody who knows the concat demuxer confirm that this is unavoidable > - or isn't it? 33854 seeks with concat and five seeks with original > file input, four seeks after remuxing the input file, no matter if > file or concat input). Comments still welcome. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] fate: qt-faststart target doesn't include PROGSSUF
On 16-06-2018 01:11 AM, Michael Niedermayer wrote: tested with mingw64+wine and qemu-mips, seems to work thx Pushed. Thanks, Gyan ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel