From 46d3e35c3079ede0ec4f92db9e35939d45aa3898 Mon Sep 17 00:00:00 2001 From: zhongkaizhu Date: Wed, 20 Oct 2021 19:35:58 +0800 Subject: [PATCH] Fix "Could not find v4l2 muxer" The AVOutputFormat name is a comma-separated list. In theory, possible names for V4L2 are: - "video4linux2,v4l2" - "v4l2,video4linux2" - "v4l2" - "video4linux2" To find the muxer in all cases, we must request exactly one muxer name at a time. PR #2718 Co-authored-by: Romain Vimont Signed-off-by: Romain Vimont --- app/src/v4l2_sink.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/v4l2_sink.c b/app/src/v4l2_sink.c index cae3eee9..95e20541 100644 --- a/app/src/v4l2_sink.c +++ b/app/src/v4l2_sink.c @@ -183,8 +183,11 @@ sc_v4l2_sink_open(struct sc_v4l2_sink *vs) { goto error_mutex_destroy; } - // FIXME - const AVOutputFormat *format = find_muxer("video4linux2,v4l2"); + const AVOutputFormat *format = find_muxer("v4l2"); + if (!format) { + // Alternative name + format = find_muxer("video4linux2"); + } if (!format) { LOGE("Could not find v4l2 muxer"); goto error_cond_destroy;