1

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.

WongYon
  • 11
  • 3

0 Answers0