FLV格式是FLASH VIDEO格式的简称,随着Flash MX的推出,Macromedia公司开发了属于自己的流媒体视频格式——FLV格式。FLV流媒体格式是一种新的视频格式,由于它形成的文件极小、加载速度也极快,这就使得网络观看视频文件成为可能,FLV视频格式的出现有效地解决了视频文件导入Flash后,使导出的SWF格式文件体积庞大,不能在网络上很好的使用等缺点,FLV是在sorenson公司的压缩算法的基础上开发出来的。sorenson公司也为MOV格式提供算法。FLV格式不仅可以轻松的导入Flash中,几百帧的影片就以两秒钟;同时也可以通过rtmp 协议从Flashcom 服务器上流式播出。因此目前国内外主流的视频网站都使用这种格式的视频在线观看。
flv在线播放器 Vcastr3
下载地址:
http://www.ruochigroup.com/main/2008/03/19/vcastr-30/
有一个源于Linux的工具软件ffmpeg可以轻易地实现FLV向其它格式(avi(mpeg4)、asf、mpeg)的转换或者将其它格式转换为flv。
如果只需要转到flv,装mencoder和codecs就可以了,如果还需要截图或者其他功能,就要装ffmpeg和相关解码包。ffmpeg支持的格式没有前者多,但是速度比较快,参数也很简单。另外我们还需要转换到rm,找了很久都没找到基于前述两种软件的解决方法。在对转换速度不具特殊需求的情况下,我使用Helix Producer for linux来解决该问题,这同时也是real的人所建议的。
mencoder
下载地址:
MPlayer-1.0rc2-gui.zip
MPlayer-mingw32-1.0rc2.zip
http://www5.mplayerhq.hu/MPlayer/releases/win32/
windows-all-20071007.zip
http://www5.mplayerhq.hu/MPlayer/releases/codecs/
参数说明:
CODE:
mencoder [options] file1 [specific options] [file2] [specific options]
mencoder src.avi -o dst.avi -vf scale=320:240 -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=500
# src.avi 原文件
# -o dst.avi 定义压缩为dst.avi
# -vf scale=320:240,调整视频尺寸到320x240;
# -oac copy,指定音频编码器,copy是指不压缩,直接使用源文件里的音频。copy换成 MP3lame,即压缩成mp3。
# -ovc lavc,指定视频编码器,使用libavcodec编码器;
# -lavcopts vcodec=mpeg4:vbitrate=500,指定libavcodec的参数,vcodec=mpeg4指使用mpeg4压缩,就是DivX,vbitrate=500指500kbps的比特率。
CODE:
mencoder src.avi -o dst.flv -of lavf -oac MP3lame -lameopts abr:br=32:mode=3 -ovc lavc i_certify_that_my_video_stream_does_not_use_b_frames -vf scale=350:-3 -sws 2
# src.avi 输入文件路径,是Mplayer能支持的格式即可
# -o dst.flv 输出路径
# -of lavf 输出格式 lavf表示libavcodec
# -oac MP3lame 输出音频编码方式,lame是最好的mp3编码器
# -lameopts abr:br=32:mode=3 abr代表平均码率,相对于cbr(固定码率)和vbr(可变码率,貌似不支持),br就是音频的码率,越高音质越好,mode=3,0-3分别代表 Stereo,Joint Stereo,Force ms_stereo,Mono(默认为自动,事实上1和3对文件大小的影响并不是很大),另外可选的还有 vol(音量,取值0-10,数值越大音量越大,不建议修改)等
# -srate 22050 声音采样频率设置,也可以选11025,文件可以稍小一点
# -ovc lavc 输出视频编码 lavc就是libavcodec
# -lavcopts codec=flv flv格式压缩 vbitrate=150 视频码率
# -vf scale=350:-3 -sws 2 缩放视频,指定宽度为350,高度按比例来。质量由-sws选项控制,具体看手册
# -ofps 23 设定帧数,缩小帧数对节约文件大小效果不明显,且可能造成画面声音同步。建议不设置
mencoder “input.avi" -o "output.flv" -of lavf -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=500:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:dia=4:cmp=6:vb_strategy=1 -ofps 29.97 -srate 22050
参数详解:
-o "output.flv":是输出文件路径;
-of lavf:是输出文件格式,这里不是flv而是lavf,是因为flv属于libavformat;
-lavfopts i_certify_that_my_video_stream_does_not_use_b_frames:-lavfopts表示对lavf进行一些设置,设置的内容就是i_certify_that_my_video_stream_does_not_use_b_frames,翻译成中文就是:我确定,我的视频不用B frames,对于转换flv格式,最好加上这个参数,否则可能会报错。
-oac mp3lame:oac=output audio codec,输出音频编码器,这里用的mp3lame;
-lameopts abr:br=56:lame options,是专门针对mp3lame的参数设置,abr:br=56,是设置音频比特率为56;
-ovc lavc:ovc=output video codec,输出视频编码器,lavc表示one of libavcodec’s video codec,输出格式为libavformat之一;
-lavcopts vcodec=flv:vbitrate=500:mbd=2:mv0:v4mv:trell:cbp:last_pred=3:dia=4:cmp=6:vb_strategy=1:对lavc进行一些设置,详细介绍如下:
vcodec=flv:指定视频编码器为flv;
vbitrate=500:指定视频比特率为500。
mbd:宏模块选择算法,值为0~2默认为0,值越大转换越缓慢,但在品质和文件大小方面有好处;
mv0:编译每个宏模块并选择最好的一个,当mbd=0时无效;
v4mv:会稍微增加品质,mbd>0时效果更明显;
trell:量子化网格搜索,对每8×8block找到最优化编码;
cbp:只能和trell一期使用,评估失真的图像块编码;
last_pred=3:与上一帧相比的移动数量预测,值为0~99,1~3比较合适,大于3时对品质的提高已经无关紧要,但却会降低速度;
dia=4:移动搜索范围,值为-99~6,对于快速转换,-1是个不错的值,如果不是很重视速度,可以考虑2~4;
cmp=6:值为1~2000,默认为0,设置用于全象素移动预算的比较函数
vb_strategy=1:对动作很大的场景会有帮助,对有些视频,设置vmax_b_frames会有损品质,加上vb_strategy=1会好点。
示例:
rmvb->flv
mencoder D:/video/xchk.rmvb FLV1 -of lavf -oac mp3lame -lameopts aq=9:cbr:br=64:vol=2 -ovc lavc -lavcopts vcodec=flv:vbitrate=200:acodec=mp3:abitrate=56 -vf scale=320:270,expand=320:270:::1,crop=320:270:0:0 -ofps 18 -srate 22050 -o D:/video/xchk.flv
mencoder D:/video/tl.rmvb FLV1 -of lavf -oac mp3lame -lameopts aq=9:cbr:br=64:vol=2 -ovc lavc -lavcopts vcodec=flv:vbitrate=200:acodec=mp3:abitrate=56 -vf scale=320:270,expand=320:270:::1,crop=320:270:0:0 -ofps 18 -srate 22050 -o D:/video/test/tl.flv
mpg->flv
mencoder D:/video/hx.mpg FLV1 -of lavf -oac mp3lame -lameopts aq=9:cbr:br=64:vol=2 -ovc lavc -lavcopts vcodec=flv:vbitrate=200:acodec=mp3:abitrate=56 -vf scale=320:270,expand=320:270:::1,crop=320:270:0:0 -ofps 18 -srate 22050 -o D:/video/test/hx1.flv
DAT->flv
mencoder D:/video/avs001.DAT FLV1 -of lavf -oac mp3lame -lameopts aq=9:cbr:br=64:vol=2 -ovc lavc -lavcopts vcodec=flv:vbitrate=200:acodec=mp3:abitrate=56 -vf scale=320:270,expand=320:270:::1,crop=320:270:0:0 -ofps 18 -srate 22050 -o D:/video/test/avs0011.flv
avi->flv
mencoder D:/video/pxgk.avi FLV1 -of lavf -oac mp3lame -lameopts aq=9:cbr:br=64:vol=2 -ovc lavc -lavcopts vcodec=flv:vbitrate=200:acodec=mp3:abitrate=56 -vf scale=320:270,expand=320:270:::1,crop=320:270:0:0 -ofps 18 -srate 22050 -o D:/video/test/pxgk1.flv
----------------------------------------------------------
ffmpeg
ffmpeg能解析的格式:asx,asf,mpg,wmv,3gp,mp4,mov,avi,flv等
下载地址:
http://tirnanog.fate.jp/mirror/ffmpeg/
ffmpeg参数说明
【常用参数】 【说明】 【示例】
-i "路径" 指定需要转换的文件路径 -i "C:/nba.wmv"
-y 覆盖输出文件,即如果nba.xxx文件已经存在的话,直接覆盖
控制画面参数
-bitexac 使用标准比特率
-vcodec xvid 使用xvid压缩
-s <宽高比> 指定分辨率大小 -s 320*240
-r <数值> 帧速率(非标准数值会导致音画不同步【标准值为15或29.97】) -r 15
-b <比特率> 指定压缩比特率 -b 1500
-qmin <数值>
设定最小质量 -qmin 10
-qmax <数值> 与-qmin相反,可以与-qmin同时使用 -qmax 30
-sameq 使用与源视频相同的质量
控制声音参数
-acodec aac 设定声音编码
-ac <数值> 设定声道数:1为单声道,2为立体声 -ac 2
-ar <采样率> 设定声音采样率(8000,11025,22050) -ar 22050
-ab <比特率> 设定声音比特率(-ac设为立体声时要以一半比特率来设置,比如192kbps的就设成96) -ab 96
-vol <百分比> 设定音量大小,比如设定200就会比原来的音量大2倍 -vol 200
利用ffmpeg的这两个参数,可以控制让ffmpeg来将一个大video劈分成许多小段的独立播放的文件。
-ss time_off set the start time offset
-t duration set the recording time
详细参数:
ffmpeg [[options][`-i’ input_file]]… {[options] output_file}…
如果没有输入文件,那么视音频捕捉就会起作用。
作为通用的规则,选项一般用于下一个特定的文件。如果你给 –b 64选项,改选会设置下一个视频速率。对于原始输入文件,格式选项可能是需要的。
缺省情况下,ffmpeg试图尽可能的无损转换,采用与输入同样的音频视频参数来输出。
3.选项
a) 通用选项
-L license
-h 帮助
-fromats 显示可用的格式,编解码的,协议的。。。
-f fmt 强迫采用格式fmt
-I filename 输入文件
-y 覆盖输出文件
-t duration 设置纪录时间 hh:mm:ss[.xxx]格式的记录时间也支持
-ss position 搜索到指定的时间 [-]hh:mm:ss[.xxx]的格式也支持
-title string 设置标题
-author string 设置作者
-copyright string 设置版权
-comment string 设置评论
-target type 设置目标文件类型(vcd,svcd,dvd) 所有的格式选项(比特率,编解码以及缓冲区大小)自动设置 ,只需要输入如下的就可以了:
ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
-hq 激活高质量设置
-itsoffset offset 设置以秒为基准的时间偏移,该选项影响所有后面的输入文件。该偏移被加到输入文件的时戳,定义一个正偏移意味着相应的流被延迟了 offset秒。 [-]hh:mm:ss[.xxx]的格式也支持
b) 视频选项
-b bitrate 设置比特率,缺省200kb/s
-r fps 设置帧频 缺省25
-s size 设置帧大小 格式为WXH 缺省160X128.下面的简写也可以直接使用:
Sqcif 128X96 qcif 176X144 cif 252X288 4cif 704X576
-aspect aspect 设置横纵比 4:3 16:9 或 1.3333 1.7777
-croptop size 设置顶部切除带大小 像素单位
-cropbottom size –cropleft size –cropright size
-padtop size 设置顶部补齐的大小 像素单位
-padbottom size –padleft size –padright size –padcolor color 设置补齐条颜色(hex,6个16进制的数,红:绿:兰排列,比如 000000代表黑色)
-vn 不做视频记录
-bt tolerance 设置视频码率容忍度kbit/s
-maxrate bitrate设置最大视频码率容忍度
-minrate bitreate 设置最小视频码率容忍度
-bufsize size 设置码率控制缓冲区大小
-vcodec codec 强制使用codec编解码方式。 如果用copy表示原始编解码数据必须被拷贝。
-sameq 使用同样视频质量作为源(VBR)
-pass n 选择处理遍数(1或者2)。两遍编码非常有用。第一遍生成统计信息,第二遍生成精确的请求的码率
-passlogfile file 选择两遍的纪录文件名为file
c)高级视频选项
-g gop_size 设置图像组大小
-intra 仅适用帧内编码
-qscale q 使用固定的视频量化标度(VBR)
-qmin q 最小视频量化标度(VBR)
-qmax q 最大视频量化标度(VBR)
-qdiff q 量化标度间最大偏差 (VBR)
-qblur blur 视频量化标度柔化(VBR)
-qcomp compression 视频量化标度压缩(VBR)
-rc_init_cplx complexity 一遍编码的初始复杂度
-b_qfactor factor 在p和b帧间的qp因子
-i_qfactor factor 在p和i帧间的qp因子
-b_qoffset offset 在p和b帧间的qp偏差
-i_qoffset offset 在p和i帧间的qp偏差
-rc_eq equation 设置码率控制方程 默认tex^qComp
-rc_override override 特定间隔下的速率控制重载
-me method 设置运动估计的方法 可用方法有 zero phods log x1 epzs(缺省) full
-dct_algo algo 设置dct的算法 可用的有 0 FF_DCT_AUTO 缺省的DCT 1 FF_DCT_FASTINT 2 FF_DCT_INT 3 FF_DCT_MMX 4 FF_DCT_MLIB 5 FF_DCT_ALTIVEC
-idct_algo algo 设置idct算法。可用的有 0 FF_IDCT_AUTO 缺省的IDCT 1 FF_IDCT_INT 2 FF_IDCT_SIMPLE 3 FF_IDCT_SIMPLEMMX 4 FF_IDCT_LIBMPEG2MMX 5 FF_IDCT_PS2 6 FF_IDCT_MLIB 7 FF_IDCT_ARM 8 FF_IDCT_ALTIVEC 9 FF_IDCT_SH4 10 FF_IDCT_SIMPLEARM
-er n 设置错误残留为n 1 FF_ER_CAREFULL 缺省 2 FF_ER_COMPLIANT 3 FF_ER_AGGRESSIVE 4 FF_ER_VERY_AGGRESSIVE
-ec bit_mask 设置错误掩蔽为bit_mask,该值为如下值的位掩码 1 FF_EC_GUESS_MVS (default=enabled) 2 FF_EC_DEBLOCK (default=enabled)
-bf frames 使用frames B 帧,支持mpeg1,mpeg2,mpeg4
-mbd mode 宏块决策 0 FF_MB_DECISION_SIMPLE 使用mb_cmp 1 FF_MB_DECISION_BITS 2 FF_MB_DECISION_RD
-4mv 使用4个运动矢量 仅用于mpeg4
-part 使用数据划分 仅用于mpeg4
-bug param 绕过没有被自动监测到编码器的问题
-strict strictness 跟标准的严格性
-aic 使能高级帧内编码 h263+
-umv 使能无限运动矢量 h263+
-deinterlace 不采用交织方法
-interlace 强迫交织法编码 仅对mpeg2和mpeg4有效。当你的输入是交织的并且你想要保持交织以最小图像损失的时候采用该选项。可选的方法是不交织,但是损失更大
-psnr 计算压缩帧的psnr
-vstats 输出视频编码统计到vstats_hhmmss.log
-vhook module 插入视频处理模块 module 包括了模块名和参数,用空格分开
D)音频选项
-ab bitrate 设置音频码率
-ar freq 设置音频采样率
-ac channels 设置通道 缺省为1
-an 不使能音频纪录
-acodec codec 使用codec编解码
E)音频/视频捕获选项
-vd device 设置视频捕获设备。比如/dev/video0
-vc channel 设置视频捕获通道 DV1394专用
-tvstd standard 设置电视标准 NTSC PAL(SECAM)
-dv1394 设置DV1394捕获
-av device 设置音频设备 比如/dev/dsp
F)高级选项
-map file:stream 设置输入流映射
-debug 打印特定调试信息
-benchmark 为基准测试加入时间
-hex 倾倒每一个输入包
-bitexact 仅使用位精确算法 用于编解码测试
-ps size 设置包大小,以bits为单位
-re 以本地帧频读数据,主要用于模拟捕获设备
-loop 循环输入流。只工作于图像流,用于ffserver测试
示例:
抓图 avi->jpg
ffmpeg -i "D:/video/pxgk.avi" -y -f image2 -ss 8 -t 0.001 -s 350x240 "D:/video/test/pxgk.jpg"
转换 mp3->flv
ffmpeg.exe -i D:/video/山不转水转.mp3 -ab 56 -ar 22050 -b 500 -r 15 -s 320x240 D:/video/山不转水转.flv
转换 avi->flv
ffmpeg -i "D:/video/pxgk.avi" -ab 56 -ar 22050 -b 500 -r 15 -s 320x240 D:/video/test/pxgk.flv
转换 DAT->flv error
ffmpeg -i "D:/video/avs001.DAT" -y -ab 56 -ar 22050 -b 500 -r 15 -s 320*240 D:/video/test/avs001.flv
转换: mpg->flv
ffmpeg -i "D:/video/hx.mpg" -y -ab 56 -ar 22050 -b 500 -r 15 -s 320*240 D:/video/test/hx.flv
转换: mov->flv
ffmpeg -i "D:/video/heartbeatmv.mov" -y -ab 56 -ar 22050 -b 500 -r 15 -s 320*240 D:/video/test/heartbeatmv.flv
转换:vob->flv
ffmpeg -i "D:/video/vts.VOB" -y -ab 56 -ar 22050 -b 500 -r 15 -s 320*240 D:/video/test/vts.flv
利用mencoder转换flv 报错
命令如下:
mencoder D:/video/pxgk.avi -vf scale=320:240 -ffourcc FLV1 -of lavf -ovc lavc -lavcopts vcodec=flv:vbitrate=200 -srate 22050 -oac lavc -lavcopts acodec=mp3:abitrate=56 -o D:/video/test/pxgk1.flv
错误如下:
Forcing output FourCC to 31564c46 [FLV1].
Audio LAVC, couldn't find encoder for codec mp3.
Exiting...
命令修改如下即可:
加上如下命令参数:-oac mp3lame:oac=output audio codec,输出音频编码器,这里用的mp3lame;
mencoder D:/video/pxgk.avi FLV1 -of lavf -oac mp3lame -lameopts aq=9:cbr:br=64:vol=2 -ovc lavc -lavcopts vcodec=flv:vbitrate=200:acodec=mp3:abitrate=56 -vf scale=320:270,expand=320:270:::1,crop=320:270:0:0 -ofps 18 -srate 22050 -o D:/video/test/pxgk1.flv
FLV播放时不能拖放
是由FFMPEG、Mencoder转的FLV文件,Meta Data是损坏的,FLV播放时不能拖放。
两个修复工具:Flvtool2,Flvmdi,给flv文件加入时间标签。
Flvtool2 下载:flvtool2-1.0.6.zip
http://rubyforge.org/frs/?group_id=1096&release_id=9694
Flvmdi 下载:
http://www.buraks.com/flvmdi/
使用方法:
命令提示符下输入usage: flvmdi inFile [outFile] [/v] [/s] [/x] [/k] [/l] [/eExtraData] [/p]
inputFile 和 outputFile可以是单独文件或目录,如果未指定输出文件或路径,则对原始文件覆盖。
示例:
flvmdi D:/video/test/hx1.flv D:/video/test/hx12.flv
flvmdi D:/video/test/hx1.flv D:/video/test/hx13.flv /s "/e guoqiang test"
#cat /var/log/squid/access.log|gawk '{print $4}'|sort|uniq -c|sort -nr
如果看到很多的TCP_MEM_HIT ,这表明该文件是从内存缓存读取的,squid已经起作用了!你再用浏览器打开该文件,应该是快如闪电了。。呵呵,大功告成了!还有其他类型的HIT,如TCP_HIT等等,这些是从磁盘读取的,我觉得加速的意义不大,只不过缓解了apache的压力而已。
相应于HTTP请求,下列标签可能出现在access.log文件的第四个域。
TCP_HIT
Squid发现请求资源的貌似新鲜的拷贝,并将其立即发送到客户端。
TCP_MISS
Squid没有请求资源的cache拷贝。
TCP_REFERSH_HIT
Squid发现请求资源的貌似陈旧的拷贝,并发送确认请求到原始服务器。原始服务器返回304(未修改)响应,指示squid的拷贝仍旧是新鲜的。
TCP_REF_FAIL_HIT
Squid发现请求资源的貌似陈旧的拷贝,并发送确认请求到原始服务器。然而,原始服务器响应失败,或者返回的响应Squid不能理解。在此情形下,squid发送现有cache拷贝(很可能是陈旧的)到客户端。
TCP_REFRESH_MISS
Squid发现请求资源的貌似陈旧的拷贝,并发送确认请求到原始服务器。原始服务器响应新的内容,指示这个cache拷贝确实是陈旧的。
TCP_CLIENT_REFRESH_MISS
Squid发现了请求资源的拷贝,但客户端的请求包含了Cache-Control: no-cache指令。Squid转发客户端的请求到原始服务器,强迫cache确认。
TCP_IMS_HIT
客户端发送确认请求,Squid发现更近来的、貌似新鲜的请求资源的拷贝。Squid发送更新的内容到客户端,而不联系原始服务器。
TCP_SWAPFAIL_MISS
Squid发现请求资源的有效拷贝,但从磁盘装载它失败。这时squid发送请求到原始服务器,就如同这是个cache丢失一样。
TCP_NEGATIVE_HIT
在对原始服务器的请求导致HTTP错误时,Squid也会cache这个响应。在短时间内对这些资源的重复请求,导致了否命中。 negative_ttl指令控制这些错误被cache的时间数量。请注意这些错误只在内存cache,不会写往磁盘。下列HTTP状态码可能导致否定 cache(也遵循于其他约束): 204, 305, 400, 403, 404, 405, 414, 500, 501, 502, 503, 504。
TCP_MEM_HIT
Squid在内存cache里发现请求资源的有效拷贝,并将其立即发送到客户端。注意这点并非精确的呈现了所有从内存服务的响应。例如,某些cache在内存里,但要求确认的响应,会以TCP_REFRESH_HIT, TCP_REFRESH_MISS等形式记录。
TCP_DENIED
因为http_access或http_reply_access规则,客户端的请求被拒绝了。注意被http_access拒绝的请求在第9域的值是NONE/-,然而被http_reply_access拒绝的请求,在相应地方有一个有效值。
TCP_OFFLINE_HIT
当offline_mode激活时,Squid对任何cache响应返回cache命中,而不用考虑它的新鲜程度。
TCP_REDIRECT
重定向程序告诉Squid产生一个HTTP重定向到新的URI(见11.1节)。正常的,Squid不会记录这些重定向。假如要这样做,必须在编译squid前,手工定义LOG_TCP_REDIRECTS预处理指令。
NONE
无分类的结果用于特定错误,例如无效主机名。
相应于ICP查询,下列标签可能出现在access.log文件的第四域。
UDP_HIT
Squid在cache里发现请求资源的貌似新鲜的拷贝。
UDP_MISS
Squid没有在cache里发现请求资源的貌似新鲜的拷贝。假如同一目标通过HTTP请求,就可能是个cache丢失。请对比UDP_MISS_NOFETCH。
UDP_MISS_NOFETCH
跟UDP_MISS类似,不同的是这里也指示了Squid不愿去处理相应的HTTP请求。假如使用了-Y命令行选项,Squid在启动并编译其内存索引时,会返回这个标签而不是UDP_MISS。
UDP_DENIED
因为icp_access规则,ICP查询被拒绝。假如超过95%的到某客户端的ICP响应是UDP_DENIED,并且客户端数据库激活了(见附录A),Squid在1小时内,停止发送任何ICP响应到该客户端。若这点发生,你也可在cache.log里见到一个警告。
UDP_INVALID
Squid接受到无效查询(例如截断的消息、无效协议版本、URI里的空格等)。Squid发送UDP_INVALID响应到客户端。
附:HTTP响应状态码
Table 13-1列出了数字HTTP响应CODE和理由短句。注意Squid和其他HTTP客户端仅仅关注这些数字值。理由短句是纯解释性的,不会影响响应的意义。对每个状态码,也提供了一个到RFC 2616的具体节的索引。注意状态码0和600是squid使用的非标准的值,不会在RFC里提到。
Table 13-1. HTTP response status codes
| Code |
Reason phrase |
RFC 2616 section |
| 0 |
No Response Received (Squid-specific) |
N/A |
| 1xx |
Informational |
10.1 |
| 100 |
Continue |
10.1.1 |
| 101 |
Switching Protocols |
10.1.2 |
| 2xx |
Successful |
10.2 |
| 200 |
OK |
10.2.1 |
| 201 |
Created |
10.2.2 |
| 202 |
Accepted |
10.2.3 |
| 203 |
Non-Authoritative Information |
10.2.4 |
| 204 |
No Content |
10.2.5 |
| 205 |
Reset Content |
10.2.6 |
| 206 |
Partial Content |
10.2.7 |
| 3xx |
Redirection |
10.3 |
| 300 |
Multiple Choices |
10.3.1 |
| 301 |
Moved Permanently |
10.3.2 |
| 302 |
Found |
10.3.3 |
| 303 |
See Other |
10.3.4 |
| 304 |
Not Modified |
10.3.5 |
| 305 |
Use Proxy |
10.3.6 |
| 306 |
(Unused) |
10.3.7 |
| 307 |
Temporary Redirect |
10.3.8 |
| 4xx |
Client Error |
10.4 |
| 400 |
Bad Request |
10.4.1 |
| 401 |
Unauthorized |
10.4.2 |
| 402 |
Payment Required |
10.4.3 |
| 403 |
Forbidden |
10.4.4 |
| 404 |
Not Found |
10.4.5 |
| 405 |
Method Not Allowed |
10.4.6 |
| 406 |
Not Acceptable |
10.4.7 |
| 407 |
Proxy Authentication Required |
10.4.8 |
| 408 |
Request Timeout |
10.4.9 |
| 409 |
Conflict |
10.4.10 |
| 410 |
Gone |
10.4.11 |
| 411 |
Length Required |
10.4.12 |
| 412 |
Precondition Failed |
10.4.13 |
| 413 |
Request Entity Too Large |
10.4.14 |
| 414 |
Request-URI Too Long |
10.4.15 |
| 415 |
Unsupported Media Type |
10.4.16 |
| 416 |
Requested Range Not Satisfiable |
10.4.17 |
| 417 |
Expectation Failed |
10.4.18 |
| 5xx |
Server Error |
10.5 |
| 500 |
Internal Server Error |
10.5.1 |
| 501 |
Not Implemented |
10.5.2 |
| 502 |
Bad Gateway |
10.5.3 |
| 503 |
Service Unavailable |
10.5.4 |
| 504 |
Gateway Timeout |
10.5.5 |
| 505 |
HTTP Version Not Supported |
10.5.6 |
| 6xx |
Proxy Error |
N/A |
| 600 |
Unparseable Response Headers (Squid-specific) |
N/A |
Code Reason phrase RFC 2616 section
0 No Response Received (Squid-specific) N/A
1xx Informational 10.1
100 Continue 10.1.1
101 Switching Protocols 10.1.2
2xx Successful 10.2
200 OK 10.2.1
201 Created 10.2.2
202 Accepted 10.2.3
203 Non-Authoritative Information 10.2.4
204 No Content 10.2.5
205 Reset Content 10.2.6
206 Partial Content 10.2.7
3xx Redirection 10.3
300 Multiple Choices 10.3.1
301 Moved Permanently 10.3.2
302 Found 10.3.3
303 See Other 10.3.4
304 Not Modified 10.3.5
305 Use Proxy 10.3.6
306 (Unused) 10.3.7
307 Temporary Redirect 10.3.8
4xx Client Error 10.4
400 Bad Request 10.4.1
401 Unauthorized 10.4.2
402 Payment Required 10.4.3
403 Forbidden 10.4.4
404 Not Found 10.4.5
405 Method Not Allowed 10.4.6
406 Not Acceptable 10.4.7
407 Proxy Authentication Required 10.4.8
408 Request Timeout 10.4.9
409 Conflict 10.4.10
410 Gone 10.4.11
411 Length Required 10.4.12
412 Precondition Failed 10.4.13
413 Request Entity Too Large 10.4.14
414 Request-URI Too Long 10.4.15
415 Unsupported Media Type 10.4.16
416 Requested Range Not Satisfiable 10.4.17
417 Expectation Failed 10.4.18
5xx Server Error 10.5
500 Internal Server Error 10.5.1
501 Not Implemented 10.5.2
502 Bad Gateway 10.5.3
503 Service Unavailable 10.5.4
504 Gateway Timeout 10.5.5
505 HTTP Version Not Supported 10.5.6
6xx Proxy Error N/A
600 Unparseable Response Headers (Squid-specific) N/A
| Code |
Reason phrase |
RFC 2616 section |
| 0 |
No Response Received (Squid-specific) |
N/A |
| 1xx |
Informational |
10.1 |
| 100 |
Continue |
10.1.1 |
| 101 |
Switching Protocols |
10.1.2 |
| 2xx |
Successful |
10.2 |
| 200 |
OK |
10.2.1 |
| 201 |
Created |
10.2.2 |
| 202 |
Accepted |
10.2.3 |
| 203 |
Non-Authoritative Information |
10.2.4 |
| 204 |
No Content |
10.2.5 |
| 205 |
Reset Content |
10.2.6 |
| 206 |
Partial Content |
10.2.7 |
| 3xx |
Redirection |
10.3 |
| 300 |
Multiple Choices |
10.3.1 |
| 301 |
Moved Permanently |
10.3.2 |
| 302 |
Found |
10.3.3 |
| 303 |
See Other |
10.3.4 |
| 304 |
Not Modified |
10.3.5 |
| 305 |
Use Proxy |
10.3.6 |
| 306 |
(Unused) |
10.3.7 |
| 307 |
Temporary Redirect |
10.3.8 |
| 4xx |
Client Error |
10.4 |
| 400 |
Bad Request |
10.4.1 |
| 401 |
Unauthorized |
10.4.2 |
| 402 |
Payment Required |
10.4.3 |
| 403 |
Forbidden |
10.4.4 |
| 404 |
Not Found |
10.4.5 |
| 405 |
Method Not Allowed |
10.4.6 |
| 406 |
Not Acceptable |
10.4.7 |
| 407 |
Proxy Authentication Required |
10.4.8 |
| 408 |
Request Timeout |
10.4.9 |
| 409 |
Conflict |
10.4.10 |
| 410 |
Gone |
10.4.11 |
| 411 |
Length Required |
10.4.12 |
| 412 |
Precondition Failed |
10.4.13 |
| 413 |
Request Entity Too Large |
10.4.14 |
| 414 |
Request-URI Too Long |
10.4.15 |
| 415 |
Unsupported Media Type |
10.4.16 |
| 416 |
Requested Range Not Satisfiable |
10.4.17 |
| 417 |
Expectation Failed |
10.4.18 |
| 5xx |
Server Error |
10.5 |
| 500 |
Internal Server Error |
10.5.1 |
| 501 |
Not Implemented |
10.5.2 |
| 502 |
Bad Gateway |
10.5.3 |
| 503 |
Service Unavailable |
10.5.4 |
| 504 |
Gateway Timeout |
10.5.5 |
| 505 |
HTTP Version Not Supported |
10.5.6 |
| 6xx |
Proxy Error |
N/A |
| 600 |
Unparseable Response Headers (Squid-specific) |
N/A |
假如Squid从原始服务器没有接受到任何响应,你可在access.log里看到状态码0。假如Squid接受到的响应没有包含HTTP头部,就会出现状态码600。在少数情况下,某些原始服务器仅发送响应body,而忽略了任何头部。