折腾:
【已解决】Mac中找软件编辑mp4视频的默认字幕为中文
期间,需要去看看Handbrake中压制mp4时,是否支持设置字幕,发现是可以的:
Subtitles-》Tracks-》Add External SRT
![](https://www.crifan.com/files/pic/uploads/2021/05/48da3590e0b8406394449d6ae242a35b.jpg)
![](https://www.crifan.com/files/pic/uploads/2021/05/18ba3de85bd14e8da9b66b9511e17841.jpg)
![](https://www.crifan.com/files/pic/uploads/2021/05/cfb86879108e475ca93d0be457f0decf.jpg)
然后第一个移除掉:
![](https://www.crifan.com/files/pic/uploads/2021/05/b664843eff9b41d5ad2c0b8fc0e34f0a.jpg)
![](https://www.crifan.com/files/pic/uploads/2021/05/83a2cae58e984b4ebdbb942db3cd0699.jpg)
然后把设置新增的SRT字幕:
![](https://www.crifan.com/files/pic/uploads/2021/05/50b9d1b4a3be4e4ca78f915e2a07ed32.jpg)
![](https://www.crifan.com/files/pic/uploads/2021/05/71c000fe5caf4cc0aad607a2443cacaf.jpg)
勾选:Burned In
SRT Language:从English改为Chinese
SRT Encoding:改为 UTF-8
![](https://www.crifan.com/files/pic/uploads/2021/05/7864679208b548aa95ecc87827ceaa92.jpg)
然后去压制:
![](https://www.crifan.com/files/pic/uploads/2021/05/1237af0818084bc2adb5dcd21f90fed6.jpg)
结果压制出来的视频,虽然是有中文字幕,且也不是乱码了,但是却没有处理掉
<font size=”36″
![](https://www.crifan.com/files/pic/uploads/2021/05/e725409b6222499398286717fc76c9b7.jpg)
对应原始字幕文件是:
![](https://www.crifan.com/files/pic/uploads/2021/05/3b7bd63f9dad40798b6ba658cd255a42.jpg)
Handbrake 字幕 font size
另外,也丢失了原先的字幕的背景的阴影:
![](https://www.crifan.com/files/pic/uploads/2021/05/4479dc2b92ca445e8b07cd37d75cc4bf.jpg)
“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字幕是灰色,是不支持的。
“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
算了,暂时Handbrake还是不支持font size的设置的。
暂时,只能去:
删除srt文件中的
<font size=”16″> xxx</font>
的设置,只保留xxx的字幕:
![](https://www.crifan.com/files/pic/uploads/2021/05/24886610b733408ca170f7cb58c4a8c2.jpg)
然后重新压制:
![](https://www.crifan.com/files/pic/uploads/2021/05/c0ebc33b85ac41b29aea3c19ade3056c.jpg)
最终压制出的mp4,用
TunesKit Video Cutter
去预览播放,终于:
- 有中文字幕了
- 且没有乱码了
![](https://www.crifan.com/files/pic/uploads/2021/05/3160b3311c4b40ce9ecc12d676be8dbf.jpg)
缺点:
- 无法设置字幕的字体大小
【后记】
虽然字幕内容对了,但是字幕没有背景半透明,所以后续又去:
【已解决】调节ass字幕配置字幕字体大小和背景色再用ffmpeg嵌入视频中
转载请注明:在路上 » 【基本解决】Handbrake压制mp4时添加SRT字幕文件