Endless stream from a video file (in a loop)
2 answers
No, you cannot. There is no such command in ffmpeg for recording video. You can -loop
only use for images. If you are interested, you can use the concat demuxer. Create a playlist file eg. playlist.txt
Inside playlist.txt add video location
file '/path/to/video/video.mp4'
file '/path/to/video/video.mp4'
file '/path/to/video/video.mp4'
file '/path/to/video/video.mp4'
file '/path/to/video/video.mp4'
Execute ffmpeg
ffmpeg -f concat -i playlist.txt -c copy output.mp4
See here
+3
source to share
You should be able to use a flag -stream_loop -1
before entering ( -i
):
ffmpeg -threads 2 -re -fflags +genpts -stream_loop -1 -i ./test.mp4 -c copy ./test.m3u8
-fflags +genpts
will reconstruct the pts timestamps so that it smoothes smoothly, otherwise the time sequence will be wrong as it will loop.
+8
source to share