【问题标题】:ffmpeg udp to HLS errorffmpeg udp 到 HLS 错误
【发布时间】:2016-06-08 15:57:04
【问题描述】:

我尝试将 UDP 流转码为 HLS (m3u8) 文件,然后使用以下代码将该文件放入 apache 等 Web 服务器中:

ffmpeg -i udp://239.1.2.1:60001 -acodec aac -strict -2 -vcodec libx264 -hls_wrap 100 -f hls /var/www/html/ts/1.m3u8 

在转码进度开始时,我看到一个错误

[h264 @ 0x14c1c60] number of reference frames (0+4) exceeds max (3; probably corrupt input), discarding one

但是 m3u8 文件创建成功,我可以在客户端播放它。但 2 或 3 分钟后我看到了一些错误

[h264 @ 0x158d600] error while decoding MB 30 34, bytestream -10 dup=101 drop=0 [mpegts @ 0x149c660] PES packet size mismatch
[aac_latm @ 0x158daa0] Reserved SBR extensions is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac_latm @ 0x158daa0] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
[aac_latm @ 0x158daa0] Expected to read 18 SBR bytes actually read 21.
[aac_latm @ 0x158daa0] channel element 3.4 is not allocated
Error while decoding stream #0:1: Invalid data found when processing input
Last message repeated 1 times
[udp @ 0x148c0c0] Circular buffer overrun. To avoid, increase fifo_size URL option. To survive in such case, use overrun_nonfatal option
[h264 @ 0x158d600] error while decoding MB 41 20, bytestream -14 dup=102 drop=0    
udp://239.1.2.1:60001: Input/output error

并且流立即停止....有人知道我该如何解决这个问题吗?

【问题讨论】:

    标签: ffmpeg udp streaming video-streaming http-live-streaming


    【解决方案1】:

    尝试增加 URL 本身的缓冲区大小。例如:

    ffmpeg -i udp://239.1.2.1:60001?fifo_size=50000000

    【讨论】:

    • tnx 很多...你知道如何解决这个问题吗? [h264 @ 0x14c1c60] 参考帧数(0+4)超过最大值(3;可能输入损坏),丢弃一个
    • 尝试将帧速率设置为固定值,看看是否可以解决问题。
    • 我看到sombosy使用'udp://239.232.209.112:50000?fifo_size=2000000'代码作为-i选项,你知道为什么使用fifo_size两次吗?
    猜你喜欢
    • 2021-07-30
    • 2018-01-22
    • 2019-03-25
    • 2018-02-05
    • 2015-02-24
    • 2023-03-21
    • 2012-09-09
    • 2016-05-22
    • 2021-09-14
    相关资源
    最近更新 更多