ffmpeg把字幕烧进视频中变成硬字幕可以用ffmpeg-y-isample.rmvb[-vfcrop=1280:720:0:100][-vfrotate=PI/n][-vfass=sample.ass]-vcodech264[-s1280x720]-r23.976[-vb4800k]-acodeclibvo_aacenc-ac2-ar48000[-ab128k-afvolume=256]sample.mkv解释:以上命令可以在dos命令行中输入,也可以创建到批处理文件中运行。不过,前提是:要在ffmpeg所在的目录中执行(转换成所在目录下面的\bin子目录)。参数:-y(覆盖输出文件,即如果sample.***文件已经存在的话,不经提示就覆盖掉了)-isample.rmvb(输入文件是和ffmpeg在同一目录下的sample.rmvb文件,可以自己加路径,改名字)-vfcrop=1280:720:0:100,从(0,100)坐标开始切割出1280x720分辨率大小的视频画面-vfrotate=PI/n将视频画面顺时针旋转180/n度,会重新编码-vfass=sample.ass将编译好的sample.ass字幕文件“烧”进视频文件中,做成“硬字幕”视频文件【特别注意:字幕格式只能用UTF-8格式,其他的ANSI会乱码,Unicode不认识】-vcodech264(使用h264编码压缩视频,如果直接复制不重新编码,可以用copy来做)-s1280x720(输出的分辨率为1280x720,注意跟-vf配合使用时是将得到的画面再解析后处理)-r23.976(帧数,一般就用这个吧)-vb4800k(视频数据流量,用-bnnnnk的指令则使用固定码率,数字根据需要调整,4800k大约相当于2Gbytes/hour;还可以用动态码率如:-qscale4和-qscale6,4的质量比6高)-acodecaac(音频编码用AAC)[似乎ffmpeg提示不支持AAC方式,说在实验阶段,建议用-strict2这个参数,或者还有建议的-acodeclibvo_aacenc这种方式]-ac2(声道数1或2)[audiochanel=2]-ar48000(声音的采样频率,好像PSP只能支持24000Hz)[audiorate=48000Hz]-ab128(音频数据流量,一般选择32、64、96、128)[audiobitrate=128kbps]-afvolume=256(256的音量,256是基础音量,512是增加一倍的意思,自己改)[audiovolume=256]sample.***(输出文件名,也可以加路径改文件名)№分辨率通俗解释推荐最小码率(kbps)推荐最大码率(kbps)视频容量(MB/每小时)1320x240CIF,VCD20038488-1682640x480/7681024336-4503720x576DVD10241440450-63241280x720720P,半高清20483072900-135051920x10801080P,全高清512081922250-3600---Howtoburnsubtitlesintovideo如何将字幕文件烧录进视频变成“硬字幕”---savethebelowcodeintheffmpegfolderasfonts.confandsetenviromentas:FC_CONFIG_DIR=%windir%\fontsFC_CONFIG_FILE=E:\software\media\video\ffmpeg\fonts.confFONTCONFIG_PATH=E:\software\media\video\ffmpeg(amendthepathtotheffmpegfolderonyoursystem)CODE:SELECTALL?xmlversion=1.0?fontconfigdirC:\WINDOWS\Fonts/dirmatchtarget=patterntestqual=anyname=familystringmono/string/testeditname=familymode=assignstringmonospace/string/edit/matchmatchtarget=patterntestqual=allname=familycompare=not_eqstringsans-serif/string/testtestqual=allname=familycompare=not_eqstringserif/string/testtestqual=allname=familycompare=not_eqstringmonospace/string/testeditname=familymode=append_laststringsans-serif/string/edit/matchaliasfamilyTimes/familypreferfamilyTimesNewRoman/family/preferdefaultfamilyserif/family/default/aliasaliasfamilyHelvetica/familypreferfamilyArial/family/preferdefaultfamilysans/family/default/aliasaliasfamilyCourier/familypreferfamilyCourierNew/family/preferdefaultfamilymonospace/family/default/aliasaliasfamilyserif/familypreferfamilyTimesNewRoman/family/prefer/aliasaliasfamilysans/familypreferfamilyArial/family/prefer/aliasaliasfamilymonospace/familypreferfamilyAndaleMono/family/prefer/aliasmatchtarget=patterntestname=familycompare=eqstringCourierNew/string/testeditname=familymode=prependstringmonospace/string/edit/matchmatchtarget=patterntestname=familycompare=eqstringCourier/string/testeditname=familymode=prependstringmonospace/string/edit/match/fontconfigYoucanburntextsubtitleswithoneoftwofilters:subtitlesorass.ForWindowsusersthislinkmaybeuseful,asyouhavetosetupfontpathsjustrighttogetlibasstowork=10&t=318&sid=0addef104ec454f3621b1ca39b00c6ecsubtitlesfilter¶AsofNov29,2012youcanalsosimplyusethesubtitlesfilter:ffmpeg-ivideo.avi-vfsubtitles=subtitle.srtout.aviassfilter¶UsingFFmpeg'sassvideofilter(seeWikipediaforAdvancedSubStationAlpha),wecandrawtextofthesubtitlesintothemovie,likethis:ffmpeg-ivideo.avi-vfass=subtitle.assout.aviAswiththesubtitlesfilter,thisfilterrequiresffmpegtobecompiledwith--enable-libass.IfyoursubtitleisinSubRip,MicroDVDoranyothersupportedtextsubtitles,youhavetoconvertittoASSbeforeusingthefilter:ffmpeg-isubtitle.srtsubtitle.asspicturebasedsubtitles¶Youcanburnpicturebasedsubtitlesintoamovieaswell(forinstance,dvdsubisatypeofpicturebasedoverlaysubtitles),byusingtheoverlayfiltertooverlaytheimages.Hereisanexample-anMKVwithdvdsubsubtitlesinaseparatestream:ffmpeg-iinput.mkv-filter_complex'[0:v][0:s]overlay[v]'-map[v]-map0:aoutputoptionsoutput.mkvIfyouhavemultiplesubtitlestreams,youcanselectwhichonetousebyreplacing[0:s]with[0:s:0]toselectthefirstsubtitlestreamor[0:s:1]toselectthesecondsubtitlestream,andsoon.Seealsotheofficialdocumentation;searchforhardcode.