Windows FFmpeg + labelimg extract video frames get a picture set and label pictures to construct datasets

Source: Internet
Author: User

Process for constructing datasets

Video files >> ffmpeg processing >> picture sets >> labelimg for labeling >> labeled datasets

Prepare FFmpeg

Download by official , choose according to your machine type

Unzip the downloaded compressed package (i renamed the file for convenience)

>>>>>>>>>>>>>

Add the Bin directory under FFmpeg to the path of the system (the specific procedure for configuring environment variables is not repeated here ^ ^)

In Windows DOS, enter the following command to verify that the environment variable is already configured.

Ffmpeg-v

The results obtained are as follows, indicating that ffmpeg can be used.

Using FFmpeg for video framing, first go to the folder where the video is stored

Then go to PowerShell, enter the command to take the video frame, the format of the command is roughly: Ffmpeg-i video-R frames per second-Q:V picture quality parameter-F picture naming format (more usage asked Niang ^ ^)

Ffmpeg-i "Video.mp4"-R 1-q:v 2-f image2 vid_%d.jpeg

Get the extracted frame picture after carriage return

Install PYQT4 and lxml under the conditions of installing python2.7 and configuring environment variables and installing PIP and configuring environment variables

Install lxml, enter a command in DOS, and then download and install it automatically

Pip Install lxml

When the installation is complete, enter Python and enter

Import lxml

The resulting result, Python did not report an exception stating that the installation was successful

Install PYQT4, click the download L link to download, according to your own needs to download

After the download is complete, double-click to install, all the way next until the installation is complete

Download Open source labelimg on GitHub, here's the address

Download good after decompression, get a folder named: Labelimg-master, according to their own needs, in the data file to open the Predefined_classes.txt File Settings tab (I am set here as a bald, bear big, bear two)

Enter PowerShell in the Labelimg-master file

Execute Code First

Pyrcc4-o resources.py RESOURCES.QRC

Then execute the Code

Python labelimg.py

Now you can roll up the sleeves to mark the picture, there is open folder or open a picture (here I will never say that must be named in English )

Take a look (video quality is poor, the picture is not particularly clear, example ^ ^)

---restore content ends---

Windows FFmpeg + labelimg extract video frames get a picture set and label a picture to construct a dataset

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.