Generate a solid color H.264 video with the color video source filter (color Hex code)

3
94
ffmpeg -f lavfi -i "color=c=0x4d1a7f" -s 1280x720 -r 30 -c:v libx264 -crf 31 -t 5 solid.mp4

1 comment
Anonymous
Markdown is supported
@hunterhogan
hunterhogancommentedabout 2 years ago

I suggest moving the time limit option, -t, from the output to the input. Therefore:

ffmpeg -t 5 -f lavfi -i "color=c=0x4d1a7f" -s 1280x720 -r 30 -c:v libx264 -crf 31 solid.mp4

I have two reasons for the suggestion. First, this example is about generating the input, and putting the time limit with the generation makes the generation a complete unit. Second, when limiting streams by time, FFmpeg performs better when the limit are placed on the inputs rather than the outputs.