[FFmpeg-devel] [PATCH] Added support to enable VBV-End feature with x265 encode
Michael Niedermayer
michael at niedermayer.cc
Sun Oct 20 20:32:55 EEST 2024
On Thu, Oct 17, 2024 at 02:29:36PM +0530, Yaswanth Sastry wrote:
> Hi Michael,
> Here is the updated patch to support Vbv-end Feature,the API in the patch
> is expected to work with X265_BUILD >= 213 only.
[...]
> fftools/ffmpeg_enc.c | 2 ++
> libavcodec/avcodec.h | 1 +
> libavcodec/libx265.c | 5 +++++
> 3 files changed, 8 insertions(+)
> 2cb3d6497999377d776d81684f8b4feee692183a 0001-Added-support-to-enable-VBV-End-feature-with-x265-en.patch
> From 64ce51509c74d7a4f9d86dd73662e561ab9c8845 Mon Sep 17 00:00:00 2001
> From: yaswanthsastry <yaswanth.sastry at multicorewareinc.com>
> Date: Thu, 17 Oct 2024 14:24:47 +0530
> Subject: [PATCH] Added support to enable VBV-End feature with x265 encode
>
> ---
> fftools/ffmpeg_enc.c | 2 ++
> libavcodec/avcodec.h | 1 +
> libavcodec/libx265.c | 5 +++++
> 3 files changed, 8 insertions(+)
>
> diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c
> index a46af4dce1..080e44f2df 100644
> --- a/fftools/ffmpeg_enc.c
> +++ b/fftools/ffmpeg_enc.c
> @@ -187,7 +187,9 @@ int enc_open(void *opaque, const AVFrame *frame)
> InputStream *ist = ost->ist;
> Encoder *e = ost->enc;
> EncoderPriv *ep = ep_from_enc(e);
> + AVFormatContext* ic = input_files[ost->file->index]->ctx;
> AVCodecContext *enc_ctx = e->enc_ctx;
> + enc_ctx->duration = (double)(ic->duration);
> Decoder *dec = NULL;
> const AVCodec *enc = enc_ctx->codec;
> OutputFile *of = ost->file;
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 77ca8dee1f..e6ca5babee 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -2086,6 +2086,7 @@ typedef struct AVCodecContext {
> */
> AVFrameSideData **decoded_side_data;
> int nb_decoded_side_data;
> + double duration;
this is missing doxygen documentation, APIChanges update, minor version bump
and it probably should not be a double but some integer type to be exact
User apps like (FFmpeg) could also access fields from the private context
of libx265.c via AVOption.
[...]
> @@ -785,6 +786,10 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
> }
> }
>
> +#if X265_BUILD >= 213
> +if(ctx->params->vbvBufferEnd)
this is not indented correctly
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Those who are best at talking, realize last or never when they are wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20241020/a30b0076/attachment.sig>
More information about the ffmpeg-devel
mailing list