Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: =?gb18030?B?zP2jrMzssd+1xLjo?= <76138202@qq.com>
To: =?gb18030?B?ZmZtcGVnLWRldmVs?= <ffmpeg-devel@ffmpeg.org>
Subject: [FFmpeg-devel] vcodec_open2 error: Internal bug, should not have happened
Date: Mon, 10 Jul 2023 15:21:17 +0800
Message-ID: <tencent_B19F12D54144EC802B9D3782F9EF55F89D0A@qq.com> (raw)

I am trying to implement the OpenMax IL Video Decoder on ffmpeg. But I meet some problems. When I use the codec with ffmpeg on Chrome by force, it raised a error of bug
ffmpeg_video_decoder.cc(491)] avcodec_open2 error: Internal bug, should not have happened
I 'm not familiar with the version of ffmpeg in the last serveral years. My codec can run success when using&nbsp;
./ffmpeg -c:v h264_omxcodec -i test1.mp4 output_video.mp4
and I haven't find out how to enable logging of ffmpeg on Chrome(I don't know why&nbsp;av_log_set_callback() is useless when I used it),
so Is there anyone can give me some advices?


Thx a lot.


The FFCodec is used as following:&nbsp;


#define OFFSET(x) offsetof(OMXCodecDecoderContext, x)
#define VDE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_ENCODING_PARAM
#define VE&nbsp; AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
#define VD&nbsp; AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM






static const AVCodecHWConfigInternal *const omx_hw_configs[] = {
&nbsp; &nbsp; &amp;(const AVCodecHWConfigInternal) {
&nbsp; &nbsp; &nbsp; &nbsp; .public&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .pix_fmt&nbsp; &nbsp; &nbsp;= AV_PIX_FMT_NV12,
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .methods&nbsp; &nbsp; &nbsp;= AV_CODEC_HW_CONFIG_METHOD_AD_HOC |
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX,
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .device_type = AV_HWDEVICE_TYPE_OMX,
&nbsp; &nbsp; &nbsp; &nbsp; },
&nbsp; &nbsp; &nbsp; &nbsp; .hwaccel&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= NULL,
&nbsp; &nbsp; },
&nbsp; &nbsp; NULL
};




static const AVOption ff_omxcodec_vdec_options[] = {
&nbsp; &nbsp; { "delay_flush", "Delay flush until hw output buffers are returned to the decoder",
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;OFFSET(delay_flush), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, VD },
&nbsp; &nbsp; { NULL }
};


#define DECLARE_OMX_VCLASS(short_name)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
static const AVClass ff_##short_name##_omxcodec_dec_class = {&nbsp; &nbsp;\
&nbsp; &nbsp; .class_name = #short_name "_libomxh264",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; .item_name&nbsp; = av_default_item_name,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\
&nbsp; &nbsp; .option&nbsp; &nbsp; &nbsp;= ff_omxcodec_vdec_options,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\
&nbsp; &nbsp; .version&nbsp; &nbsp; = LIBAVUTIL_VERSION_INT,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
};



#define DECLARE_OMX_VDEC(short_name, full_name, codec_id, bsf)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\
DECLARE_OMX_VCLASS(short_name)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\
const FFCodec ff_ ## short_name ## _omx_decoder = {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; .p.name&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= #short_name "_omxcodec",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\
&nbsp; &nbsp; CODEC_LONG_NAME(full_name " OpenMAX IL decoder"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; .p.type&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= AVMEDIA_TYPE_VIDEO,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; .p.id&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= codec_id,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; .p.priv_class&nbsp; &nbsp;= &amp;ff_##short_name##_omxcodec_dec_class,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\
&nbsp; &nbsp; .priv_data_size = sizeof(OMXCodecDecoderContext),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; .init&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= omx_decode_init,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\
&nbsp; &nbsp; FF_CODEC_DECODE_CB(omx_decode_frame),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; .close&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = omx_decode_end,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; .flush&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = omx_decode_flush,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING ,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; .caps_internal&nbsp; = FF_CODEC_CAP_NOT_INIT_THREADSAFE |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FF_CODEC_CAP_SETS_PKT_DTS,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\
&nbsp; &nbsp; .bsfs&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= bsf,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\&nbsp; &nbsp;&nbsp;
&nbsp; &nbsp; .p.wrapper_name = "omxcodec",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
};&nbsp;&nbsp;



DECLARE_OMX_VDEC(h264,&nbsp; "H.264", AV_CODEC_ID_H264, "h264_mp4toannexb")
DECLARE_OMX_VDEC(hevc,&nbsp; "H.265", AV_CODEC_ID_HEVC, "hevc_mp4toannexb")
DECLARE_OMX_VDEC(mpeg4, "MPEG-4", AV_CODEC_ID_MPEG4, NULL)








&nbsp;




&nbsp;
_______________________________________________
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-07-10  7:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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_B19F12D54144EC802B9D3782F9EF55F89D0A@qq.com \
    --to=76138202@qq.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