diff mbox

[FFmpeg-devel] lavc/libx265: allow users to set closed GOP via generic lavc flag

Message ID 16ff119d-6bc7-664b-cd3e-e462194fe29e@gmail.com
State Accepted
Commit 841c1efc78ace70497187d984adf31c7cc2cd7b6
Headers show

Commit Message

Gyan June 1, 2018, 10:49 a.m. UTC
From 525f2422bc2b0544fce59031b8995c4e13fd813c Mon Sep 17 00:00:00 2001
From: Gyan Doshi <ffmpeg@gyani.pro>
Date: Fri, 1 Jun 2018 16:14:02 +0530
Subject: [PATCH] lavc/libx265: allow users to set closed GOP via generic lavc
 flag

lavc flag 'cgop' can be used to set closed GOP.
---
 libavcodec/libx265.c | 1 +
 libavcodec/version.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Derek Buitenhuis June 1, 2018, 1:15 p.m. UTC | #1
On Fri, Jun 1, 2018 at 11:49 AM, Gyan Doshi <gyandoshi@gmail.com> wrote:

[...]

What is the default setting? If it is setting open GOP by default,
I think this is a bad idea.

- Derek
Gyan June 1, 2018, 1:25 p.m. UTC | #2
On 01-06-2018 06:45 PM, Derek Buitenhuis wrote:

> What is the default setting? If it is setting open GOP by default,
> I think this is a bad idea.

x265's default setting is open GOP. lavc's default is open as well.

Regards,
Gyan
Derek Buitenhuis June 1, 2018, 1:38 p.m. UTC | #3
On Fri, Jun 1, 2018 at 2:25 PM, Gyan Doshi <gyandoshi@gmail.com> wrote:
> x265's default setting is open GOP. lavc's default is open as well.

LGTM then.

- Derek
Gyan June 1, 2018, 4:08 p.m. UTC | #4
On 01-06-2018 07:08 PM, Derek Buitenhuis wrote:
> On Fri, Jun 1, 2018 at 2:25 PM, Gyan Doshi <gyandoshi@gmail.com> wrote:
>> x265's default setting is open GOP. lavc's default is open as well.
> 
> LGTM then.
> 
> - Derek

Thanks. Will push soon.

Gyan
James Almer June 1, 2018, 7:39 p.m. UTC | #5
On 6/1/2018 10:38 AM, Derek Buitenhuis wrote:
> On Fri, Jun 1, 2018 at 2:25 PM, Gyan Doshi <gyandoshi@gmail.com> wrote:
>> x265's default setting is open GOP. lavc's default is open as well.
> 
> LGTM then.
> 
> - Derek

If bOpenGOP is now configurable, maybe the same should be done with
keyframeMin and keyframeMax using AVCodecContext's keyint_min and
gop_size respectively?
diff mbox

Patch

diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index c208c0f2d3..bb457dfe5a 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -114,6 +114,7 @@  static av_cold int libx265_encode_init(AVCodecContext *avctx)
     ctx->params->sourceWidth     = avctx->width;
     ctx->params->sourceHeight    = avctx->height;
     ctx->params->bEnablePsnr     = !!(avctx->flags & AV_CODEC_FLAG_PSNR);
+    ctx->params->bOpenGOP        = !(avctx->flags & AV_CODEC_FLAG_CLOSED_GOP);
 
     /* Tune the CTU size based on input resolution. */
     if (ctx->params->sourceWidth < 64 || ctx->params->sourceHeight < 64)
diff --git a/libavcodec/version.h b/libavcodec/version.h
index f65346a1ac..5a70093eaa 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@ 
 
 #define LIBAVCODEC_VERSION_MAJOR  58
 #define LIBAVCODEC_VERSION_MINOR  19
-#define LIBAVCODEC_VERSION_MICRO 104
+#define LIBAVCODEC_VERSION_MICRO 105
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \