问题
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