Recording rtmp live streaming in chunks using VLC

I’d like to record a live RTMP stream into several small MP4 files on-the-fly. Instead of saving one large MP4 file, I want to capture the stream in smaller chunks, for example, every minute or every 1000 frames. How can I modify the command to achieve this?

I have a VLC command which can record live rtmp stream to mp4 file:

vlc -vvv rtmp://ip:1935/live --intf dummy --sout="#transcode{vcodec=mp4v}:std{access=file,mux=mp4,dst=output.mp4}"

This command saves the streaming into one big mp4 file.

Read more here: Source link