当前位置:网站首页>The FFmpeg library is configured and used on win10 (libx264 is not configured)

The FFmpeg library is configured and used on win10 (libx264 is not configured)

2022-08-09 13:03:00 A 12 knowledge


Background

Audio and video development is inseparable from encoding and decoding. Through encoding and decoding, delay-free video transmission and playback can be realized.
The most widely used protocols in audio and video codec are MPEG-4 and h264, and h264 is actually a part of MPEG-4.
Codecs are generally divided into soft solutions and hard solutions. Soft solutions are algorithm implementations that can be used across platforms, such as libx264 and FFmpeg. Hard solutions refer to the hardware codecs that the hardware platform itself has.

1. What is FFmpeg?

FFmpeg is an open source multimedia video processing tool. FFmpeg has very powerful functions including video capture function, video format conversion, video capture, adding watermark to video, etc., and supports multiple platforms.

Second, Windows configuration steps

1. Download FFmpeg

Usually go to the official website (http://www.ffmpeg.org/) to download the source code or exe file, but to develop on it, you need .dll, .lib, and .h files.
This is the FFmpeg library (-dev and -shred) required for win10 development, I am looking for it~
Link: https://pan.baidu.com/s/1bA5aag8tlSluXmBYLLEf-g
Extraction code: c8f0

2.Configuration vs

1. Right-click on the project name -> Properties -> Configuration Properties -> c/c++ -> Additional include directories: Add dev\include directories
2. Right-click the project name->Properties->Configuration Properties->Linker->General->Additional library directory:Add dev\lib directory
3. Right click on the project name -> Properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies: Add swscale.lib;avcodec.lib;avutil.lib;avformat.lib;
4. Copy all dlls under shared\bin to the project directory (the next level of .sln)

3. Test

#include extern "C" {#include "libavcodec/avcodec.h"#include "libavformat/avformat.h"}int main(int argc, char* argv[]) {printf("%s\n", avcodec_configuration());return 0;}

If an error is reported: d:\ffmpeg-4.3.1-win64-dev\include\libavutil\rational.h : warning C4819: The file contains cannot be included in the current code page (936)character represented in .Please save the file in Unicode format to prevent data loss, refer to the blog https://blog.csdn.net/qq_36226393/article/details/77725493

原网站

版权声明
本文为[A 12 knowledge]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/221/202208091158060826.html