最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【基本解决】Handbrake压制mp4时添加SRT字幕文件

字幕 crifan 5629浏览 0评论
折腾:
【已解决】Mac中找软件编辑mp4视频的默认字幕为中文
期间,需要去看看Handbrake中压制mp4时,是否支持设置字幕,发现是可以的:
Subtitles-》Tracks-》Add External SRT
然后第一个移除掉:
然后把设置新增的SRT字幕:
勾选:Burned In
SRT Language:从English改为Chinese
SRT Encoding:改为 UTF-8
然后去压制:
结果压制出来的视频,虽然是有中文字幕,且也不是乱码了,但是却没有处理掉
<font size=”36″
对应原始字幕文件是:
Handbrake 字幕 font size
另外,也丢失了原先的字幕的背景的阴影:
Hand Brake increase font size and Keep the Pixel size – VideoHelp Forum
Subtitle Size in Vicoder and Handbrake – VideoHelp Forum
Change font size… Is there an easy option? – VideoHelp Forum
HandBrake Documentation — Subtitles
“Supported Subtitle Formats
There are different types of subtitles that exist:
* Bitmaps (Pictures), e.g. DVD VOBSUBs, Bluray PGS
* Text with markup, e.g. Closed Captions and SRT files.
* Styled SSA, e.g. most anime subtitles in MKV files
HandBrake can read subtitles from the following sources:
* From DVD’s – Either embedded VOBSUB or CC tracks.
* From Bluray – PGS Subtitles.
* User supplied SRT files.
* Embedded SSA/SRT/CC within files (such as mkv or mp4)
* SRT Subtitles
    * Can be read from your source file or imported through the “Subtitles tab” if you have separate files(s)
    * You can set an offset (measured in milliseconds) to change the start time that the first and subsequent SRT subtitles will appear. Use trial and error encoding a single chapter to obtain the correct offset.
    * You should make sure the correct character code is selected from the “Char Code” dropdown. Selecting the wrong code, will result in your output file having no subtitle track, and can cause the player to crash when playing that track.
    * Please note, SRT tracks are converted to SSA in the output file. This behavior is not currently configurable.
* SSA Subtitles
    * SSA Subtitles can be passed-thru or burned into the video.
    * When burned into the video, all styling (e.g. fonts, colors, etc) is preserved.
        * Animated effects (e.g. fade in/out, karaoke) are not currently supported. (Only the middle frame of the animation will be used.)
    * When passed-thru as text, only bold/italic/underline styles are preserved. Some players may not support the simultaneous display of multiple passed-thru SSA subtitles.”
还有个ssa字幕?
不是ass字幕啊
不过添加srt字幕时,注意到了ass字幕是灰色,是不支持的。
Subtitle Font/Size · Issue #146 · HandBrake/HandBrake
“What about tags in the SRT file’s text to set size and color? VLC supports those, but Handbrake doesn’t. https://en.wikipedia.org/wiki/SubRip#Formatting”
“Yeah, I think I pasted the wrong link. The text formatting options are all unofficial, and there’s no real standard. SubRip has no font size. VLC and some other things support a size attribute in SRT like this: <font size=”16px”>phrase</font>. Ended up biting the bullet and figuring out how to burn those subtitles in with VLC.”
-》意思是:
直接去换用VLC去编码:
VLC支持font size的语法
而Handbrake不支持
-》因为这些语法是非官方的
Handbrake subtitle not support font size
Subtitle Burn Font Issue · Issue #471 · HandBrake/HandBrake
Burn subtitle and change font size – VideoHelp Forum
算了,暂时Handbrake还是不支持font size的设置的。
暂时,只能去:
删除srt文件中的
<font size=”16″> xxx</font>
的设置,只保留xxx的字幕:
然后重新压制:
最终压制出的mp4,用
TunesKit Video Cutter
去预览播放,终于:
  • 有中文字幕了
  • 且没有乱码了
缺点:
  • 无法设置字幕的字体大小
【后记】
虽然字幕内容对了,但是字幕没有背景半透明,所以后续又去:
【已解决】调节ass字幕配置字幕字体大小和背景色再用ffmpeg嵌入视频中

转载请注明:在路上 » 【基本解决】Handbrake压制mp4时添加SRT字幕文件

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
87 queries in 0.190 seconds, using 22.11MB memory