osu icon indicating copy to clipboard operation
osu copied to clipboard

Aspire beatmap video is not aligned correctly with gameplay

Open Moltanicaa opened this issue 4 years ago • 9 comments

Describe the bug: This map is an aspire type of map that emphasizes the video in the background. But here, for some strange reason, the video is in a hurry for about 1.5-2 seconds. Screenshots or videos showing encountered issue: lazer gameplay: https://youtu.be/cJvUl7EoxAs

original: https://youtu.be/0ZXNxdxWZmo

map - https://osu.ppy.sh/beatmapsets/1503327#osu/3079907 osu!lazer version: 2021.623.0

Moltanicaa avatar Jun 29 '21 15:06 Moltanicaa

@bdach I have information about another problematic aspire map, where there is a problem with music playback (assuming the map starts with negative time values), a storyboard problem, where storyboard objects are displayed much earlier than they should. I'm not sure if you know about this map now. Is it possible to create issue? This map - https://osu.ppy.sh/beatmapsets/1237363#osu/2571858

I will remove this comment after answering

Moltanicaa avatar Jun 29 '21 15:06 Moltanicaa

@Moltanicaa separate issue for that please.

bdach avatar Jun 29 '21 16:06 bdach

Can you confirm this only occurs for you on this one beatmap, not others with video offsets?

peppy avatar Jun 29 '21 16:06 peppy

https://youtu.be/VlE4B8N2NUs

Moltanicaa avatar Jun 29 '21 16:06 Moltanicaa

The map used for the comparison above (https://osu.ppy.sh/beatmapsets/1376486#osu/2869013) has video offset 0, but I've taken it and manually edited one of the beatmap .osu files to set offset to -1 and there seems to be no discernible difference. So likely it's somehow specific to this one broken beatmap from the OP.

bdach avatar Jun 29 '21 17:06 bdach

I experienced the same problem with this map in danser.

After digging into it, it turns out MP4/MOV container contains metadata called "edit list" which instructs parsers how to cut the video. Most players except QuickTime/VLC/FFPlay ignore it.

It looks like osu!stable ignores it as well, so videos with that data become misaligned in lazer. For now I'm unaware if are there other videos with similar problem.

ffmpeg CLI/ffplay have -ignore_editlist argument which fixes the problem but I don't know how to apply it with ffmpeg API.

Wieku avatar Aug 28 '22 16:08 Wieku

Poking in ffmpeg source & docs it looks like the desired incantation should be something along the lines of av_opt_set_int(formatContext, "ignore_editlist", 1, 0) or similar? Have not tested, though.

Not sure how to jam that into framework, either... (do we just hardcode, or do we add some configuration primitive for it?)

bdach avatar Aug 28 '22 17:08 bdach

Hardcoding sounds fine until it becomes an issue, I think.

peppy avatar Aug 29 '22 04:08 peppy

IIRC almost everyone re-encodes the video with ffmpeg, even cutting without re-encode actually removes frames, so the only source of editlist would be if someone used QuickTime to trim the video (which seems to be the case here as the video still has audio attached).

Wieku avatar Aug 29 '22 10:08 Wieku

The issue seems to affect not just loved aspire maps, but also a ranked mapset (potentially multiple). I don't know if the technical reason behind the issue is the same, but there seems to be the same outcome.

Affected mapset: https://osu.ppy.sh/beatmapsets/1313664#osu/2722655 The topdiff [Repetition] visualizes it best, it's especially noticeable when the girl in the video repeatedly jumps up and down following sliders (it happens around every chorus). Eyeballing it, the offset in lazer is maybe a couple tenths of a second, but it's a large enough difference to completely break the experience of cursordancing together with the video.

The map is playable just fine with 100% dim or without video, but it somewhat affects playability with video playing and dim set to lower values.

I haven't tested them extensively since they don't do the same "dance" gimmick, but these two mapsets seem to use the exact same background video file:

  • https://osu.ppy.sh/beatmapsets/1222543
  • https://osu.ppy.sh/beatmapsets/1336616
  • I haven't checked mapsets for other gamemodes nor any unranked ones

I just wanted to bring this up since it's a ranked map that is affected.

TechniKris avatar Jun 09 '23 07:06 TechniKris

I can't see the issue on beatmaps which @TechniKris mentioned locally. The beatmap in the OP looks clearly broken but not the purportedly "affected" mapset.

bdach avatar Jun 14 '24 12:06 bdach

I can't see the issue on beatmaps which @TechniKris mentioned locally. The beatmap in the OP looks clearly broken but not the purportedly "affected" mapset.

Ah, I should've made a video showcasing the issue. Here, I made one now. I synced up gameplay, but the video on lazer is 8 frames (of this 60fps recording) ahead of stable

https://github.com/ppy/osu/assets/30842158/25a110eb-f6e2-4c49-aab8-f2814283ee52

TechniKris avatar Jun 14 '24 15:06 TechniKris