1
cd /usr/local/nginx/html/broadcast3
2,
ffmpeg -i 20150428101917_31520150408监利新闻(三).flv -c:v libx264 -c:a aac -strict -2 -f hls test22.m3u8
执行结果:

ffmpeg version n-72743-g130a6c0 copyright (c) 2000-2015 the ffmpeg developers
built with gcc 4.8.3 (gcc) 20140911 (red hat 4.8.3-9)
configuration: --enable-version3 --enable-libvpx --enable-libfaac --enable-libmp3lame --enable-libvorbis --enable-libx264 --enable-libxvid --enable-shared --enable-gpl --enable-postproc --enable-nonfree --enable-avfilter --enable-pthreads --enable-libnut --enable-libtheora
libavutil 54. 27.100 / 54. 27.100
libavcodec 56. 41.100 / 56. 41.100
libavformat 56. 36.100 / 56. 36.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.100 / 1. 2.100
libpostproc 53. 3.100 / 53. 3.100
input #0, flv, from '20150428101917_31520150408监利新闻(三).flv':
metadata:
encoder : lavf53.6.0
duration: 00:23:02.61, start: 0.000000, bitrate: 453 kb/s
stream #0:0: video: flv1, yuv420p, 320x240, 800 kb/s, 18 fps, 18 tbr, 1k tbn, 1k tbc
stream #0:1: audio: mp3, 22050 hz, stereo, s16p, 58 kb/s
[libx264 @ 0xfa8680] using cpu capabilities: mmx2 sse2fast ssse3 sse4.2
[libx264 @ 0xfa8680] profile high, level 1.2
output #0, hls, to 'test22.m3u8':
encoder : lavf56.36.100
stream #0:0: video: h264 (libx264), yuv420p, 320x240, q=-1--1, 18 fps, 90k tbn, 18 tbc
metadata:
encoder : lavc56.41.100 libx264
stream #0:1: audio: aac, 22050 hz, stereo, fltp, 128 kb/s
encoder : lavc56.41.100 aac
stream mapping:
stream #0:0 -> #0:0 (flv1 (flv) -> h264 (libx264))
stream #0:1 -> #0:1 (mp3 (native) -> aac (native))
press [q] to stop, [?] for help
frame=24886 fps=131 q=27.0 lsize=n/a time=00:23:02.60 bitrate=n/a
video:40726kb audio:21245kb subtitle:0kb other streams:0kb global headers:0kb muxing overhead: unknown
[libx264 @ 0xfa8680] frame i:180 avg qp:18.64 size: 13909
[libx264 @ 0xfa8680] frame p:18092 avg qp:23.20 size: 2073
[libx264 @ 0xfa8680] frame b:6614 avg qp:26.06 size: 257
[libx264 @ 0xfa8680] consecutive b-frames: 60.2% 10.6% 7.8% 21.4%
[libx264 @ 0xfa8680] mb i i16..4: 13.8% 66.2% 20.0%
[libx264 @ 0xfa8680] mb p i16..4: 0.6% 1.9% 0.3% p16..4: 25.3% 14.2% 12.6% 0.0% 0.0% skip:45.1%
[libx264 @ 0xfa8680] mb b i16..4: 0.1% 0.3% 0.0% b16..8: 21.6% 2.9% 0.9% direct: 1.0% skip:73.3% l0:41.6% l1:45.6% bi:12.8%
[libx264 @ 0xfa8680] 8x8 transform intra:67.8% inter:67.4%
[libx264 @ 0xfa8680] coded y,uvdc,uvac intra: 69.6% 73.8% 34.0% inter: 20.4% 13.7% 2.9%
[libx264 @ 0xfa8680] i16 v,h,dc,p: 13% 69% 12% 6%
[libx264 @ 0xfa8680] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 28% 28% 4% 4% 4% 6% 4% 7%
[libx264 @ 0xfa8680] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 31% 13% 5% 6% 6% 7% 5% 7%
[libx264 @ 0xfa8680] i8c dc,h,v,p: 43% 34% 18% 5%
[libx264 @ 0xfa8680] weighted p-frames: y:0.9% uv:0.5%
[libx264 @ 0xfa8680] ref p l0: 73.5% 15.3% 7.8% 3.4% 0.0%
[libx264 @ 0xfa8680] ref b l0: 86.6% 11.0% 2.4%
[libx264 @ 0xfa8680] ref b l1: 94.9% 5.1%
[libx264 @ 0xfa8680] kb/s:241.31
但是m3u8 文件中的切片不全
vim test22.m3u8

#extm3u
#ext-x-version:3
#ext-x-targetduration:11
#ext-x-media-sequence:168
#extinf:3.111111,
test22168.ts
#extinf:3.666667,
test22169.ts
#extinf:10.111111,
test22170.ts
#extinf:10.000000,
test22171.ts
#extinf:4.888889,
test22172.ts
#ext-x-endlist

参考:
http://www.cnblogs.com/littlehb/p/3914437.html
http://hdu104.com/294
http://blog.csdn.net/liuhongxiangm/article/details/18666993
http://blog.csdn.net/cdnight/article/details/39156711