Fix openh264 decode error caused by yuv stride

This commit is contained in:
dijunkun
2023-11-06 19:02:39 -08:00
parent 5ae756bf7f
commit 325f626fb5
9 changed files with 175 additions and 39 deletions

View File

@@ -5,7 +5,7 @@
#include "log.h"
#define SAVE_NV12_STREAM 0
#define SAVE_H264_STREAM 1
#define SAVE_H264_STREAM 0
#define YUV420P_BUFFER_SIZE 1280 * 720 * 3 / 2
unsigned char yuv420p_buffer[YUV420P_BUFFER_SIZE];
@@ -98,7 +98,7 @@ int FFmpegVideoEncoder::Init() {
// av_opt_set_int(codec_ctx_->priv_data, "qp", 51, 0);
// av_opt_set_int(codec_ctx_->priv_data, "crf", 23, 0);
av_opt_set(codec_ctx_->priv_data, "profile", "baseline", 0);
// av_opt_set(codec_ctx_->priv_data, "profile", "baseline", 0);
av_opt_set(codec_ctx_->priv_data, "preset", "ultrafast", 0);
av_opt_set(codec_ctx_->priv_data, "tune", "zerolatency", 0);