Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to generate Video Test data on the Command Line of FFmpeg

Shulou Source: shulou.com Published: 2022-06-02 01:52:44 09月13日 Update

This article will explain in detail how FFmpeg generates video test data on the command line. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.

Let's talk about how to use the FFmpeg command line to generate video test data.

I. background and purpose

Often we will encounter, want to test the situation that there is no test video file, online download is sometimes too troublesome, do not worry too much, through the FFmpeg command line can be achieved to generate test video files! Next, let's take a look at:

Command line

Generate solid color test video

Ffmpeg-re-f lavfi-I color=c=red@0.2:s=vga:r=25-vcodec libx264-Razzo v 25 out_color.mp4

Generate random snowflake style test video

Ffmpeg-re-f lavfi-I "nullsrc=s=1024x768,geq=random (1) * 1024 lavfi 384"-vcodec libx264-RV 25 out_snow.mp4

III. Parameter interpretation

-re: read by input video frame rate

-f: specify the output format and generate test videos using lavfi

-I: specify the input. In this case, a solid color test video is generated, which is specified by the color filter. The generated random snowflake style is specified by nullsrc.

S/size: indicates the resolution, which can be vga or wxh (1024x768).

C: represents the color, in this case red (red)

Geq: indicates the label generated by random numbers. Random is the random number generation function-vcodec: specifies the video coding library. In this case, libx264-r:v: sets the frame rate of the video. In this case, it is 25.

IV. Actual combat demonstration

5. Effect

Solid color video effect

Snowflake video effect

Well, this is the end of this issue on the exercise of FFmpeg orders, is it very convenient, very simple, and very practical, isn't it? However, if you want to use it skillfully, you still have to practice a lot!

About how FFmpeg command line generation video test data is shared here, I hope the above content can be of some help to you, you can learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Video testing generation commands data content effects solid colors snowflakes files articles more styles knowledge articles random numbers input good practical skilled Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia MariaDB Shulou Technology Redmi Microsoft