Log in

View Full Version : Sync differences between 2 computers using FFMS2


TomArrow
13th September 2019, 22:53
Hi. Using AviSynth+ r2772 and ffms2 2.23.1 (ffinfo shows 2.23.0.0). Windows 7 Ultimate 64 bit fully up to date with all SPs.

I have an identical script, identical files, identical ffindex files, identical AviSynth+ version, identical plugins+ and plugins64+ folders (no plugins in the non-+ folders).

Have two synced videos. Both are mkv. One is H264 (bluray-compat), the other is MPEG-2 (dvd-compat).

Synced the two on computer 1, transferred the project to computer 2 and now the files are no longer in sync.

On computer two, there is suddenly a FOUR (!!) frame difference at the very start of the clip. I can compensate that difference with .Trim(), by removing 4 frames from one of the clips, but sadly even with that, I get random single-frame differences across the entire length of the video. The video will go out-of-sync for a single frame and then go back to being in sync.

On computer 1, the sync is spot-on.

Perfect sync is absolutely crucial for this project (I wanna export pngs to train an AI upscaler).

When I run .ffinfo on either of the two synced clips, I get identical readout on both computers (CFR and VFR time, frame numbers and all the other stuff), but the image shown is different.

I don't know what to do, this is extremely frustrating. It looks like ffms2 is using a different decoder on both computers, but I don't know how that is possible or what I can do about it.

Second computer has ffdshow installed, but I don't know if that has any influence or how to change anything about that. And if that could be the problem, I probably have a million different things installed that could interfere similarly.

This never happened to me before. Every time in the past when I transferred between the two computers, everything worked fine.

Please help, I'm losing my mind lol.

P.S. Oh yeah the second computer has a much better CPU. Computer 1 has a Intel G2130 CPU, computer 2 has an Intel 3930K and also a GPU that supports h264 decoding (GTX 1070). Was thinking maybe it could be some CPU optimization problem, with some SSE-version of the function having a bug or something. Or maybe ffmpeg is using the (evidently faulty) GPU decoding of the GTX 1070?

Myrsloik
14th September 2019, 11:50
Hi. Using AviSynth+ r2772 and ffms2 2.23.1 (ffinfo shows 2.23.0.0). Windows 7 Ultimate 64 bit fully up to date with all SPs.

I have an identical script, identical files, identical ffindex files, identical AviSynth+ version, identical plugins+ and plugins64+ folders (no plugins in the non-+ folders).

Have two synced videos. Both are mkv. One is H264 (bluray-compat), the other is MPEG-2 (dvd-compat).

Synced the two on computer 1, transferred the project to computer 2 and now the files are no longer in sync.

On computer two, there is suddenly a FOUR (!!) frame difference at the very start of the clip. I can compensate that difference with .Trim(), by removing 4 frames from one of the clips, but sadly even with that, I get random single-frame differences across the entire length of the video. The video will go out-of-sync for a single frame and then go back to being in sync.

On computer 1, the sync is spot-on.

Perfect sync is absolutely crucial for this project (I wanna export pngs to train an AI upscaler).

When I run .ffinfo on either of the two synced clips, I get identical readout on both computers (CFR and VFR time, frame numbers and all the other stuff), but the image shown is different.

I don't know what to do, this is extremely frustrating. It looks like ffms2 is using a different decoder on both computers, but I don't know how that is possible or what I can do about it.

Second computer has ffdshow installed, but I don't know if that has any influence or how to change anything about that. And if that could be the problem, I probably have a million different things installed that could interfere similarly.

This never happened to me before. Every time in the past when I transferred between the two computers, everything worked fine.

Please help, I'm losing my mind lol.

P.S. Oh yeah the second computer has a much better CPU. Computer 1 has a Intel G2130 CPU, computer 2 has an Intel 3930K and also a GPU that supports h264 decoding (GTX 1070). Was thinking maybe it could be some CPU optimization problem, with some SSE-version of the function having a bug or something. Or maybe ffmpeg is using the (evidently faulty) GPU decoding of the GTX 1070?

Try setting the same number of threads for both avs+ and ffms2 and see if it still happens.

ChaosKing
14th September 2019, 14:53
You could also try seekmode=0. Could be slower but also more safe.

TomArrow
14th September 2019, 22:52
Try setting the same number of threads for both avs+ and ffms2 and see if it still happens.

Thanks for the idea. I've never used explicit multithreading in Avisynth+ before. How would I achieve what you suggested?

Atak_Snajpera
14th September 2019, 23:08
You may also try lsmash as video source decoder.

ChaosKing
15th September 2019, 00:01
Thanks for the idea. I've never used explicit multithreading in Avisynth+ before. How would I achieve what you suggested?
ffms2("myvide.mp4", threads=1)

https://github.com/FFMS/ffms2/blob/master/doc/ffms2-avisynth.md#ffvideosource