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.
1. On the YouTube website, go to the video you want to put on repeat. 2. Right-click the video and select Loop in the pop-up.
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.
No you can't. There is no such command in ffmpeg to loop video. You can use -loop
for image only. If you are interested you can use concat demuxer. Create a playlist file e.g. playlist.txt
Inside playlist.txt add the 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'
Run ffmpeg
ffmpeg -f concat -i playlist.txt -c copy output.mp4
See here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With