AVFormatContext *ofmt_ctx = NULL;
AVStream *out_stream = NULL;
int CloseAvi()
{
exit:
/* close output */
if (ofmt_ctx && !(ofmt_ctx->oformat->flags & AVFMT_NOFILE))
avio_close(ofmt_ctx->pb);
avformat_free_context(ofmt_ctx);
return 0;
}
int CreateAvi(char *filename)
{
int ret;
char buf3[] = "";
// AVPacket pkt_avi= { 0 };
//char filename[128];
// av_register_all();
// av_log_set_level(AV_LOG_DEBUG);
/* allocate the output media context */
avformat_alloc_output_context2(&ofmt_ctx, NULL, NULL, filename);
if (!ofmt_ctx) {
// printf("Could not deduce output format from file extension: using AVI.\n");
avformat_alloc_output_context2(&am
使用ffmpeg将实时流保存为AVI
最新推荐文章于 2023-09-22 11:23:15 发布