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

Fix unnecessary audio transcoding #154

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jaspervdj
Copy link

When I tried to prepare a video so that no transcoding was necessary, I noticed
this was impossible, even if I used exactly the same ffmpeg call gnomecast was
using. I chased this down to an or that probably should have been an and:
we want to transcode if we have an unsupported audio format and we can't play
the embedded audio stream.

Thanks a lot for this project!

When I tried to prepare a video so that no transcoding was necessary, I noticed
this was impossible, even if I used exactly the same `ffmpeg` call gnomecast was
using.  I chased this down to an `or` that probably should have been an `and`:
we want to transcode if we have an unsupported audio format *and* we can't play
the embedded audio stream.
@esauvisky
Copy link

esauvisky commented Apr 19, 2023

I also had to fix the line above when trying to play bare mp3 files:

self.transcode_video = force_video or (self.video_stream and not self.can_play_video_codec(video_stream.codec))
self.transcode_audio = force_audio or (self.audio_stream and all(stream.codec not in AUDIO_EXTS for stream in fmd.audio_streams)) or not self.can_play_audio_stream(self.audio_stream)
self.transcode = transcode_container or ((self.transcode_video or self.transcode_audio) and transcode_container)

Still didn't manage to get it working tho

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.

None yet

2 participants