[FFmpeg-devel] question for ff_extract_extradata_bsf
Yufei He
yhe at matrox.com
Wed Mar 6 21:08:29 EET 2019
Hi
I want to use ff_extract_extradata_bsf to get extradata from a h.264 frame.
Here is the code.
AVPacket *avpkt; // There is valid data.
AVBSFContext *ctx = NULL;
ret = av_bsf_alloc(&ff_extract_extradata_bsf, &ctx);
ret = ff_extract_extradata_bsf.init(ctx);
ret = ff_extract_extradata_bsf.filter(ctx, avpkt);
ff_extract_extradata_bsf.filter failed on calling ff_bsf_get_packet_ref because ctx->internal->buffer_pkt->data is NULL.
int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt)
{
AVBSFInternal *in = ctx->internal;
if (in->eof)
return AVERROR_EOF;
if (!ctx->internal->buffer_pkt->data &&
!ctx->internal->buffer_pkt->side_data_elems)
return AVERROR(EAGAIN);
...
}
How should ctx->internal->buffer+pkt->data be set?
Thanks.
Yufei.
More information about the ffmpeg-devel
mailing list