Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH v3 1/2] lavc/videotoolboxenc: Dump the encoder
@ 2023-09-08  2:55 Jun Zhao
  2023-09-08  2:55 ` [FFmpeg-devel] [PATCH v3 2/2] lavc/videotoolboxenc: Get the encoder supported properties Jun Zhao
  0 siblings, 1 reply; 4+ messages in thread
From: Jun Zhao @ 2023-09-08  2:55 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Jun Zhao, Jun Zhao

Dump the encoder, it's will help debug some case

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
---
 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;
-- 
2.25.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-08  3:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-08  2:55 [FFmpeg-devel] [PATCH v3 1/2] lavc/videotoolboxenc: Dump the encoder Jun Zhao
2023-09-08  2:55 ` [FFmpeg-devel] [PATCH v3 2/2] lavc/videotoolboxenc: Get the encoder supported properties Jun Zhao
2023-09-08  3:15   ` Marvin Scholz
2023-09-08  3:31     ` mypopy

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git