0
./configure
depbase=`echo frontends/yasm/yasm.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -g -O2 -MT frontends/yasm/yasm.o -MD -MP -MF $depbase.Tpo -c -o frontends/yasm/yasm.o frontends/yasm/yasm.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo frontends/yasm/yasm-options.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -g -O2 -MT frontends/yasm/yasm-options.o -MD -MP -MF $depbase.Tpo -c -o frontends/yasm/yasm-options.o frontends/yasm/yasm-options.c &&\
mv -f $depbase.Tpo $depbase.Po
gcc -std=gnu99 -g -O2 -o yasm frontends/yasm/yasm.o frontends/yasm/yasm-options.o libyasm.a
depbase=`echo frontends/tasm/tasm.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -g -O2 -MT frontends/tasm/tasm.o -MD -MP -MF $depbase.Tpo -c -o frontends/tasm/tasm.o frontends/tasm/tasm.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo frontends/tasm/tasm-options.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -g -O2 -MT frontends/tasm/tasm-options.o -MD -MP -MF $depbase.Tpo -c -o frontends/tasm/tasm-options.o frontends/tasm/tasm-options.c &&\
mv -f $depbase.Tpo $depbase.Po
gcc -std=gnu99 -g -O2 -o ytasm frontends/tasm/tasm.o frontends/tasm/tasm-options.o libyasm.a
depbase=`echo frontends/vsyasm/vsyasm.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -g -O2 -MT frontends/vsyasm/vsyasm.o -MD -MP -MF $depbase.Tpo -c -o frontends/vsyasm/vsyasm.o frontends/vsyasm/vsyasm.c &&\
mv -f $depbase.Tpo $depbase.Po
gcc -std=gnu99 -g -O2 -o vsyasm frontends/vsyasm/vsyasm.o frontends/yasm/yasm-options.o libyasm.a
make[2]:正在离开目录 `/kk/jiangzhaowei/share/ffmpeg/yasm-1.3.0'
make[1]:正在离开目录 `/kk/jiangzhaowei/share/ffmpeg/yasm-1.3.0'
sudo make install
完成后如图:
Making install in .
make[2]: 正在进入目录 `/kk/jiangzhaowei/share/ffmpeg/yasm-1.3.0'
make[3]: 正在进入目录 `/kk/jiangzhaowei/share/ffmpeg/yasm-1.3.0'
/bin/mkdir -p '/usr/local/bin'
/usr/bin/install -c yasm ytasm vsyasm '/usr/local/bin'
/bin/mkdir -p '/usr/local/lib'
/usr/bin/install -c -m 644 libyasm.a '/usr/local/lib'
( cd '/usr/local/lib' && ranlib libyasm.a )
make install-exec-hook
make[4]: 正在进入目录 `/kk/jiangzhaowei/share/ffmpeg/yasm-1.3.0'
make[4]: 没有什么可以做的为 `install-exec-hook'。
make[4]:正在离开目录 `/kk/jiangzhaowei/share/ffmpeg/yasm-1.3.0'
/bin/mkdir -p '/usr/local/include'
/usr/bin/install -c -m 644 libyasm.h '/usr/local/include'
/bin/mkdir -p '/usr/local/share/man/man1'
/bin/mkdir -p '/usr/local/share/man/man1'
/usr/bin/install -c -m 644 yasm.1 '/usr/local/share/man/man1'
/bin/mkdir -p '/usr/local/share/man/man7'
/usr/bin/install -c -m 644 yasm_arch.7 yasm_parsers.7 yasm_dbgfmts.7 yasm_objfmts.7 '/usr/local/share/man/man7'
/bin/mkdir -p '/usr/local/share/man/man7'
/bin/mkdir -p '/usr/local/include/libyasm'
/usr/bin/install -c -m 644 libyasm/arch.h libyasm/assocdat.h libyasm/bitvect.h libyasm/bytecode.h libyasm/compat-queue.h libyasm/coretype.h libyasm/dbgfmt.h libyasm/errwarn.h libyasm/expr.h libyasm/file.h libyasm/floatnum.h libyasm/hamt.h libyasm/insn.h libyasm/intnum.h libyasm/inttree.h libyasm/linemap.h libyasm/listfmt.h libyasm/md5.h libyasm/module.h libyasm/objfmt.h libyasm/parser.h libyasm/phash.h libyasm/preproc.h libyasm/section.h libyasm/symrec.h libyasm/valparam.h libyasm/value.h '/usr/local/include/libyasm'
/bin/mkdir -p '/usr/local/include'
/usr/bin/install -c -m 644 libyasm-stdint.h '/usr/local/include'
make[3]:正在离开目录 `/kk/jiangzhaowei/share/ffmpeg/yasm-1.3.0'
make[2]:正在离开目录 `/kk/jiangzhaowei/share/ffmpeg/yasm-1.3.0'
make[1]:正在离开目录 `/kk/jiangzhaowei/share/ffmpeg/yasm-1.3.0'
5.开始下载FFmpeg,这里下载3.1.3 release ffmpeg的版本
jiangzhaowei@ubuntu$ wget http://ffmpeg.org/releases/ffmpeg-3.1.3.tar.gz
--2018-01-11 19:07:58-- http://ffmpeg.org/releases/ffmpeg-3.1.3.tar.gz
正在解析主机 ffmpeg.org (ffmpeg.org)... 79.124.17.100
正在连接 ffmpeg.org (ffmpeg.org)|79.124.17.100|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度: 11645295 (11M) [application/x-gzip]
正在保存至: “ffmpeg-3.1.3.tar.gz”
100%[=============================================================================================================>] 11,645,295 93.1KB/s 用时 94s
2018-01-11 19:09:33 (120 KB/s) - 已保存 “ffmpeg-3.1.3.tar.gz” [11645295/11645295])
6.下载完成后,用开始解压
tar -zxvf ffmpeg-3.1.3.tar.gz
或者其它压缩格式:
tar jxvf ffmpeg-3.4.1.tar.bz2
7.进入目录,开始编译
cd ffmpeg-3.1.3
./configure
make -j
X86ASM libavcodec/x86/simple_idct.o
STRIP libavcodec/x86/vp8dsp_loopfilter.o
STRIP libavcodec/x86/hevc_deblock.o
STRIP libavcodec/x86/vp9itxfm.o
AR libavcodec/libavcodec.a
LD ffmpeg_g
LD ffprobe_g
LD ffserver_g
STRIP ffserver
STRIP ffmpeg
STRIP ffprobe
sudo make install
FFmpeg HTTP媒体播放服务器:
1.“ffserver.conf”配置服务器端口、最大连接数以及媒体本地路径。
2. 启动FFmpeg服务器:
kk@ubuntu:~/share/bak/ffmpeg$ ffserver -f ffserver.conf
built with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
configuration:
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
ffserver.conf:164: Setting default value for video bit rate tolerance = 21333. Use NoDefaults to disable it.
ffserver.conf:164: Setting default value for video rate control equation = tex^qComp. Use NoDefaults to disable it.
ffserver.conf:164: Setting default value for video max rate = 128000. Use NoDefaults to disable it.
ffserver.conf:219: Setting default value for audio sample rate = 22050. Use NoDefaults to disable it.
ffserver.conf:219: Setting default value for audio channel count = 1. Use NoDefaults to disable it.
ffserver.conf:219: Setting default value for video bit rate tolerance = 64000. Use NoDefaults to disable it.
ffserver.conf:219: Setting default value for video rate control equation = tex^qComp. Use NoDefaults to disable it.
ffserver.conf:219: Setting default value for video max rate = 512000. Use NoDefaults to disable it.
Thu Jan 11 01:12:14 2018 Opening feed file '/home/kk/share/bak/ffmpeg/test.flv' for stream 'test.flv' //表示已经接收到播放请求
Thu Jan 11 01:12:14 2018 [ffm @ 0x9a85c20]Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Thu Jan 11 01:12:14 2018 [ffm @ 0x9a85c20]Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Thu Jan 11 01:12:14 2018 [ffm @ 0x9a85c20]Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Thu Jan 11 01:12:14 2018 [ffm @ 0x9a85c20]Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Thu Jan 11 01:12:14 2018 FFserver started.
Thu Jan 11 01:12:58 2018 [flv @ 0x9a97d20]Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Thu Jan 11 01:12:58 2018 [flv @ 0x9a97d20]Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Thu Jan 11 01:15:16 2018 192.168.199.141 - - [GET] "/test.flv HTTP/1.1" 200 23121984
Thu Jan 11 01:24:32 2018 192.168.199.141 - - [GET] "/test.flv HTTP/1.1" 200 3148385
Thu Jan 11 01:26:36 2018 192.168.199.164 - - [GET] "/test.flv HTTP/1.1" 200 11771070
Thu Jan 11 01:31:24 2018 192.168.199.164 - - [GET] "/test.flv HTTP/1.1" 200 3707111
Thu Jan 11 01:46:58 2018 192.168.199.164 - - [GET] "/test.flv HTTP/1.1" 200 146509
Thu Jan 11 02:13:11 2018 192.168.199.164 - - [GET] "/test.flv HTTP/1.1" 200 23121984
Thu Jan 11 02:14:26 2018 192.168.199.164 - - [GET] "/test.flv HTTP/1.1" 200 176099
Thu Jan 11 02:27:17 2018 192.168.199.164 - - [GET] "/test.flv HTTP/1.1" 200 2324539
Thu Jan 11 02:28:39 2018 192.168.199.164 - - [GET] "/test.flv HTTP/1.1" 200 23121984
Thu Jan 11 02:29:04 2018 192.168.199.164 - - [GET] "/test.flv HTTP/1.1" 200 23121984
Thu Jan 11 02:29:15 2018 192.168.199.164 - - [GET] "/test.flv HTTP/1.1" 200 8393075
Thu Jan 11 02:36:37 2018 192.168.199.164 - - [GET] "/test.flv HTTP/1.1" 200 23121984
Thu Jan 11 02:36:55 2018 192.168.199.164 - - [GET] "/test.flv HTTP/1.1" 200 170610
3.另外一台客户端PC,使用VLC可以测试FFmpeg服务器
VLC菜单栏->媒体->打开网络串流,就可以正常播放HTTP服务器流媒体了。
或者外网测试:
编译完成后,自然希望能我们有所作用,否则也不会没事编译ffmpeg。
1.把视频的前120帧转换成一个gif图,大小指定为230*450:
ffmpeg -i device-2016-08-25-193402.mp4 -vframes 120 -s 230x405 -y -f gif Super3.gif
2.调用ffmpeg命令将一个视频转成3gp格式:
ffmpeg -i device-2016-08-25-193402.mp4 -y -b 20 -s sqcif -r 10 -acodec amr_wb -ab 23.85 -ac 1 -ar 16000 video.3gp