![]() As you can see in Listing 1, lavfi streams can be used the same way you use regular streams, as described in last month's issue. ![]() Making a 10-second video of a flat color is probably the simplest thing you can do with lavfi, but making a video of a test pattern is also easy: ffmpeg -f lavfi -i testsrc=s=640x480 -t 10 testscr.webmĬombining lavfi-generated streams with other streams is what makes it really powerful. The -t 10 parameter makes the resulting clip 10 seconds long. c sets the color of the frame you can browse a complete list of colors that FFmpeg understands and use one of those (e.g., red here), or you can use the #RRGGBB notation.After the first equals sign comes the color parameters: Broken up, color tells FFmpeg what sort of stream it should expect – in this case, a simple color video stream. ![]() The content the virtual device generates is described by what goes after the -i parameter, that is, color=c=red:size=640x480:rate=30. Most basic ffmpeg instructions you have seen probably have at least one input file, but the instruction above has none because "input" is coming from the lavfi virtual device, not from a file. Maybe it is better explained with an example: ffmpeg -f lavfi -i color=c=red:size=640x480:rate=30 -t 10 red.webm You can use these streams on the fly and combine them with clips and other dynamically generated streams (e.g., from a webcam or microphone) to create your output file. Instead of using prerecorded video or audio files as streams, lavfi lets you create streams out of thin air. Using lavfiįFmpeg's lavfi (short for libavfilter) virtual device sounds more complicated than it really is. I'll take a look at one of FFmpeg's most powerful secret weapons: the lavfi virtual device. ![]() The casual user might only use the FFmpeg multimedia framework for converting from one audio or video format to another, but FFmpeg can do much more than that. ![]()
0 Comments
Leave a Reply. |