encoderd: use AV_CODEC_ID_H264 codec for qcamera encoding (#34498)

This commit is contained in:
Dean Lee
2025-02-11 20:46:43 +08:00
committed by GitHub
parent 3c0990e716
commit 644130ca3d
+4 -1
View File
@@ -48,7 +48,10 @@ FfmpegEncoder::~FfmpegEncoder() {
}
void FfmpegEncoder::encoder_open(const char* path) {
const AVCodec *codec = avcodec_find_encoder(AV_CODEC_ID_FFVHUFF);
auto codec_id = encoder_info.encode_type == cereal::EncodeIndex::Type::QCAMERA_H264
? AV_CODEC_ID_H264
: AV_CODEC_ID_FFVHUFF;
const AVCodec *codec = avcodec_find_encoder(codec_id);
this->codec_ctx = avcodec_alloc_context3(codec);
assert(this->codec_ctx);