吐槽一下百度的英文搜索,簡直是狗屎!還我大谷哥!
最近用ffmpeg解碼udp傳輸的視頻流,經常會碰到提示緩存不足的錯誤。由於不太清楚具體代碼在什麼位置,沒去翻代碼。
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:
udp://@239.1.1.7:5107
Add the fifo_size and overrun parameters like this:
"udp://@239.1.1.7:5107?overrun_nonfatal=1&fifo_size=50000000"
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進行緩衝大小的設置