From patchwork Thu Jun 15 16:59:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wm4 X-Patchwork-Id: 3989 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.22.4 with SMTP id 4csp892471vsw; Thu, 15 Jun 2017 10:00:09 -0700 (PDT) X-Received: by 10.223.163.27 with SMTP id c27mr4338140wrb.85.1497546009226; Thu, 15 Jun 2017 10:00:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497546009; cv=none; d=google.com; s=arc-20160816; b=M3O083BVIHNWPZ6SunO4N0CFINrKR2xpdJ1u5/70q8WtscKhVZgYrcL59lQ+hNddYe wqfFGi0RYWhwBo4Ad5cIVL7wGKLqCzNBLgb8SFpO3tCO5Sbhwf9yoIKqJ26eBY29ZKlk KW/YCF8ZtfnHryAnqG3WpSm3Zzc7DuQDVEsmvA1i2AZJWVlaBhaguvjzMoQN9bbvbjlT KSi4bXpJN0tEQhZumOJ+PD3+DfqP0JnjMoCsapATmePSS7Y8J08iB5uT9NxvFeaOSJRF garU0ZEpMg3+4NH+6X3uc8hbjZ80I7tLHZgxDXaGUZPUuzU3+Qzi7QPS2ibO8+90gi2i nh+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=yjQ4sSu9iDKZSF+zp9d6yNS7NXhVQaK2BylL63NOtBE=; b=pOpOkMpK916y+QB50M5CLbx49eE34PdB8O3fbiTjegwUn6VRJS9ujsrfQW2HSkEbu1 rcecS+L0E7OsKdN4EBuvtXwhXlGnImrm1xx9h0KwtnrRcb8g3d+NWo5EOGRpi7KHOohk +vAA95jtgNtGKBRPD5UGODNlmrd8F2mZSSssDY7MCzR0EvriUh+QSrMqB+uBVTYdy8GL gQRy1TV7XIUg1vXsM3VpFVOP1HKqsxkhh8SmliA3knXmSRmaUten5jJBvEm6I4TkM3jS q/u2HdkFHLJU2aLfLpAFYJQ/cPw3IOiHirzjUCp+TiG+907d7hLSD9e1OZkTCl95GsMB jxMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@googlemail.com header.b=SjNaDMj0; 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id e17si644241wmf.17.2017.06.15.10.00.08; Thu, 15 Jun 2017 10:00:09 -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; dkim=neutral (body hash did not verify) header.i=@googlemail.com header.b=SjNaDMj0; 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AADDA68A368; Thu, 15 Jun 2017 20:00:02 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 57E2068A360 for ; Thu, 15 Jun 2017 19:59:56 +0300 (EEST) Received: by mail-wm0-f50.google.com with SMTP id x70so5047577wme.0 for ; Thu, 15 Jun 2017 09:59:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=YnS5bVr7tViDzAlQEohGwmKBJNWx9gqsPdFY/JORhbE=; b=SjNaDMj0L0i9PgjWgbDKIZnrPdB6VeFD+q7HCpnSasY2WZJxZd6ipd4MDDIiD4031j aQ67n51YZzVkWDnFAK9DeTw+ewhBsV4VbMfl/YdVUBgmnDZGfypNDFIByeuf2rItp5T4 0NaEFJKHn8hOeMWWD1IZ4qpciXxT6U86u6BE8w2TTmmyBJ4mBP4NKVj35b7TUTem+31B VTpxWb2wb8x+uRUPV8PajI1BhORKw6y2z97TFbdgZwqBb9SHaShC1HXfgWcryuzebIU+ UF9cBJeucz+JnH4AXX1nleVw6sY9zlyjiBl7L5e4sv0RPRNU8dV16MKYRrlS7UTSLtPW FmIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=YnS5bVr7tViDzAlQEohGwmKBJNWx9gqsPdFY/JORhbE=; b=sbEXx5ifWHBOtl1As6xIDTI3xbYXH/OfSQwVujYP7h6JCNpDeMhOf1SYvnZuriuVLe g9mF0E3rIOIcjM4cg9Um3gLGzeH97V7lz4yFrlU3EENqmd2qjf5BYIZuQy05fYZc06+E 8dq5ZtmZk+zODHcfQcDk7K9AnLlRWm4jZox2AJWqJGmdfsRCBiesEYTupnHMY8aJKMgq dcXME+lw1fNLMQwPd4oF5Vwk5XfHgHZPRIuZXdsfqA7DfIzd9PWg5kQ4UWkN5/ajG7bz htR4CPId5XIdbM0GNRADjOXlfO0A7yo/8ib14UngsS06a6JVAzCEdduA56E0d901sVGS TTjw== X-Gm-Message-State: AKS2vOxzrRd4bPYFttke/eAmDBqF7j678UfyMLWYu8bMa7QBnVSTabt7 Ky7izRMxfof/YGIN X-Received: by 10.28.147.202 with SMTP id v193mr4385890wmd.37.1497545996545; Thu, 15 Jun 2017 09:59:56 -0700 (PDT) Received: from localhost.localdomain (p4FF02697.dip0.t-ipconnect.de. [79.240.38.151]) by smtp.googlemail.com with ESMTPSA id 49sm719062wrz.8.2017.06.15.09.59.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Jun 2017 09:59:55 -0700 (PDT) From: wm4 To: ffmpeg-devel@ffmpeg.org Date: Thu, 15 Jun 2017 18:59:59 +0200 Message-Id: <20170615165959.15378-1-nfxjfg@googlemail.com> X-Mailer: git-send-email 2.11.0 Subject: [FFmpeg-devel] [PATCH] ffmpeg: remove misleading and incorrect error messages X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Cc: wm4 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" It is wrong/incorrect in two aspects: 1. The pixel format is not enough to guarantee that the resulting file will be any more compatible with media players. 2. Media players not supporting higher profiles are not necessarily outdated (in fact this is simply an arrogant statement that libavcodec can handle these particular features). You could add that there are plenty of other ways to produce widely incompatible files with ffmpeg, and these don't show any warnings. What we really want to do here is defaulting to codec profiles that have wide compatibility, such as baseline/main/high for h264. Also, if an encoder does not accept certain pixfmts, we should automatically convert them to a pixfmt the encoder can accept. But the existin message certainly is not appropriate. It also works for 2 specific encoders only. We should remove the message for the reason alone to avoid that this code grows in the future, and becomes a maintenance burden. --- ffmpeg.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 6170bd453c..a783e6e04b 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -3343,20 +3343,7 @@ static int init_output_stream_encode(OutputStream *ost) ost->frame_aspect_ratio.num ? // overridden by the -aspect cli option av_mul_q(ost->frame_aspect_ratio, (AVRational){ enc_ctx->height, enc_ctx->width }) : av_buffersink_get_sample_aspect_ratio(ost->filter->filter); - if (!strncmp(ost->enc->name, "libx264", 7) && - enc_ctx->pix_fmt == AV_PIX_FMT_NONE && - av_buffersink_get_format(ost->filter->filter) != AV_PIX_FMT_YUV420P) - av_log(NULL, AV_LOG_WARNING, - "No pixel format specified, %s for H.264 encoding chosen.\n" - "Use -pix_fmt yuv420p for compatibility with outdated media players.\n", - av_get_pix_fmt_name(av_buffersink_get_format(ost->filter->filter))); - if (!strncmp(ost->enc->name, "mpeg2video", 10) && - enc_ctx->pix_fmt == AV_PIX_FMT_NONE && - av_buffersink_get_format(ost->filter->filter) != AV_PIX_FMT_YUV420P) - av_log(NULL, AV_LOG_WARNING, - "No pixel format specified, %s for MPEG-2 encoding chosen.\n" - "Use -pix_fmt yuv420p for compatibility with outdated media players.\n", - av_get_pix_fmt_name(av_buffersink_get_format(ost->filter->filter))); + enc_ctx->pix_fmt = av_buffersink_get_format(ost->filter->filter); if (dec_ctx) enc_ctx->bits_per_raw_sample = FFMIN(dec_ctx->bits_per_raw_sample,