refactor(hwcodec): 精简FFmpeg编译配置并移除解码器

- 优化FFmpeg编译选项,禁用不需要的库(avformat/swscale/swresample/avfilter等)
- 禁用所有解码器和大部分编码器,只保留实际使用的H264/H265/VP8/VP9编码器
- 移除hwcodec解码器模块,MJPEG解码改用libyuv实现
- 移除MJPEG编码器支持
- x86_64添加libmfx支持QSV编码器
- 修复H265 RKMPP编码器支持YUYV直接输入
This commit is contained in:
mofeng-git
2026-01-02 12:31:11 +08:00
parent 04e62d1e3f
commit be4de59f3b
13 changed files with 258 additions and 794 deletions

View File

@@ -411,9 +411,22 @@ impl SharedVideoPipeline {
Box::new(H264EncoderWrapper(encoder))
}
VideoEncoderType::H265 => {
let encoder_config = H265Config::low_latency(config.resolution, config.bitrate_kbps);
// Determine H265 input format based on backend and input format
let encoder_config = if use_yuyv_direct {
H265Config::low_latency_yuyv422(config.resolution, config.bitrate_kbps)
} else {
H265Config::low_latency(config.resolution, config.bitrate_kbps)
};
let encoder = if let Some(ref backend) = config.encoder_backend {
let encoder = if use_yuyv_direct {
// Force RKMPP backend for YUYV direct input
let codec_name = get_codec_name(VideoEncoderType::H265, Some(EncoderBackend::Rkmpp))
.ok_or_else(|| AppError::VideoError(
"RKMPP backend not available for H.265".to_string()
))?;
info!("Creating H265 encoder with RKMPP backend for YUYV direct input (codec: {})", codec_name);
H265Encoder::with_codec(encoder_config, &codec_name)?
} else if let Some(ref backend) = config.encoder_backend {
let codec_name = get_codec_name(VideoEncoderType::H265, Some(*backend))
.ok_or_else(|| AppError::VideoError(format!(
"Backend {:?} does not support H.265", backend