From patchwork Fri Sep 8 04:39:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Zhao X-Patchwork-Id: 43651 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4e27:b0:149:dfde:5c0a with SMTP id gk39csp248819pzb; Thu, 7 Sep 2023 21:39:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzeTs1hgNpIAvkXHZOwioRCE7smjDYdacLlg4xfgU4nc/clPkTMlzaPfqMFCcoImJhnG3a X-Received: by 2002:a17:906:31d7:b0:9a6:7fee:8251 with SMTP id f23-20020a17090631d700b009a67fee8251mr789324ejf.56.1694147998307; Thu, 07 Sep 2023 21:39:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694147998; cv=none; d=google.com; s=arc-20160816; b=TO4GmRROdfSTdTVgwVyMHcMHUjk7NS41aU5ovYKHdfvLqbYIjxnc6ZQvGZyKjA3nLu uPua5b5LaB8FXcSKVuWy8lwfRV+AJRCwnN7OaOxHKeswTjhKo9Xi9KwXk5lN/BDydf2M 5OsEtXVsPbo+L9llg1O9nxgImzPa2rGXR75alDr8JcFpuCqkqhPLoxxA7HL/bteAM28S itAphvtCCwWD0o9zVEB7Vn48I6K44agM3VoD6PMDRbKAqWEpZ9vb1JlHmWSJPHxuoulF EF1Q6VDBqkwdio3M/DLTr9Cb0rkIvXx1LPG62sH3Ii+v4bpUr4ceySAK20nyWaTHLf2R iTXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=TkddzBTGDfNC+WRxUozt4gIp84Nee3V3HpNNPAu2P14=; fh=paNsSD/gLXCX8XaG2wP2EhSbyn4+hY3DzFJxc2Arm+k=; b=n+fpwtnrS92OsCG6Qltqu1PmzGrDUo/bGIkwJMIsa/FGRDMs3cS4ZpZdm8dpVx0pl+ jkQ1n1sIiwPfV8CS+da8o9z50cgHtI4z9nSaw4sfxyfwKMWW3fe6F8qPLWkxSTgxJI+u ayqIHDRFsVtt3Rn2Hm5Zo/+Pcla/NzH1HCoZ9pS4Px2Y6CWCYNId/hc+bSVbnL6xwA0X w2MJg57JAUFqIojPnerxw3ShBLEGEp/33si/TbJHSNd85R3tAzf7WmwTXyA05eZjqDHf vJNlHMxKRXAZaZuhy1dQtwnoyMQ7MEpePNkOtG+hWl5ks3uZRBscNu5+kKZE+SgzfPIA QCVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20221208 header.b=HwNpy9tf; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id c25-20020a17090603d900b00986432cf57csi612572eja.942.2023.09.07.21.39.57; Thu, 07 Sep 2023 21:39:58 -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=@gmail.com header.s=20221208 header.b=HwNpy9tf; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C83E768C7F2; Fri, 8 Sep 2023 07:39:53 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C905A68C688 for ; Fri, 8 Sep 2023 07:39:47 +0300 (EEST) Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-401bbfc05fcso18484095e9.3 for ; Thu, 07 Sep 2023 21:39:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694147987; x=1694752787; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=BjssOh5KTiXgFW36PBFkrfa+mIt4IBIz/MpQGk1/GFk=; b=HwNpy9tffs1n9pVVXFvnhn2fSa8npUyPT2WsPGDoCem0tiqTkgRDYSwrMMsyL+xpla PV7WnMLdLUS6dfw2VCYI/QopOW8+i1IYc6w+bIIz9xG09+ibkzC59VUGhK2X8bqE9ZS/ E96Z3s9iLUzlkwIWhu7y/6i2hTmMwQXNwzziZ8mLpqRX7wbBOxPE7TncVRtRNRIxAz5F 4hPRh5orN4BAYKgSHdnLIwpkXSDbpxadhwukmJPjV4iS91kzzSshsmtWU9J9V0q6maH/ oyPfULeYm4WxpO3EbqL0GQcSctSaxNIdivPiyMmwuV7G9JGtY5FgfdoeCFRbJ7kBe6qT uaQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694147987; x=1694752787; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BjssOh5KTiXgFW36PBFkrfa+mIt4IBIz/MpQGk1/GFk=; b=T48eA2fAYJbVVvjM0WMPRZyxIOO41TKIUpwo0vPYkyawUC+JhX+W4WdOt4qbi/38Tv 9HprCS0Sn+gbOeninAEZoSxvgNA28ddR/Rha04nbfKhZTRxra8QNy+V0VyfiKymVXKxm ljTt0QJWD/PdkjwD0cU9ByKg7MTy9bWl01wDQhK3OvI/iDR7xUQQGwqMEoy9wvY8Rpy0 oBn0vMVXsHOd/hq26jvpvUlQvAeUcx/vL6XFxmt46as1mmlw3kpq0o0w8ZrFYLrmLNHe OPRq8ZG5ofugnAA7pAf4z1naAqxEvvSOOVSP5h711MDRyTtTCH1mmVc/iV2q++jREK1S IpoQ== X-Gm-Message-State: AOJu0YxZZOqPrAwav+vN0hgMBVp+UvEjo5pmcwIiQGoT1n9N74jPY7gB PAsW3IaSgQRrolt0HI076v4RzfjiAOYAFKfz X-Received: by 2002:a7b:ce0a:0:b0:401:d803:6250 with SMTP id m10-20020a7bce0a000000b00401d8036250mr1188267wmc.5.1694147986577; Thu, 07 Sep 2023 21:39:46 -0700 (PDT) Received: from localhost.localdomain ([49.51.162.193]) by smtp.gmail.com with ESMTPSA id w3-20020a05600c014300b003fefe70ec9csm4120242wmm.10.2023.09.07.21.39.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 21:39:46 -0700 (PDT) From: Jun Zhao To: ffmpeg-devel@ffmpeg.org Date: Fri, 8 Sep 2023 12:39:42 +0800 Message-Id: <20230908043943.3230926-1-mypopydev@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v4 1/2] lavc/videotoolboxenc: Dump the encoder 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 Cc: Jun Zhao , Jun Zhao Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: BrDcjaFPO/vI Dump the encoder, it's will help debug some case Signed-off-by: Jun Zhao --- libavcodec/videotoolboxenc.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c index d0a00347b5..2e96990741 100644 --- a/libavcodec/videotoolboxenc.c +++ b/libavcodec/videotoolboxenc.c @@ -1110,6 +1110,34 @@ static int vtenc_create_encoder(AVCodecContext *avctx, return AVERROR_EXTERNAL; } + // Dump the init encoder + { + CFStringRef encoderID = NULL; + status = VTSessionCopyProperty(vtctx->session, + kVTCompressionPropertyKey_EncoderID, + kCFAllocatorDefault, + &encoderID); + if (status == noErr) { + CFIndex length = CFStringGetLength(encoderID); + CFIndex max_size = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8); + char *name = av_malloc(max_size); + if (!name) { + CFRelease(encoderID); + return AVERROR(ENOMEM); + } + + CFStringGetCString(encoderID, + name, + max_size, + kCFStringEncodingUTF8); + av_log(avctx, AV_LOG_DEBUG, "Init the encoder: %s\n", name); + + av_freep(&name); + } + if (encoderID != NULL) + CFRelease(encoderID); + } + if (avctx->flags & AV_CODEC_FLAG_QSCALE && !vtenc_qscale_enabled()) { av_log(avctx, AV_LOG_ERROR, "Error: -q:v qscale not available for encoder. Use -b:v bitrate instead.\n"); return AVERROR_EXTERNAL;