From patchwork Thu Mar 30 09:38:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 40919 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4645:b0:e3:3194:9d20 with SMTP id eb5csp1184821pzb; Thu, 30 Mar 2023 02:38:49 -0700 (PDT) X-Google-Smtp-Source: AKy350ZhDgIylF6TdeHX/9xtnfo7bChJ2PcxjZWegpZWdn3I6/DhURZQvaCH2fzes4mIWbkaBNF0 X-Received: by 2002:aa7:d806:0:b0:4fc:3777:f630 with SMTP id v6-20020aa7d806000000b004fc3777f630mr22237833edq.0.1680169129291; Thu, 30 Mar 2023 02:38:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680169129; cv=none; d=google.com; s=arc-20160816; b=XsezG8MuT4Gx/ODgQLYRngUCxalBKQByf9MaL000n5VPz85/ibw0u7wmAkJYe4mr3d wY2aQ+6i7gbhlTLEV4IsvcZ+C6/ve0PtHZmHfkcOj1RHhNPJ426Q/2VwR+LuiCZsHQPX uoQurYXvCDrkFdPo5QmraXF53LjQilnYgFGRPFKPQdKb+v2WqTZ8FfEvahiKkiIgGE4G MpnJaGYsmUZkF33BP+l2ALbYO1/yrtOVjpf8uRHFCsDJERwE9HfAO9v4RysFuLaJRjKK 0Z90IkWsScEVMDWWLi0+vPJrGAGcTHHmB3Xcrp6i2iVhy78jbKfUgS5x7F6sbXEM7rCu hW2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=DPsoefNLRcs7zOkKg1GQ+icfCxCCVr8BF/7O3dRKxvQ=; b=twTjZdh59NNRBkr6elSgrsamKRF4s4Ndb6Fv6T1/hZXLQoC0opW4QumjTypbsQRRtQ o1Qwcjb0Q3vR3ylGkNO1BS5K4GJ3xKqYJ1zJLLHxmgANWNiY61eX6td76Yb54dPCppJi upZFxDjyIkMN2AaxppnjlkuT+DIvhCupIMT9vk94LAqGNBfMHyrmGdTfyVXr/hoEAfQx 6vXSiUM4yJawXO5Ww30cWjiEa7+guZzCaDmVb/avyNoZ2kB2MHN0+KlZe/oCimflB61t VSBcfW1PtC3H6XEtlg3AQV1NfsIb9mLUTTY+tnJ7SKR4dGZXoQYYMSPUAhAiAhblgKDD mJAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g17-20020aa7d1d1000000b004ad7a9f851csi37125295edp.390.2023.03.30.02.38.48; Thu, 30 Mar 2023 02:38:49 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D613E68C605; Thu, 30 Mar 2023 12:38:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 546BD68C352 for ; Thu, 30 Mar 2023 12:38:38 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 0A7462404F5 for ; Thu, 30 Mar 2023 11:38:38 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id lO8pH17uyS-p for ; Thu, 30 Mar 2023 11:38:37 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 6C64E2404EC for ; Thu, 30 Mar 2023 11:38:37 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 2549F3A039B for ; Thu, 30 Mar 2023 11:38:31 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 30 Mar 2023 11:38:08 +0200 Message-Id: <20230330093809.22687-2-anton@khirnov.net> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230330093809.22687-1-anton@khirnov.net> References: <20230330093809.22687-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] lavf/mux: clarify log messages when choosing oformat fails X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: nShFccwPfkA5 Current log messages talk about 'suitable' output formats. This is confusing, because it suggests that some formats are suitable, while others are not, which is not the case. Also, suggest possible user actions when format cannot be guessed from a filename. --- libavformat/mux.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libavformat/mux.c b/libavformat/mux.c index 0bc9b6b87d..415bd3948f 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -102,7 +102,7 @@ int avformat_alloc_output_context2(AVFormatContext **avctx, const AVOutputFormat if (format) { oformat = av_guess_format(format, NULL, NULL); if (!oformat) { - av_log(s, AV_LOG_ERROR, "Requested output format '%s' is not a suitable output format\n", format); + av_log(s, AV_LOG_ERROR, "Requested output format '%s' is not known.\n", format); ret = AVERROR(EINVAL); goto error; } @@ -110,8 +110,10 @@ int avformat_alloc_output_context2(AVFormatContext **avctx, const AVOutputFormat oformat = av_guess_format(NULL, filename, NULL); if (!oformat) { ret = AVERROR(EINVAL); - av_log(s, AV_LOG_ERROR, "Unable to find a suitable output format for '%s'\n", - filename); + av_log(s, AV_LOG_ERROR, + "Unable to choose an output format for '%s'; " + "use a standard extension for the filename or specify " + "the format manually.\n", filename); goto error; } }