基于ffplay的video流测试工具开发

直接基于ffmpeg来修改,去掉SDL。数据库选用mongodb,方便用C语言对接db。
既然不需要显示,那还是基于linux来开发比较方便一些。
一、setenv

yum -y install gcc gcc-c++ make git bzip2

二、compile

git clone https://git.videolan.org/git/x264.git

编译x264:

./configure –prefix=/usr/local/x264 –enable-shared –enable-static –disable-asm

gcc -o x264 x264.o input/input.o input/timecode.o input/raw.o input/y4m.o output/raw.o output/matroska.o output/matroska_ebml.o output/flv.o output/flv_bytestream.o filters/filters.o filters/video/video.o

filters/video/source.o filters/video/internal.o filters/video/resize.o filters/video/fix_vfr_pts.o filters/video/select_every.o filters/video/crop.o input/avs.o input/lavf.o filters/video/cache-8.o
filters/video/depth-8.o input/thread-8.o filters/video/cache-10.o filters/video/depth-10.o input/thread-10.o libx264.a
-ldl -lavformat -lavcodec -lswresample -lavutil -lpthread -lswscale -lavutil -m64 -lm -lpthread -lrt -ldl

编译fdk-aac:

wget https://nchc.dl.sourceforge.net/project/opencore-amr/fdk-aac/fdk-aac-2.0.0.tar.gz

./configure –prefix=/usr/local/fdkaac/ –enable-shared

编译sdl2 , http://www.libsdl.org/download-2.0.php

./configure –prefix=/usr/local/sdl2 –enable-shared –enable-static

make;make install

编译ffmpeg:

wget http://ffmpeg.org/releases/ffmpeg-4.1.tar.bz2

./configure –prefix=/usr/local/ffmpeg –enable-gpl –enable-version3 –enable-nonfree –enable-pthreads –enable-postproc –disable-shared –enable-libx264 \

–extra-cflags=-I/usr/local/x264/include –extra-ldflags=-L/usr/local/x264/lib –disable-x86asm

三、install/runtime

[root@localhost ffmpeg]

# cat ff_setpath
export PATH=/usr/local/ffmpeg/bin:$PATH
export PKG_CONFIG_PATH=/usr/local/x264/lib/pkgconfig:/usr/local/fdkaac/lib/pkgconfig/:/usr/local/ffmpeg/lib/pkgconfig/:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=/usr/local/sdl2/lib/pkgconfig:$PKG_CONFIG_PATH

cat ff_build.sh

mkdir ffbuild/bin
./configure –prefix=/home/gitwork/videoplay/ffbuild/bin –enable-gpl –enable-version3 –enable-nonfree –enable-postproc –disable-x86asm –enable-ffplay –enable-shared –disable-static –enable-libx264 –extra-cflags=-I/home/gitwork/videoman/third/x264/include –extra-ldflags=-L/home/gitwork/videoman/third/x264/lib –enable-sdl2 –extra-cflags=-I/home/gitwork/videoman/third/sdl2/include –extra-ldflags=-L/home/gitwork/videoman/third/sdl2/lib –extra-cflags=”-I/home/gitwork/videoman/third/mongodb/include/libbson-1.0 -I/home/gitwork/videoman/third/mongodb/include/libmongoc-1.0″ –extra-ldflags=”-L/home/gitwork/videoman/third/mongodb/lib -lmongoc-1.0 -lbson-1.0″

vi /etc/ld.so.conf.d/ff_lib.conf

/usr/local/x264/lib/
/usr/local/fdkaac/lib/
/usr/local/ffmpeg/lib/
/usr/local/sdl2/lib/
/usr/local/mongodb/lib/
# ldconfig

四、测试验证
# 需要快速测试出视频流通断情况,首开时间/时延/卡顿率都不能测,太耗时了。

发布了229 篇原创文章 · 获赞 30 · 访问量 45万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览