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

Transcode the stream if ffmpeg-python is available #9

Merged
merged 8 commits into from
Mar 26, 2023

Conversation

bct
Copy link
Contributor

@bct bct commented Mar 7, 2023

If the ffmpeg module (https://github.com/kkroening/ffmpeg-python) is available, transcode the output of /rest/stream to respect maxBitRate.

If ffmpeg is not available, it will fall back sending the raw file.

I also changed the code for sending the raw file to use flask.send_file - this is supposed to be more efficient.

I've tested this manually, with & without ffmpeg. I'm not sure this is the most effective way to transcode, but it's been working for me.

@BinaryBrain
Copy link
Owner

BinaryBrain commented Mar 26, 2023

Awesome idea and thanks for the PR!
I found a bug when transcoding MP3 files containing cover art.
I also added an option never_transcode: False that you can turn to True to deactivate transcoding (I use it on a Rpi and 30s to encode a mp3 file is a bit much for me).
I added this in #10 .

@BinaryBrain BinaryBrain merged commit 46e7dd8 into BinaryBrain:main Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants