Add Youtube and HTTP/1.1+ stream functionality#37
Open
izekblz wants to merge 11 commits intojustarandomguyintheinternet:mainfrom
Open
Add Youtube and HTTP/1.1+ stream functionality#37izekblz wants to merge 11 commits intojustarandomguyintheinternet:mainfrom
izekblz wants to merge 11 commits intojustarandomguyintheinternet:mainfrom
Conversation
…tions to prevent irreversible save impacts
Relay creation introduced microfreezes during gameplay, moved to game initialization
Utilizes yt-dlp to get the m3u8 audio only stream and pipes to ffmpeg which posts to icecast
FFMPEG and yt-dlp can now be called from users PATH, if the user doesn't have executables in the `Cyberpunk 2077\red4ext\plugins\RadioExt` folder
Author
|
This also inadvertently added the .aac support for streams. I will probably update the ffmpeg command to work with .m3u and .ogg at some point in the future. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Full disclosure, I am not a CPP developer nor do I claim to really know what I'm doing. I've done all the testing I could think of, but a real developer should review this.
This is a quick and dirty solution for that arose from half of the online radios being unavailable. The main culprit was FMOD, as it can't properly parse audio streams that are transmitted in HTTP/1.1+.
To solve this, I introduced ffmpeg relays, that would just post to any open port on localhost. Unfortunately, those relays were unstable and usually fell apart after 1-2 reconnects. This is where Icecast comes in, as it's lightweight enough to be virtually unnoticeable and could also accommodate streams from ffmpeg relays.
While we're at it and have already introduced relays, adding youtube functionality seemed like a logical next step. Unfortunately, I couldn't get it done without introducing yt-dlp.
The general workflow looks like this:
metadata.jsonfiles if they are a streamSo all in all, the updated functionality requires 3 third party binaries (Icecast, FFmpeg and yt-dlp) and uses one more third party package (curl). There is an option to build and provide third party binaries by yourself, instead of relying on pre-provided ones in the release. Details are described in the updated README.
You can test my latest release or build your own, the only thing that might change in the project is including curl.
This also includes changes from @tiehu, as they might save someone from killing world radios in their save.