Setting a timeout for av_read_frame

末鹿安然 提交于 2021-01-29 03:09:14

问题


I am new to FFMPEG and was trying to do HLS streaming using FFMPEG. When i tried using the function "av_read_frame" it returns a negative value whenever data is not available. Is there some method to make this function wait till some data is received or to make this function wait till a timeout is reached?


回答1:


No, there really isn't. If you look at the simple player ffplay.c which comes with FFmpeg, the read_thread function basically loops on av_read_frame until it returns a non-negative return code. If it returns a negative value, it simply waits for 10ms and retries.



来源:https://stackoverflow.com/questions/27577642/setting-a-timeout-for-av-read-frame

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!