from: https://blog.csdn.net/weiyuefei/article/details/64125208html
You should be able to use the -stream_loop -1
flag before the input (-i
):ide
ffmpeg -threads 2 -re -fflags +genpts -stream_loop -1 -i ./test.mp4 -c copy ./test.m3u8
The -fflags +genpts
will regenerate the pts timestamps so it loops smoothly, otherwise the time sequence will be incorrect as it loops.oop
FFmpeg >= 2.8.4 is required in this case.post
參考ui
https://www.v2ex.com/t/264280this
http://video.stackexchange.com/questions/12905/repeat-loop-input-video-with-ffmpeg.net
http://stackoverflow.com/questions/30846719/infinite-stream-from-a-video-file-in-a-loopcode