Creating a video similar to Loom using FFmpeg is possible and can be achieved with the following command:
ffmpeg -y -stream_loop -1 -i screenshot.webm -i ../src/assets/ -codec copy -map 0:v:0 -map 1:a:0 output.webm
This command will loop the screenshot.webm video, and insert the assets from the specified directory as an audio track. The output will be saved as output.webm.
Explanation:
ffmpeg: This is the command-line tool for handling multimedia data.-y: This option tells FFmpeg to overwrite output files without asking.-stream_loop -1: This option tells FFmpeg to loop the input stream indefinitely.-i screenshot.webm: This option specifies the input video file.-i ../src/assets/: This option specifies the directory containing the assets to be inserted.-codec copy: This option tells FFmpeg to copy the codec of the input video without re-encoding.-map 0:v:0: This option tells FFmpeg to map the video stream from the first input (the video file).-map 1:a:0: This option tells FFmpeg to map the audio stream from the second input (the assets directory).output.webm: This is the output file name.
Note:
- Replace
screenshot.webmwith the path to your actual screen recording video file. - The audio tracks in the assets directory should be in the same format as the audio track in the video file for proper synchronization.
References:
- FFmpeg Documentation: Stream copy
- FFmpeg Documentation: map
- FFmpeg Documentation: stream_loop
- FFmpeg Wiki: List of all supported codecs
- FFmpeg Wiki: List of all supported codecs
This command will create a single video file. If you need to split the video into multiple parts, you may need to use additional FFmpeg commands or tools. However, the purpose of this command is to generate a single video file.