CollapseLauncher / Collapse

An Advanced Launcher for miHoYo/HoYoverse Games
MIT License
1.41k stars 65 forks source link

[Bug]: Video playback is choppy when using video backgrounds #452

Closed devrim6 closed 2 months ago

devrim6 commented 7 months ago

Affected Version

1.80.0-PRE

Bug Behavior

Selecting a video as the background makes said video appear choppy with it pausing at fixed intervals.

Expected Behavior

The video should play at the native fps with no hiccups.

Steps to reproduce

Just add any video.

Related Issues

No response

Screenshot(s)

https://github.com/CollapseLauncher/Collapse/assets/72068078/9bd9c8c1-b4f5-4d39-9375-f825217b69c1

Additional Information

DxDiag.txt

log-2024-04-12-prevUnknown-id1.log

neon-nyan commented 7 months ago

Hi @devrim6,

Thank you for reporting this issue. For further investigation, can you send us the background video you use?

devrim6 commented 7 months ago

Hi @devrim6,

Thank you for reporting this issue. For further investigation, can you send us the background video you use?

Sure, though this issue persists with any kind of video I try.

https://github.com/CollapseLauncher/Collapse/assets/72068078/4cb09468-5d62-4c70-b4b6-761b00138abd

neon-nyan commented 7 months ago

Thanks for your response @devrim6,

Seems like it's not media specific issue but can you try these builds below and tell if one or both of these builds have the same stutter issue?

Canary Build with FFmpeg Codec

Canary Build with Windows Media Foundation Codec

Alternative Link (via Mega) (in case you can't access the links)

Canary Build with FFmpeg Codec

Canary Build with Windows Media Foundation Codec

devrim6 commented 7 months ago

Unfortunately both builds show the same issue. The Windows Media build threw an error regarding mpeg-dash, but using any other video resulted in the same bug. image

neon-nyan commented 7 months ago

Noted. Seems like the stuttering issue caused by WinUI. I will be keeping this issue open until we find a way to fix it or waiting for Microsoft to fix this issue.

Regarding to that exception you're seeing is intentional since I've recently added a check if the .mp4 video format is using MPEG-DASH container, which is by default unsupported for users who don't install additional codec pack.

Scighost commented 7 months ago

@devrim6 Hi, you could use ffmpeg to repackage video stream.

 ffmpeg -i .\322010765-4cb09468-5d62-4c70-b4b6-761b00138abd.mp4 -c copy output.mp4

https://github.com/CollapseLauncher/Collapse/assets/61003590/b0ac98c4-3464-496b-b65e-070a05095566

devrim6 commented 7 months ago

@Scighost That did not fix the issue either. I tried repackaging other videos with ffmpeg but I got the same result.

bagusnl commented 7 months ago

I can't replicate the stutter with both a 4K60 VP9 22.4Mbps video, nor video that was provided above (after converted by SciGhost) Tho I do notice a slight stutter on the 4K60 when the video was on my hard drive, moving it to SSD completely fixes it (could be because I was on the middle of a defrag too but eh)

System: Ryzen 7 5700X Radeon RX6600 W11 23H2 Collapse 1.80.0-Pre release version

neon-nyan commented 7 months ago

@devrim6 Can you try this build? It's using async FileStream and bigger buffer being set (64 KB instead of 4 KB)

Canary Build with Async + Big Buffer

devrim6 commented 7 months ago

@neon-nyan This build did not do it either. I have tested background videos on other machines as well and it worked there, so it might just be something with my system, though not sure what. Here are the logs in case you need them. log-2024-04-20-pre1.80.0-id0.log

bagusnl commented 2 months ago

Closed as stale and cannot reproduced. Shall there is a new clue, please reopen the issue. Thanks for supporting Collapse Launcher!