Tweak encoding params for better quality video

This commit is contained in:
Stephen Seo 2021-12-05 19:54:13 +09:00
parent 9558ee2bd6
commit ddeac3201c
2 changed files with 2 additions and 1 deletions

View file

@ -213,6 +213,7 @@ bool Video::DitherVideo(const std::string &output_filename, Image *blue_noise,
enc_stream->time_base = time_base; enc_stream->time_base = time_base;
enc_codec_context->time_base = time_base; enc_codec_context->time_base = time_base;
enc_codec_context->gop_size = 12; enc_codec_context->gop_size = 12;
enc_codec_context->global_quality = 23;
enc_codec_context->pix_fmt = AVPixelFormat::AV_PIX_FMT_YUV444P; enc_codec_context->pix_fmt = AVPixelFormat::AV_PIX_FMT_YUV444P;
if (avf_enc_context->oformat->flags & AVFMT_GLOBALHEADER) { if (avf_enc_context->oformat->flags & AVFMT_GLOBALHEADER) {
enc_codec_context->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; enc_codec_context->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;

View file

@ -16,7 +16,7 @@ constexpr unsigned int kReadBufPaddingSize = AV_INPUT_BUFFER_PADDING_SIZE;
constexpr unsigned int kReadBufSizeWithPadding = constexpr unsigned int kReadBufSizeWithPadding =
kReadBufSize + kReadBufPaddingSize; kReadBufSize + kReadBufPaddingSize;
constexpr unsigned int kOutputBitrate = 40000000; constexpr unsigned int kOutputBitrate = 80000000;
/*! /*!
* \brief Helper class that uses Image and OpenCLHandle to dither video frames. * \brief Helper class that uses Image and OpenCLHandle to dither video frames.