【问题标题】:Convert TS with closed captions into MKV/MP4 with sub title将带隐藏字幕的 TS 转换为带字幕的 MKV/MP4
【发布时间】:2017-03-28 19:31:23
【问题描述】:

我正在尝试将 TS 文件(带有美国隐藏式字幕)转换为 MKV(或 MP4)。目前我正在使用三步法。

Step-1 : 提取 srt 格式的字幕。

ffmpeg -f lavfi -i "movie=test.ts[out0+subcc]" -map s output.srt

Step-2 : 将 TS 转码为 MKV

ffmpeg i test.ts -vcodec libx264 -acodec copy out.mkv

Step-3 : 将字幕添加回 out.mkv

ffmpeg -i out.mkv -i output.srt -acodec copy -vcodec copy -scodec copy final.mkv.

我相信所有这三个步骤都可以组合在一个 ffmeg 命令中。有没有办法做到这一点?

【问题讨论】:

    标签: ffmpeg


    【解决方案1】:

    你可以试试

    ffmpeg -i test.ts -f lavfi -i "movie=test.ts[out0+subcc]" -map 0 -map 1:s -c:a copy -c:s srt final.mkv
    

    希望字幕的时间戳是同步的 :)

    【讨论】:

    • 谢谢。我相信我还需要添加 -c:v libx264 。对吗?
    • 为了保证,当然。但它是 MKV/MP4 的默认视频编解码器,因此并非严格需要。
    猜你喜欢
    • 1970-01-01
    • 2013-10-12
    • 1970-01-01
    • 2023-03-11
    • 2015-10-09
    • 2014-12-25
    • 2014-11-04
    • 2014-07-13
    • 1970-01-01
    相关资源
    最近更新 更多