赞
踩
以下配置包含大部分需要使用的功能
./configure --prefix=./ --pkg-config-flags=--static --enable-shared --enable-pthreads --enable-version3 --enable-avresample --host-cflags= --host-ldflags= --enable-ffplay --enable-gpl --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libzimg --enable-debug --disable-optimizations --disable-asm --extra-ldflags=-L/usr/local/lib
配置成功之后依次make && make install即可
configure过程肯定不会一帆风顺,中间会很各种依赖包的缺失,需要自己手动安装。
mac用户:brew install xxx
linux用户:apt-get install xxx-dev
已安装依赖包,configure仍然出错:
–enable-libzimg 需要先安装z.lib库,源码安装参照: https://github.com/sekrit-twc/zimg
在上面编译部分configure部分只要加上 --enable-debug 便会生成ffmpeg_g文件,可使用该文件进行代码调试,调试步骤很简单,只需要配置vscode的launch.json和task.json两个文件即可。两个文件的内容如下:
launch.json内容:
{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "(lldb) 启动", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/ffmpeg_g", "args": [ "-i", "input.MOV", "-crf", "22", "-c:v", "libx265", "-vframes", "300", "-pix_fmt", "yuv420p", "-tag:v", "hvc1", "output.mp4", "-y" ], "stopAtEntry": true, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": false, "MIMode": "lldb" } ] }
task.json
{ "version": "2.0.0", "tasks": [ { "type": "shell", "label": "C/C++: clang build active file", "command": "${workspaceFolder}/make", //"/usr/bin/clang", "args": [ // "-g", // "${file}", // "-o", // "${fileDirname}/${fileBasenameNoExtension}" ], "options": { "cwd": "${workspaceFolder}" }, "problemMatcher": [ "$gcc" ], "group": { "kind": "build", "isDefault": true } } ] }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。