NIUBOYI»Home › › Explore AI, Master AI › 中文 | English
微信扫一扫 分享朋友圈

已有 2017 人浏览分享

了解AI 玩转AI    Data scraping tool: FFmpeg video processing, video-to-image conversion, batch image extraction, used for building a knowledge base for analysis

2024-4-2 16:30:262017 0
The significance of batch image extraction is that we can obtain the composition elements and subtitles from the images, which provides strong reference value for creating comics, videos, stories, and other content. Using this information, we can feed it to GPT and make it our knowledge base, then use the knowledge base content to generate the content we want.

[baike]Download and Install FFmpeg[/baike]Installation steps: this process is very simple. Downloading takes about 1 minute, installation takes about 2 minutes, and reading the tutorial takes about 2 minutes. The whole installation takes about 5 minutes.
Open the official website address: https://ffmpeg.org/download.html#build-windows
Taking Windows as an example, click here to go to the download address.

微信截图_20240402163933.png

Select: ffmpeg-master-latest-win64-gpl-shared.zip and download it to your computer.

微信截图_20240402164051.png

After downloading, extract it, open the folder, find the bin folder inside, click into it, and then copy the current path. We need to add the exe files in this directory to the environment variables.

微信截图_20240402164513.png
[baike]Configure Environment Variables[/baike]Open the search function at the bottom of the computer, type system environment, and open Edit the system environment variables.

微信截图_20240402164559.png

微信截图_20240402164742.png

Double-click Path.

微信截图_20240402164816.png

Click New, paste the path you just copied, then confirm and save. At this point, FFmpeg is considered installed.

微信截图_20240402164856.png

Next, open CMD to test whether the installation was successful. Click Start > Run > type cmd on the computer, or use the Windows+R shortcut, then type ffmpeg to see whether it works normally. If the version is displayed correctly, it is working normally.

微信截图_20240402165155.png


[baike]Start Extracting Images from Video[/baike]Next, we provide a command to teach you how to convert a video into images. First open the folder where a video is located, then click the path above, replace it with cmd, press Enter, and a CMD window will pop up.

微信截图_20240402165500.png

Command: ffmpeg -i 原视频名.mp4 -vf fps=1/10 文件夹名称/output%d.png

微信截图_20240402170113.png


  • -vf fps=1/10: Here, -vf refers to the video filter option; fps=1/10 means the frame rate is 1 frame every 10 seconds, that is, extract one frame every 10 seconds.
  • output%d.png: The naming method for output files. output%d.png means the output image file names will have output as the prefix, followed by an incrementing number (for example, output1.png, output2.png), and be saved in .png format.


You need to modify the video name according to your content, enter the folder name (note that it must be created in advance), then adjust how many seconds per image to extract. By default, the folder can be placed in the same directory as the video.

微信截图_20240402170320.png

微信截图_20240402170333.png

The role of FFmpeg is not limited to this; it can also perform many video processing functions, such as clipping and merging. Friends who want to use it can ask ChatGPT. Here we only introduce content related to familiar analysis.

[baike]Create a Custom GPT Knowledge Base[/baike]We take ChatGPT as an example and use its knowledge base function to build our own content output machine. For a better demonstration effect, I will now find a movie video theme again.


  • WeChat Official Account

  • Scan to Visit Mobile Site

QQ|NIUBOYI ( 京ICP备17025393号 )|网站地图

GMT+8, 2026-10-30 19:46 , Processed in 0.497564 second(s), 40 queries .

POWERED BY NIUBOYIAI! 主理人:NIUBOYIAI  点亮哥

Copyright © 2001-2020, NIUBOYI AI.