Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💡 [REQUEST] - Get rid of smacker videos #23

Open
mr-dev-cmd opened this issue Nov 23, 2022 · 8 comments
Open

💡 [REQUEST] - Get rid of smacker videos #23

mr-dev-cmd opened this issue Nov 23, 2022 · 8 comments
Labels
question Further information is requested

Comments

@mr-dev-cmd
Copy link

mr-dev-cmd commented Nov 23, 2022

Reference Issues

No response

Summary

The smacker Videos run very slowly and Audio/video get asynchron.
Maybe it's possible to adjust some settings in the code to "repair" it (if its a bug).
Another way could be, to convert the videos to mp4 and make the game able to play it.

Basic Example

It's only about the intro and the 2 outro videos.

Unresolved questions

No response

@mr-dev-cmd mr-dev-cmd added the question Further information is requested label Nov 23, 2022
@mr-dev-cmd
Copy link
Author

Maybe smpeg (https://github.com/icculus/smpeg) could be a solution. Would be nice if the game is able to play the videos in other format than smk.

How to convert the videos from smk to mpeg is easy with the smk2avi tool already part of this project and after that use vlc player to convert further. So its possible for everybody who want it, to do it.

@mr-dev-cmd
Copy link
Author

I testen a little around with some dodecs and players and think now, that its not really good working to use MPEG1 or MPEG2. It's just hard to find good encoder and good settings.

Maybe you have a good solution for the slow running smacker Videos.

WizzardMaker added a commit that referenced this issue Nov 30, 2022
@WizzardMaker
Copy link
Owner

The delayed playback was indeed a bug in the code - the video audio was not properly queued into the audio buffer

Should work now as intended with smacker files

@WizzardMaker
Copy link
Owner

The videos work fine on windows...

I don't know if another codec really improves the performance, as smacker is already a rather performance oriented codec

The only possible problem I could see is either the sound queueing locking for too long on linux, or the time delaying is incorrect on linux

@mr-dev-cmd
Copy link
Author

I will test with your next Windows Release on my Windows test machine too.
I guess you are right, that another codec will not help here.
Can you tell me where I could play around to find out what could be the problem in Linux? Are there some parameters in the code?

@mr-dev-cmd
Copy link
Author

I tested the Windows Release. The videos play indeed a little faster but still not normal.
When I use the original exe, the videos play perfect.

WizzardMaker added a commit that referenced this issue Dec 23, 2022
@WizzardMaker
Copy link
Owner

Okay, I think I found the culprit of the issue -> VSYNC

The game by default runs with VSYNC active, but that can mess with the video playback, because that needs a steady rate that itself controls. Any outside delay messes with the audio queue and the correct video stream.

I'm now working on disabling VSYNC during videos

@mr-dev-cmd
Copy link
Author

Hi.
When I play the Videos, I still have (after some seconds) short hangings. I can hear that the Audio is not smoothly running.
I replaced the intro.smk with the intro file of settlers2 and could find the same behavior. It just feels that a buffer is running full and then the hanging starts. (Hard to explain)

The devilutionx project is handling smacker Videos too and there the videos run perfect. I think they use another library but I am not good enough in all this programming to find out what is the big difference.
Here a link to their code. Maybe you get a hint or a new idea.
https://github.com/diasurgical/devilutionX/blob/master/Source/storm/storm_svid.cpp

By the way: the rttr (settlers 2 remake) project have not yet implemented a video player for their intro video. Because it's too much work for only 1 video in the complete game, but for the good old feeling, it would be nice to have it working. Maybe you can assist them.
Return-To-The-Roots/s25client#1234

mertenpopp pushed a commit to mertenpopp/AirlineTycoon that referenced this issue Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants