In recent versions, this
ffmpeg -stream_loop 4 -i input.mp4 -c copy output.mp4
Due to an error, the above does not work with MP4. But if you wrap MKV, this works for me.
ffmpeg -i input.mp4 -c copy output.mkv
then
ffmpeg -stream_loop 4 -i output.mkv -c copy output.mp4
source
share