> -----Original Message----- > From: ffmpeg-devel [mailto:[email protected]] On Behalf > Of James Zern > Sent: Thursday, August 1, 2019 07:15 > To: FFmpeg development discussions and patches <ffmpeg- > [email protected]> > Subject: Re: [FFmpeg-devel] [PATCH, v2 3/3] lavc/libvpxenc: add dynamic > resolution encode support for libvpx > > Hi, > > On Tue, Jul 30, 2019 at 10:06 PM Linjie Fu <[email protected]> wrote: > > [...] > > diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c > > index feb52ea..800ba18 100644 > > --- a/libavcodec/libvpxenc.c > > +++ b/libavcodec/libvpxenc.c > > @@ -1067,6 +1067,15 @@ static int vpx_encode(AVCodecContext *avctx, > AVPacket *pkt, > > int res, coded_size; > > vpx_enc_frame_flags_t flags = 0; > > > > + if (frame && (avctx->width != frame->width || > > + avctx->height != frame->height)) { > > + avctx->width = frame->width; > > + avctx->height = frame->height; > > + > > + avctx->codec->close(avctx); > > You shouldn't need to destroy the encoder for a resolution change, > unless I'm missing something. Take a look at resize_test.cc [1]. > > [1] > https://chromium.googlesource.com/webm/libvpx/+/refs/heads/master/te > st/resize_test.cc#305
Yes, IMHO vp8 supports resolution change in key frame, and for vp9, resolution change is supported per frame, thus current modification may lead to unnecessary Key frames. Will find a better solution. Thanks. - linjie _______________________________________________ ffmpeg-devel mailing list [email protected] https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
