Is there any way howto create an infinite h264
stream from a video file (eg. mp4, avi, ...). I'd like to use ffmpeg to transcode avi file to h264
but there's no loop
option for output.
You should be able to use the -stream_loop -1
flag before the input (-i
):
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.