Set I frame max qp to 22 for nvidia encoder

This commit is contained in:
dijunkun
2023-09-21 17:02:35 +08:00
parent 156172accb
commit 9355b670b8
7 changed files with 44 additions and 9 deletions

View File

@@ -2,7 +2,7 @@
#include "log.h"
#define SAVE_DECODER_STREAM 1
#define SAVE_DECODER_STREAM 0
extern "C" {
#include <libavformat/avformat.h>

View File

@@ -2,7 +2,7 @@
#include "log.h"
#define SAVE_DECODER_STREAM 1
#define SAVE_DECODER_STREAM 0
NvidiaVideoDecoder::NvidiaVideoDecoder() {}
NvidiaVideoDecoder::~NvidiaVideoDecoder() {
@@ -51,7 +51,7 @@ int NvidiaVideoDecoder::Decode(
}
if ((*(data + 4) & 0x1f) == 0x07) {
// LOG_WARN("Receive key frame");
LOG_WARN("Receive key frame");
}
int num_frame_returned = decoder->Decode(data, size);

View File

@@ -1,6 +1,7 @@
#include "video_decoder_factory.h"
#include "ffmpeg/ffmpeg_video_decoder.h"
#include "log.h"
#include "nvcodec/nvidia_video_decoder.h"
VideoDecoderFactory::VideoDecoderFactory() {}
@@ -26,6 +27,9 @@ bool VideoDecoderFactory::CheckIsHardwareAccerlerationSupported() {
CUvideoctxlock cudaCtxLock;
cuResult = cuvidCtxLockCreate(&cudaCtxLock, 0);
if (cuResult != CUDA_SUCCESS) {
LOG_WARN(
"System not support hardware accelerated decode, use default software "
"decoder");
return false;
}