Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "\"zhilizhao(赵志立)\"" <quinkblack@foxmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 1/2] lavc/videotoolboxenc: Dump the encoder
Date: Tue, 5 Sep 2023 18:47:29 +0800
Message-ID: <tencent_93D3ABA34E4770062DF99AF140F29A319F08@qq.com> (raw)
In-Reply-To: <3F492330-6E56-471C-80CC-03638C013ACC@gmail.com>



> On Sep 5, 2023, at 18:43, Richard Kern <kernrj@gmail.com> wrote:
> 
> 
> 
>> On Sep 3, 2023, at 11:53 PM, Jun Zhao <mypopydev@gmail.com> wrote:
>> 
>> Dump the encoder, it's will help debug some case
>> 
>> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
>> ---
>> libavcodec/videotoolboxenc.c | 20 ++++++++++++++++++++
>> 1 file changed, 20 insertions(+)
>> 
>> diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
>> index bfc03787a0..5633640a30 100644
>> --- a/libavcodec/videotoolboxenc.c
>> +++ b/libavcodec/videotoolboxenc.c
>> @@ -1110,6 +1110,26 @@ static int vtenc_create_encoder(AVCodecContext   *avctx,
>>        return AVERROR_EXTERNAL;
>>    }
>> 
>> +    // Dump the init encoder
>> +    {
>> +        CFStringRef encoderID = NULL;

Nit: encoder_id.

>> +        status = VTSessionCopyProperty(vtctx->session,
>> +                                       kVTCompressionPropertyKey_EncoderID,
>> +                                       kCFAllocatorDefault,
>> +                                       &encoderID);
>> +        if (status == noErr) {
>> +            char names[256] = { 0 };
>> +
>> +            CFStringGetCString(encoderID,
>> +                               names,
>> +                               255,
> Use sizeof(names) - 1 instead of 255. The hard coded value increases the chance of a bug if the size of names is changed. 
> 
>> +                               kCFStringEncodingUTF8);
>> +            av_log(avctx, AV_LOG_INFO, "Init the encoder: %s\n", names);
> This should be logged at the debug level since it doesn’t help users when encoding is successful. 
> 
>> +        }
>> +        if (encoderID != NULL)
>> +            CFRelease(encoderID);
>> +    }

How about extract it to a function so the encoder id can be used in error message?

>> +
>>    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".
> _______________________________________________
> 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".

_______________________________________________
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".

      reply	other threads:[~2023-09-05 10:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-04  3:53 Jun Zhao
2023-09-04  3:53 ` [FFmpeg-devel] [PATCH 2/2] lavc/videotoolboxenc: Get the encoder supported properties Jun Zhao
2023-09-05  7:52   ` Tomas Härdin
2023-09-05  9:36     ` mypopy
2023-09-05  9:49       ` "zhilizhao(赵志立)"
2023-09-05  7:46 ` [FFmpeg-devel] [PATCH 1/2] lavc/videotoolboxenc: Dump the encoder Tomas Härdin
2023-09-05 10:43 ` Richard Kern
2023-09-05 10:47   ` "zhilizhao(赵志立)" [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_93D3ABA34E4770062DF99AF140F29A319F08@qq.com \
    --to=quinkblack@foxmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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