0

As the title says, I want to burn some PGS subs into the video, but they're being output in the wrong position.

How the subtitles should appear: Correct Position

How the subtitles appear after burning them in with overlay: Incorrect Position

ffmpeg command:

ffmpeg -y -report -ss 5 -t 5 -i input.mkv -filter_complex "[0:v:0][0:s:0]overlay[o]" -map "[o]" output.mp4

Possibly relevant is the enormous number of times that ffmpeg prints this warning:

[graph 0 input from stream 0:3 @ 0000022f59d36180] filter context - w: 1424 h: 1080 fmt: 28, incoming frame - w: 1920 h: 1080 fmt: 28 pts_time: 4.523 [graph 0 input from stream 0:3 @ 0000022f59d36180] Changing video frame properties on the fly is not supported by all filters.

The video size is 1424x1080. Adding -canvas_size 1920x1080 makes the warnings go away, but the subtitles appear in the wrong X position as well as Y. I don't really understand why that makes the warnings disappear, and why -canvas_size 1424x1080 does nothing instead.

Using overlay=y=H-h has no effect, as far as I can tell it thinks the height of the video and subtitle streams are the same.

This is not usually something that happens when I burn image-based subtitles.

I've put the log file on pastebin, because even though the ffmpeg tag page says to put the log file in the question, doing that puts me 3x over the character limit: https://pastebin.com/LVV3J4Xd

1 Answer 1

1

Maybe you can use this filter to automaticly resize image-based subtitle for your video stream to avoid meeting overlay filter problems:

https://ffmpeg.org/ffmpeg-filters.html#scale2ref

for myself, useful code is like:

"[0:s:7][0:v]scale2ref[sub][vid];[vid][sub]overlay=shortest=1[out]"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .