Log in

View Full Version : Odd frame accuracy with ffms2 and MPEG-1


TomArrow
4th January 2020, 10:34
I have a PNG sequence which I encoded as MPEG-1 file. Then I remuxed that MPEG-1 file to mkv. This is the only way I can get reliable frame accuracy with ffvideosource.

By frame accuracy I mean that I can jump to any frame number and it will always end up being the same frame.

However, this only applies to anything past a certain point in the video stream and only when I delay the MPEG-1 MKV stream by around 5 frames.

The first frames, when played in the correct order, actually are perfectly in sync. But all it takes is to move forward a few frames and then backwards a bit and suddenly that 5 frame delay becomes necessary. However that 5 frame delay is constant throughout the entire 2 hour video and completely reliable except for the beginning of the video if seeked in the correct order.

If I just play the video straight in the correct order, the sync seems to stay correct, however I haven't waited long enough to see for how long.

Anything I can do about this? Is there some other import filter that doesn't have this problem?

Selur
4th January 2020, 10:42
I have a PNG sequence which I encoded as MPEG-1 file
personally I would open the PNG sequence in Avisynth instead of the MPEG-1

Is there some other import filter that doesn't have this problem?
most folks would use DGDecode/DGMPGDec (DGIndex&mpeg2source) instead of FFmegSource.

TomArrow
4th January 2020, 10:49
Oh well, I tried MPEG2Source and that seems to do the trick. :)

Edit: Ah, so I'm using the suggested method. Great,thanks! :) Yeah I'm opening the png sequence too. I need both, trying to train an AI on the MPEG-1 artifacts.

Myrsloik
10th January 2020, 17:55
I have a PNG sequence which I encoded as MPEG-1 file. Then I remuxed that MPEG-1 file to mkv. This is the only way I can get reliable frame accuracy with ffvideosource.

By frame accuracy I mean that I can jump to any frame number and it will always end up being the same frame.

However, this only applies to anything past a certain point in the video stream and only when I delay the MPEG-1 MKV stream by around 5 frames.

The first frames, when played in the correct order, actually are perfectly in sync. But all it takes is to move forward a few frames and then backwards a bit and suddenly that 5 frame delay becomes necessary. However that 5 frame delay is constant throughout the entire 2 hour video and completely reliable except for the beginning of the video if seeked in the correct order.

If I just play the video straight in the correct order, the sync seems to stay correct, however I haven't waited long enough to see for how long.

Anything I can do about this? Is there some other import filter that doesn't have this problem?

Encode PNG sequences as something like huffyuv in AVI if you want to use FFMS2. That's 100% guaranteed to work properly (in addition to also beign lossless)