fix: 编译视频程序使警告消失
This commit is contained in:
4
Makefile
4
Makefile
@@ -4,6 +4,10 @@ CPPFLAGS ?= -Iinclude -Ithird_party/cjson -Ithird_party/kcp
|
||||
LDFLAGS ?= -pthread
|
||||
PYTHON ?= python3
|
||||
|
||||
ifeq ($(QUIET_FFMPEG_LOGS),1)
|
||||
CFLAGS += -DQUIET_FFMPEG_LOGS
|
||||
endif
|
||||
|
||||
BIN_DIR := bin
|
||||
SRC_DIR := src
|
||||
CMD_DIR := cmd
|
||||
|
||||
@@ -268,7 +268,7 @@ AVCodecContext *create_mjpeg_decoder()
|
||||
AVCodecContext *ctx = avcodec_alloc_context3(decoder);
|
||||
ctx->width = WIDTH;
|
||||
ctx->height = HEIGHT;
|
||||
ctx->pix_fmt = AV_PIX_FMT_YUVJ420P; // 使用YUVJ420P
|
||||
ctx->pix_fmt = AV_PIX_FMT_YUVJ420P; // Use YUVJ420P for MJPEG compatibility.
|
||||
ctx->color_range = AVCOL_RANGE_JPEG; // JPEG范围
|
||||
ctx->thread_count = 1;
|
||||
|
||||
@@ -299,7 +299,7 @@ AVCodecContext *create_mjpeg_encoder()
|
||||
AVCodecContext *ctx = avcodec_alloc_context3(encoder);
|
||||
ctx->width = OUTPUT_WIDTH;
|
||||
ctx->height = OUTPUT_HEIGHT;
|
||||
ctx->pix_fmt = AV_PIX_FMT_YUVJ420P; // 使用YUVJ420P
|
||||
ctx->pix_fmt = AV_PIX_FMT_YUVJ420P; // Use YUVJ420P for MJPEG compatibility.
|
||||
ctx->time_base = (AVRational){1, 30};
|
||||
ctx->qmin = 8;
|
||||
ctx->qmax = 31;
|
||||
@@ -432,6 +432,10 @@ int main()
|
||||
|
||||
memset(&sender, 0, sizeof(sender));
|
||||
|
||||
#ifdef QUIET_FFMPEG_LOGS
|
||||
av_log_set_level(AV_LOG_ERROR);
|
||||
#endif
|
||||
|
||||
PRINT_TIME("=== V4L2 Direct Capture + FFmpeg Processing ===\n");
|
||||
|
||||
// 1. Open V4L2 device
|
||||
|
||||
Reference in New Issue
Block a user