-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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 unexpected stop of media playback via ffmpeg proxy for ESPhome devices #130788
Fix unexpected stop of media playback via ffmpeg proxy for ESPhome devices #130788
Conversation
Hey there @OttoWinter, @jesserockz, @kbx81, @bdraco, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Should we connect stderr to dev null or log it somewhere ? |
I've thought about devnull, but it is read in case of any other errors: core/homeassistant/components/esphome/ffmpeg_proxy.py Lines 235 to 238 in aadb43c
I don't think, we need to log it - at most as a debug log maybe 🤔 |
I think this is fine for a patch release. We might want to change it to https://docs.python.org/3/library/asyncio-subprocess.html#asyncio.subprocess.Process.communicate in the future so it does log stderr if something does go wrong later in the process. |
…vices (home-assistant#130788) disable writing progress stats to stderr in ffmpeg command
stderr pipe might still fill up if there are errors being logged by ffmpeg, which can happen very quickly in case of encoding issues. I think a better future-proof approach will be to keep reading stderr in a separate task to avoid the deadlock situation. |
done in #130808 |
…vices (home-assistant#130788) disable writing progress stats to stderr in ffmpeg command
Proposed change
The
ffmpeg
tool writes per default its progress stats tostderr
. These stats reaches after ~ 30min already 2750 entries with each 70 bytes.The
stderr
is connected to a subprocess pipe, but never read, so the buffer to be overflowed, so that the task get canceled. Further thestderr
is only read in case of an error, so no need to write the progress stats into it.source: https://ffmpeg.org/ffmpeg.html#Main-options
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: