导出字幕
非横向布局
🌐 Non-landscape layout
如果你以 square 布局导出视频,则字幕将被嵌入到视频中。
🌐 If you export a video in the square layout, then the subtitles will be burned into the video.
其背后的想法是将方形视频发布在像 x.com 和 LinkedIn 这样的平台上,在这些平台上,视频会出现在信息流中,默认是静音的。 重要的是字幕始终可见,并且字体要大。
🌐 The idea behind this is that the square videos are posted on platforms like x.com and LinkedIn, where the video appears in a feed, muted by default.
It is important that the subtitles are always visible and have a large font size.
景观布局
🌐 Landscape layout
如果你以 landscape 布局导出视频,那么字幕默认将会以 .srt 文件导出,位置在 out/[composition-id]/captions.srt。 这由在 remotion/captions/srt/EmitSrtFile.tsx 中使用 <Artifact> API 引起。
🌐 If you export a video in the landscape layout, then the subtitles will be by default exported as a .srt file, located in out/[composition-id]/captions.srt.
This is caused by the use of the <Artifact> API in remotion/captions/srt/EmitSrtFile.tsx.
在上传到 YouTube 时,你应该将 SRT 文件与视频一起上传,这样观众就可以使用 YouTube 的原生功能来切换字幕并调整字体大小。
🌐 When posting to YouTube, you should upload the SRT file alongside your video, so that viewers can use the native YouTube feature to toggle the subtitles and adjust the font size.
烧录字幕
🌐 Burn subtitles
如果你想将字幕烧录到横向布局的视频中,请编辑remotion/captions/srt/SrtPreviewAndEditor/SrtPreviewAndEditor.tsx文件并删除以下行:
🌐 If you want to burn the subtitles into the video in landscape layout, edit the remotion/captions/srt/SrtPreviewAndEditor/SrtPreviewAndEditor.tsx file and delete the following lines:
remotion/captions/srt/SrtPreviewAndEditor/SrtPreviewAndEditor.tsx- // During rendering, you will get the actual .srt file instead of the preview. - if (useRemotionEnvironment().isRendering) { - return null; - }
现在你的视频将包含作为覆盖层显示在视频上的字幕。
🌐 Now your video will include the subtitles as an overlay on top of the video.