ffmpeg C++ and AVFormatContext

2019-08-19 05:50发布

I have a question about ffmpeg.

How I can init an AVFormatContext in my program. I know that it's possible to make av_open_input_file and use my AVFormatContext as one of the parametres, but my data which I want use for decoding not in file. I get it from other components of my program as char* array. Is it possible to init AVFormatContext struct only using this array of data.

标签: c++ ffmpeg
1条回答
啃猪蹄的小仙女
2楼-- · 2019-08-19 06:29

have a look at these functions, they might be useful.

AVInputFormat *av_find_input_format(const char *short_name);

AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);

AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max);

AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, int *score_ret);

int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
                           const char *filename, void *logctx,
                           unsigned int offset, unsigned int max_probe_size);

I did this with output data but not input data (My input data was raw frames grabbed from a video device). what's you input data?

查看更多
登录 后发表回答