标签:making compile cut target prefix .cpp http 链接库 enable
从官网http://ffmpeg.org/下载最新版本.
解压tar -xjvf ffmpeg-3.3.1.tar.bz2
进入目录cd ffmpeg-3.3.1
从http://yasm.tortall.net/Download.html下载yasm
tar -xvzf yasm-1.3.0.tar.gz
cd yasm-1.3.0/
./configure
make
make install
回到ffmpeg目录中
./configure --enable-shared --prefix=/你想让他编译以后在哪里/ffmpeg
make
make install
编译为动态库时的问题:
/usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32S against `av_destruct_packet‘ can not be used when making a shared object; recompile with -fPIC
修改方法:
./configure --enable-pic && make[默认编译安装在/usr/local/下
gcc -o 可执行文件名 待编译文件名.c -L../lib/ -lavcodec -lavdevice -lavfilter -lavformat -lavutil
具体内容:[注意每行之间不能有空格,直接回车]
PROJECT(mpegflow)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
FIND_PACKAGE( OpenCV REQUIRED )
# Declare the target (an executable)
ADD_EXECUTABLE(mpegflow draw_flow.cpp)
TARGET_LINK_LIBRARIES(mpegflow ${OpenCV_LIBS})
然后cmake.,再执行make即可。
gcc -o extract_mvs /ffmpeg-2.8/doc/samples/extract_mvs.c -L../lib/ -lavcodec -lavdevice -lavfilter -lavformat -lavutil
sudo apt-get install libsdl1.2-dev libsdl-image1.2-dev libsdl-ttf2.0-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl-sound1.2-dev
ffplay -debug vis_mb_type test.mp4 ffplay -vismv pf test.mp4
ubuntu下编译ffmpeg+SDL+ffplay提取motion vector
标签:making compile cut target prefix .cpp http 链接库 enable
原文地址:https://www.cnblogs.com/zzq-123456/p/9116064.html