UltraStar-Deluxe / USDX

The free and open source karaoke singing game UltraStar Deluxe, inspired by Sony SingStarâ„¢
https://usdx.eu
GNU General Public License v2.0
832 stars 160 forks source link

Video out of sync on some videos #160

Closed supersmo closed 7 years ago

supersmo commented 7 years ago

Some videos that are in sync in Ultrastar Deluxe 1.1 final, Ulstrastar 1.0.2 and Performous are out of sync in Ultrastar Deluxe 1.3.2 beta.

This is what I've done to test it: I extracted a singstar dvd with ss2usdx. The original m2v file is in sync with VIDEOGAP:0 The by ffmpeg encoded .avi file is off sync by 0.4 - 0.5 seconds. (But in sync in USDX 1.1)

I've tried a bunch of settings in ffmpeg with the same results: Setting1: (H.264) ffmpeg.exe -i "movie.m2v" -c:v libx264 -crf 25 -an "movie.avi"

Setting2: (xvid) ffmpeg.exe -i "movie.m2v" -c:v libxvid -q:v 3 -an "movie.avi"

Setting3: (xvid 2 pass) ffmpeg -y -i movie.m2v -c:v libxvid -b:v 1500k -pass 1 -an -f avi NUL ffmpeg -i movie.m2v -c:v libxvid -b:v 1500k -pass 2 -an output.avi

FFMPEG version that was included in ss2usdx: version N-77556-g4160900

When I use HandBrake to encode the videos in MPEG-4 or H.264 they are however in sync.

basisbit commented 7 years ago

simple workaround: don't use avi. Mp4 is much better for fast playback. the avi delay issue is known and is caused because we can not use CODEC_FLAG_LOW_DELAY with current ffmpeg versions for avi files because of a frames out of order bug in ffmpeg.

basisbit commented 7 years ago

this is caused by the same issue as #118