More tweaking of encoding params for video

Also tweaked the notes/docs about resulting encoded video output.
This commit is contained in:
Stephen Seo 2021-12-05 20:15:10 +09:00
parent ddeac3201c
commit db2d75de06
3 changed files with 10 additions and 7 deletions

View file

@ -25,10 +25,11 @@ output video being encoded hasn't been implemented yet. The current
implementation writes each video frame to a PNG image in the current
directory.~~
Video decoding and encoding is finished, but there is some noticable drops in
quality when encoding to colored dithered video. It may be better to just
output each frame to individual PNGs, then combining them later just like as
mentioned here: https://trac.ffmpeg.org/wiki/Slideshow .
Video decoding and encoding is finished, ~~but there is some noticable drops in
quality when encoding to colored dithered video~~ but the resulting video may
end up being too large. It may be better to just output each frame to individual
PNGs, then combining them later just like as mentioned here with the params you
want set: https://trac.ffmpeg.org/wiki/Slideshow .
# Other Notes

View file

@ -212,8 +212,10 @@ bool Video::DitherVideo(const std::string &output_filename, Image *blue_noise,
enc_codec_context->height = height;
enc_stream->time_base = time_base;
enc_codec_context->time_base = time_base;
enc_codec_context->gop_size = 12;
enc_codec_context->gop_size = 128;
enc_codec_context->global_quality = 23;
enc_codec_context->qmax = 35;
enc_codec_context->qmin = 20;
enc_codec_context->pix_fmt = AVPixelFormat::AV_PIX_FMT_YUV444P;
if (avf_enc_context->oformat->flags & AVFMT_GLOBALHEADER) {
enc_codec_context->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;

View file

@ -47,8 +47,8 @@ class Video {
* \brief Dithers the frames in the input video.
*
* If output_as_pngs is true, then the output will be individaul PNGs of each
* frame instead of a video file. This may be desireable because the output
* video struggles to maintain video quality.
* frame instead of a video file. This may be desireable for more control over
* the params set when encoding the resulting video.
*
* \return True on success.
*/