Professional Documents
Culture Documents
Contents
I.Gii Thiu V FFMPEG.........................................................................................
II.Cc Bc Bin Dch FFMPEG:............................................................................
III.S Dng FFMPEG Chuyn nh Dng Video:....................................................
1. C php ca mt cu lnh ffmpeg:.....................................................................
2. Cc Option ca Video:.......................................................................................
2.1. Bitrate ( -b bitrate ).....................................................................................
2.2 Fame ( -vframes number )...........................................................................
2.3 Frame rate ( -r fps )......................................................................................
2.4 Frame size ( -s size )....................................................................................
2.5 T l cnh ( -aspect aspect ).........................................................................
2.6 Ct hnh pha trn (-croptop size )..............................................................
2.7 Ct hnh pha di ( -cropbottom size )......................................................
2.8 Ct hnh bn tri ( -cropleft size )...............................................................
2.9 Ct hnh bn phi ( -cropright size )............................................................
2.10 Thm hnh pha trn ( -padtop size ).........................................................
2.11 Thm hnh pha di ( -padbottom size )..................................................
2.12 Thm hnh bn tri ( -padleft size )...........................................................
2.13 Thm hnh bn phi ( -padright size ).......................................................
1
./configure --enable-shared m
--enable-libx264 \
--enable-gpl \
--enable-memalign-hack
Trong :
infile : ng dn ti file ngun
outfile : ng dn ti filel ch
infile options, outfile option : cc ty chn ( c th c hoc khng ).
Trong cc ty chn c thc p dng cho tp tin ch nh tip theo. Mt ty chn
c th xut hin nhiu ln trong cu lnh, mi ln xut hin sau s c p dng
cho u vo tip theo hoc tp tin u ra.
V d:
convert tp tin AVSEQ02.DAT sang AVSEQ02.avi m khng c tham s
ty chn ta s dng cu lnh :
ffmpeg -i Desktop/AVSEQ02.DAT Desktop/AVSEQ02.avi
2. Cc Option ca Video:
2.1. Bitrate ( -b bitrate )
Thit lp bitrate cho video vi n v bit/s ( mc nh l 200 kb/s)
V d :
ffmpeg -i Desktop/AVSEQ02.DAT -b 64k Desktop/AVSEQ02.avi
10
Name
sqcif
128x96
hsxga
5120x4096
qcif
176x144
wvga
852x480
11
cif
352x288
wxga
1366x768
4cif
704x576
wsxga
1600x1024
16cif
1408x1152
wuxga
1920x1200
qqvga
160x120
woxga
2560x1600
qvga
320x240
wqsxga
3200x2048
vga
640x480
wquxga
3840x2400
svga
800x600
whsxga
6400x4096
xga
1024x768
whuxga
7680x4800
uxga
1600x1200
cga
320x200
qxga
2048x1536
ega
640x350
sxga
1280x1024
hd480
852x480
qsxga
2560x2048
hd720
1280x720
hd1080
1920x1080
V d : 2 cu lnh:
ffmpeg -i Desktop/AVSEQ02.DAT -s 128x96 Desktop/AVSEQ02.avi
ffmpeg -i Desktop/AVSEQ02.DAT -s sqcif Desktop/AVSEQ02.avi
L tng ng
12
14
15
17
-padright
100
-padcolor
C93D3D
18
V d
ffmpeg -i Desktop/AVSEQ02.DAT -sameq Desktop/AVSEQ02.avi
2.22 -pass n
Chn s bc l 1hoc 2. N dng thc hin 2 bc m ha video. bc 1
cc s liu thng k ca video c ghi vo mt log file, v bc 2 log file c
s dng to ra video vi bitrate c yu cu. Pass 1 chng ta ch cn tt audio
v t u ra l null.
V d:
ffmpeg -i Desktop/AVSEQ02.DAT -pass 1 -f rawvideo -y Desktop/null
2.23 -passlogfile prefix
t tn cho log file, trn mc nh l ffmpeg2pass. Tm file hon chnh s l
PREFIX-N.log vi N l s output stream c th.
2.24 Thm video ( -newvideo )
Thm video stream mi vo video output stream hin thi.
3. Advanced Option
3.1 Pixel format ( -pix_fmt format )
Thit lp fomat cho pixel. xem danh sch cc bin format ta dng cu lnh:
ffmpeg -pix_fmt list
3.2 SwScaler flags ( -sws_flags flags )
Thit lp SwScaler flags ( ch s dng khi kt hp vi h tr swscale )
3.3 Group picture size ( -g gop_size )
Thit lp nhm kch thc hnh nh
3.4 Intra Frame ( -intra )
Ch s dng bn trong frame.
3.5 -vdt n
Hy threshold
20
3.6 -qscale q
S dng video quantizer scale c nh ( VBR )
3.7 -qmin q
video quantizer scale ti thiu ( VBR )
3.8 -qmax q
vide quantizer scale ti a ( VBR )
3.9 -qdiff q
khong cch ln nht gia cc quantizer scale
3.10 -qblur blur
m ca video quantizer scale (VBR) (range 0.0 - 1.0)
3.11 -qcomp compression
nn video quantizer scale (VBR) (mc nh = 0.5). Hng s ca phng
trnh
ratecontrol. Khong cch khuyn co mc nh rc_eq = 0.0 1.0
3.12 -lmin lambda
minimum video lagrange factor (VBR)
3.13 -lmax lambda
max video lagrange factor (VBR)
3.14 -mblmin lambda
minimum macroblock quantizer scale (VBR)
3.15 -mblmax lambda
maximum macroblock quantizer scale (VBR).
3.16 -rc_init_cplx complexity
phc tp ban u cho m ha mt bc
3.17 -b_qfactor factor
nhn t qp gia P- and B-frames
21
22
24
3.36 -deinterlace
Khng kt hp hnh nh.
3.37 -ilme
Thit lp h tr xen k trong m ha ( MPEG-2 and MPEG-4 only ). S dng
ty chn ny nu file input xen k v bn mun gi nh dng xen k mt mt l
nh nht. Cch khc l khng trn dng d liu vo bng -deinterlace nhng s to ra
mt mt.
3.38 -psnr
Tnh ton PSNR ca khung nn.
3.39 -vstats
Dump video m ha s liu thng k cho `vstats_HHMMSS.log '.
3.40 -vstats_file file
Dump video m ha s liu thng k vo file.
3.41 -top n
top=1/bottom=0/auto=-1 field first
3.42 -dc precision
Intra_dc_precision.
3.43 -vtag fourcc/tag
Thit lp video tag/fourcc.
3.44 -qphist
Hin th biu QP
3.45 .-vbsf bitstream_filter
B lc Bitstream cc gi tr c th l : "dump_extra", "remove_extra", "noise",
"h264_mp4toannexb", "imxdump", "mjpegadump".
25