From patchwork Fri Sep 11 16:11:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 22291 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 9E7D244A058 for ; Fri, 11 Sep 2020 19:19:35 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8CF2568BAFD; Fri, 11 Sep 2020 19:19:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B776868BAAB for ; Fri, 11 Sep 2020 19:19:28 +0300 (EEST) Received: by mail-lf1-f41.google.com with SMTP id b22so2859290lfs.13 for ; Fri, 11 Sep 2020 09:19:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=oI/WzoRrSxoazDh+Xs3EKY/Q33J/xfva6/R0dV83lC4=; b=tMTIxCZ/qxr1coKLJdOh8JqXw8vlBKUlNX7sMWETHBZTcccnlX1/FDLQfOcrS0zEqf 7kPNnKS8sN5nIBKZBJme8iFMZZakx82oZPKYGt8y+R7r6xq1GIMm62uRYtppsmQY4jNi pxlicywbsJaQiR20/BTFgIn24WsM+PINh6wk5L5t+zVxWfC3KpZdOUSEkDpLsy6WcpCw UV319PZ4AbTtNihpPxoO8+SMYs2iBwGL6QcX4A60UiMm890sAtuYLcHxf5A1dtsr3xWp Vd3UoeWo0Q+tMm11supK3vkQggwTStvLzphKJc/dJRCv75FY83Sbw5XcyiF4zkfEsoOU /v+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oI/WzoRrSxoazDh+Xs3EKY/Q33J/xfva6/R0dV83lC4=; b=LTE6GFpf85ZuC3FOZquauDHnMa59ur3PPiFJA9zVUJhbSbDdujmRml9Ach/ReDixus roaYNGhZPIi+fxpu0L5RAodbZ6l5En7rMURP7mwkOp3xDKxD2Mbm6hBdoHIgn8fiPNNA Ywd24ep3o+pUUT9U8OdFeH+w+ZW2FBHPpgbjO31QlzPcw9BMR+PtpRoBwlR1i/zzhOOh F3vUF/tgEkZlEctQ2Xby1Y9de6M3qXG8+QAZI+LKW1etGQAVj//4Ss0e/qTaR/c4tvuf N/s43C8Zr7PNEjnYpO3A7ONOyZPTbMOjxpHsYgI3ry+IsNpCHxIzLRXVe+VWEopdJDxR fylA== X-Gm-Message-State: AOAM5339hz2ASRJ5bNdB6C3tiWrWqmpyq4nodehIbsE5xYHh/wSH9pqb Ig37yKH2ProY1zqYlEZaApljpXQWNv8= X-Google-Smtp-Source: ABdhPJwGaB3/hM8XcmW6yllBvDmIpTvTa3Ig/TFcI/bkikXIazOZck9ngrvyvwX2MPpafcLsoH2gJg== X-Received: by 2002:a19:8209:: with SMTP id e9mr476918lfd.254.1599840672460; Fri, 11 Sep 2020 09:11:12 -0700 (PDT) Received: from localhost.localdomain (91-159-194-103.elisa-laajakaista.fi. [91.159.194.103]) by smtp.gmail.com with ESMTPSA id 193sm134285lfb.212.2020.09.11.09.11.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 09:11:11 -0700 (PDT) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Fri, 11 Sep 2020 19:11:07 +0300 Message-Id: <20200911161107.24870-5-jeebjp@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200911161107.24870-1-jeebjp@gmail.com> References: <20200911161107.24870-1-jeebjp@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/4] ffmpeg: warn if an encoder has to be initialized without an AVFrame 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This should make it easier to spot such cases. --- fftools/ffmpeg.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 63c8771a01..70e7274d87 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -3281,6 +3281,20 @@ static int init_output_stream_encode(OutputStream *ost, AVFrame *frame) AVFormatContext *oc = output_files[ost->file_index]->ctx; int j, ret; + if ((enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO || + enc_ctx->codec_type == AVMEDIA_TYPE_AUDIO) && + !frame) { + const AVCodecDescriptor *description = \ + avcodec_descriptor_get(ost->enc_ctx->codec_id); + + av_log(NULL, AV_LOG_WARNING, + "Initializing %s output stream %d:%d (%s) without an available " + "AVFrame! Possibility of less accurate configuration!\n", + av_get_media_type_string(enc_ctx->codec_type), + ost->file_index, ost->index, + description ? description->name : "no encoder"); + } + set_encoder_id(output_files[ost->file_index], ost); // Muxers use AV_PKT_DATA_DISPLAYMATRIX to signal rotation. On the other