使用ffmpeg将实时流保存为AVI

本文详细介绍了如何利用ffmpeg工具将接收到的实时视频流转化为AVI格式的文件,包括必要的命令行参数设置和操作步骤,适用于视频流处理和录制场景。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

毛毛虫的爹

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值