使用 FFMpeg 刻录的外部 PGS 字幕 (.SUP) 轨道不同步
这是场景。我有一个系列的 2160p(HDR) 文件,带有我想要的 SUP 字幕,以及该系列的 1080p 文件。我想以硬编码方式将 SUP 字幕刻录到 1080p 文件上。文件夹“1”中的文件是 1080p 文件,我将其更改为与 2160p 相同的名称以执行 .sh 命令。
./
├── 1
│ ├── mp4.sh
│ ├── The.Series.S01E01.1080p.WEB.H264-SEQ.mkv
│ ├── The.Series.S01E02.1080p.WEB.H264-SEQ.mkv
│ ├── The.Series.S01E03.1080p.WEB.H264-SEQ.mkv
│ ├── The.Series.S01E04.1080p.WEB.H264-SEQ.mkv
│ ├── The.Series.S01E05.1080p.WEB.H264-SEQ.mkv
│ ├── The.Series.S01E06.1080p.WEB.H264-SEQ.mkv
│ └── The.Series.S01E07.1080p.WEB.H264-SEQ.mkv
├── The.Series.S01E01.2160p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E02.2160p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E03.2160p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E04.2160p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E05.2160p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E06.2160p.WEB.HDR.H265-SEQ.mkv
└── The.Series.S01E07.2160p.WEB.HDR.H265-SEQ.mkv
mp4.sh的内容如下。
for i in ./*.mkv
do
ffmpeg -i "$i" -i "../$i" -vcodec libx264 -crf 20 \
-filter_complex "[0:v:0][1:s:0]overlay[v]" \
-map "[v]" -map 0:a \
-c:a aac -ac 2 -b:v 6000k -bufsize 2500k $i.mp4
done
Stream mapping:
Stream #0:0 (h264) -> overlay:main (graph 0)
Stream #1:2 (pgssub) -> overlay:overlay (graph 0)
overlay (graph 0) -> Stream #0:0 (libx264)
Stream #0:1 -> #0:1 (eac3 (native) -> aac (native))
我想将 2160p 文件中的第一个字幕(PGS)刻录为硬编码样式,因此使用 -filter_complex 选项。但我收到了这个错误。
[graph 0 input from stream 1:2 @ 0x55621d6316c0] Changing frame properties on the fly is not supported by all filters.
如果我使用以下命令将 PGS 字幕提取为外部 .sup 文件,则字幕和视频不同步。
for i in ./*.mkv
do
ffmpeg -i "$i" -i "$i.sup" -vcodec libx264 -crf 19 \
-filter_complex "[0:v][1:s]overlay[v]" \
-map "[v]" -map 0:a \
-c:a aac -b:v 8000k -bufsize 4500k $i.mp4
done
看起来字幕是从 0:00:00 开始的,而不是原来的起点。
./
├── mp4.sh
├── The.Series.S01E01.1080p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E01.1080p.WEB.HDR.H265-SEQ.mkv.sup
├── The.Series.S01E02.1080p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E02.1080p.WEB.HDR.H265-SEQ.mkv.sup
├── The.Series.S01E03.1080p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E03.1080p.WEB.HDR.H265-SEQ.mkv.sup
├── The.Series.S01E04.1080p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E04.1080p.WEB.HDR.H265-SEQ.mkv.sup
├── The.Series.S01E05.1080p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E05.1080p.WEB.HDR.H265-SEQ.mkv.sup
├── The.Series.S01E06.1080p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E06.1080p.WEB.HDR.H265-SEQ.mkv.sup
├── The.Series.S01E07.1080p.WEB.HDR.H265-SEQ.mkv
└── The.Series.S01E07.1080p.WEB.HDR.H265-SEQ.mkv.sup
请帮帮我。谢谢。
Here is the scenario. I have 2160p(HDR) files of one series with the SUP subtitles I want, and 1080p files of that series. I want to burn the SUP subtitle onto the 1080p files in hardcoded style. The files in folder '1' is the 1080p files which I change names the same as 2160p for executing the .sh command.
./
├── 1
│ ├── mp4.sh
│ ├── The.Series.S01E01.1080p.WEB.H264-SEQ.mkv
│ ├── The.Series.S01E02.1080p.WEB.H264-SEQ.mkv
│ ├── The.Series.S01E03.1080p.WEB.H264-SEQ.mkv
│ ├── The.Series.S01E04.1080p.WEB.H264-SEQ.mkv
│ ├── The.Series.S01E05.1080p.WEB.H264-SEQ.mkv
│ ├── The.Series.S01E06.1080p.WEB.H264-SEQ.mkv
│ └── The.Series.S01E07.1080p.WEB.H264-SEQ.mkv
├── The.Series.S01E01.2160p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E02.2160p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E03.2160p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E04.2160p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E05.2160p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E06.2160p.WEB.HDR.H265-SEQ.mkv
└── The.Series.S01E07.2160p.WEB.HDR.H265-SEQ.mkv
The content of the mp4.sh is as follows.
for i in ./*.mkv
do
ffmpeg -i "$i" -i "../$i" -vcodec libx264 -crf 20 \
-filter_complex "[0:v:0][1:s:0]overlay[v]" \
-map "[v]" -map 0:a \
-c:a aac -ac 2 -b:v 6000k -bufsize 2500k $i.mp4
done
Stream mapping:
Stream #0:0 (h264) -> overlay:main (graph 0)
Stream #1:2 (pgssub) -> overlay:overlay (graph 0)
overlay (graph 0) -> Stream #0:0 (libx264)
Stream #0:1 -> #0:1 (eac3 (native) -> aac (native))
I want to burn the first subtitle(PGS) in 2160p files into hardcoded style, so use -filter_complex option. But I got this error.
[graph 0 input from stream 1:2 @ 0x55621d6316c0] Changing frame properties on the fly is not supported by all filters.
If I extract the PGS subtitle as external .sup files, using the following command, the subtitle and video is not synced.
for i in ./*.mkv
do
ffmpeg -i "$i" -i "$i.sup" -vcodec libx264 -crf 19 \
-filter_complex "[0:v][1:s]overlay[v]" \
-map "[v]" -map 0:a \
-c:a aac -b:v 8000k -bufsize 4500k $i.mp4
done
It seems the subtitle begins from 0:00:00, not as its origianl initial point.
./
├── mp4.sh
├── The.Series.S01E01.1080p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E01.1080p.WEB.HDR.H265-SEQ.mkv.sup
├── The.Series.S01E02.1080p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E02.1080p.WEB.HDR.H265-SEQ.mkv.sup
├── The.Series.S01E03.1080p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E03.1080p.WEB.HDR.H265-SEQ.mkv.sup
├── The.Series.S01E04.1080p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E04.1080p.WEB.HDR.H265-SEQ.mkv.sup
├── The.Series.S01E05.1080p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E05.1080p.WEB.HDR.H265-SEQ.mkv.sup
├── The.Series.S01E06.1080p.WEB.HDR.H265-SEQ.mkv
├── The.Series.S01E06.1080p.WEB.HDR.H265-SEQ.mkv.sup
├── The.Series.S01E07.1080p.WEB.HDR.H265-SEQ.mkv
└── The.Series.S01E07.1080p.WEB.HDR.H265-SEQ.mkv.sup
Please help me out. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论