ffmpeg encoding a movie with diconinuinities in video and audio
I’m encoding a movie (Avatar-The Way of the Water) from the DVD. The DVD timestamps have discontinuities in both video and audio:
[vist#0:1/mpeg2video @ 0x594d65657440] timestamp discontinuity (stream id=480): -24160289, new offset= 4452355191
[aist#0:2/ac3 @ 0x594d65648680] timestamp discontinuity (stream id=128): 24192289, new offset= 4428162902
frame=110449 fps=5.0 q=32.1 size= 707072KiB time=01:14:09.52 bitrate=1301.8kbitframe=110450 fps=5.0 q=25.9 size= 707072KiB time=01:14:09.56 bitrate=1301.8kbit[aist#0:2/ac3 @ 0x594d65648680] timestamp discontinuity (stream id=128): -24128289, new offset= 4452291191
frame=110451 fps=5.0 q=28.4 size= 707072KiB time=01:14:09.60 bitrate=1301.8kbitframe=110455 fps=5.0 q=32.1 size= 707072KiB time=01:14:09.76 bitrate=1301.7kbitframe=110456 fps=5.0 q=26.2 size= 707072KiB time=01:14:09.80 bitrate=1301.7kbitframe=110457 fps=5.0 q=28.4 size= 707072KiB time=01:14:09.84 bitrate=1301.7kbitframe=110461 fps=5.0 q=32.4 size= 707072KiB time=01:14:10.00 bitrate=1301.6kbitframe=110462 fps=5.0 q=26.1 size= 707072KiB time=01:14:10.04 bitrate=1301.6kbitframe=110463 fps=5.0 q=28.3 size= 707072KiB time=01:14:10.08 bitrate=1301.6kbitframe=110467 fps=5.0 q=32.1 size= 707072KiB time=01:14:10.24 bitrate=1301.6kbitframe=110468 fps=5.0 q=26.2 size= 707072KiB time=01:14:10.28 bitrate=1301.6kbitframe=110469 fps=5.0 q=26.4 size= 707072KiB time=01:14:10.32 bitrate=1301.6kbitframe=110474 fps=5.0 q=32.0 size= 707072KiB time=01:14:10.52 bitrate=1301.5kbitframe=110474 fps=5.0 q=32.0 size= 707072KiB time=01:14:10.52 bitrate=1301.5kbit[libopus @ 0x594d65625f40] Queue input is backward in time
Last message repeated 1 times
[aost#0:1/libopus @ 0x594d656eb880] Non-monotonic DTS; previous: 4452121, current: 4452109; changing to 4452121. This may result in incorrect timestamps in the output file.
[aost#0:1/libopus @ 0x594d656eb880] Non-monotonic DTS; previous: 4452129, current: 4452117; changing to 4452129. This may result in incorrect timestamps in the output file.
So when encoding, ffmpeg does its best. The resulting file though, it plays fine with ffplay, however with mpv on reaching a discontinuity, the video freezes, the audio continues, then the video sprints to catch up.
I think I’ve tried most methods of doing things with the timesteps, but what I think is happening is a different correction is applied to audio and video.
So any ideas what to change, or should I just use ffplay?
Read more here: Source link
