FFmpeg在Window上出现'circular_buffer_size'问题解决方法

问题描述

在使用FFmpeg进行RTSP流读取时出现以下报错

 [udp @ 000001e04eafbdc0] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
 [udp @ 000001e04eb10d40] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
 [udp @ 000001e04eb21b80] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
 [udp @ 000001e04eb31e80] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
 [rtsp @ 000001e04eaf8ec0] UDP timeout, retrying with TCP 

问题分析

‘circular_buffer_size’ option was set but it is not supported on this build (pthread support is required)

出现该问题的主要原因就是:使用的FFmpeg没有编译所需的pthread模块。

解决方法

方法一:设置默认使用TCP进行Rtsp流读取(推荐)

添加-rtsp_transport选项,-rtsp_transport tcp
完整例子,使用ffmpeg将Rtsp流实时的转成Rtmp流,然后推送到Rtmp服务器,如下:

ffmpeg -rtsp_transport tcp -i rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov -vcodec copy -acodec copy -f flv -y rtmp://localhost:1935/rtmp/bigbuckbunny_175k
方法二:添加pthread模块的支持(比较复杂,可以尝试)

首先修改 build_ffmpeg.sh 中 ./config 的编译配置,修改或添加下面几项:

./configure \
    # 启用 mediacodec 必须要启用它
    --enable-jni \
    --enable-mediacodec \
    --disable-decoders \
    --enable-decoder=aac \
    --enable-decoder=aac_latm \
    --enable-decoder=mjpeg \
    --enable-decoder=png \
    # 替换原先解码器为硬解码
    --enable-decoder=h264_mediacodec \
    --enable-decoder=mpeg4_mediacodec \

项目推荐



DC3是基于Spring Cloud的开源可分布式物联网(IOT)平台,用于快速开发、部署物联设备接入项目,是一整套物联系统解决方案。

  • 6
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 7
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值