天天看點

關于ffmpeg解碼通過UDP協定傳輸的視訊流遇到fifosize 的問題

吐槽一下百度的英文搜尋,簡直是狗屎!還我大谷哥!

最近用ffmpeg解碼udp傳輸的視訊流,經常會碰到提示緩存不足的錯誤。由于不太清楚具體代碼在什麼位置,沒去翻代碼。

關于ffmpeg解碼通過UDP協定傳輸的視訊流遇到fifosize 的問題

bing搜尋後,在stackoverflow找到了相關解釋,原文位址:http://stackoverflow.com/questions/16944024/udp-streaming-with-ffmpeg-overrun-nonfatal-option

源代碼位址:http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/udp.c;h=5b5c7cb7dfc1aed3f71ea0c3e980be54757d3c62;hb=dd0a9b78db0eeea72183bd3f5bc5fe51a5d3f537

具體内容:

The same option works from command line or C++ libraries, you need to modify your UDP URL as follows: If you original URL looks like this:

Add the fifo_size and overrun parameters like this:

Remember to escape the URL with quotes.

overrun_nonfatal=1 prevents ffmpeg from exiting, it can recover in most circumstances.

fifo_size=50000000 uses a 50MB udp input buffer (default 5MB)

即,ffmpeg在接收網絡協定流時可以在連結上通過fifo_size進行緩沖大小的設定