mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 14:57:09 +00:00
Disable audio for HLS or mpegts input (#39906)
This commit is contained in:
parent
b66aaeea99
commit
4ee5a29bc0
@ -64,11 +64,16 @@ def _stream_worker_internal(hass, stream, quit_event):
|
|||||||
video_stream = container.streams.video[0]
|
video_stream = container.streams.video[0]
|
||||||
except (KeyError, IndexError):
|
except (KeyError, IndexError):
|
||||||
_LOGGER.error("Stream has no video")
|
_LOGGER.error("Stream has no video")
|
||||||
|
container.close()
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
audio_stream = container.streams.audio[0]
|
audio_stream = container.streams.audio[0]
|
||||||
except (KeyError, IndexError):
|
except (KeyError, IndexError):
|
||||||
audio_stream = None
|
audio_stream = None
|
||||||
|
# These formats need aac_adtstoasc bitstream filter, but auto_bsf not
|
||||||
|
# compatible with empty_moov and manual bitstream filters not in PyAV
|
||||||
|
if container.format.name in {"hls", "mpegts"}:
|
||||||
|
audio_stream = None
|
||||||
|
|
||||||
# The presentation timestamps of the first packet in each stream we receive
|
# The presentation timestamps of the first packet in each stream we receive
|
||||||
# Use to adjust before muxing or outputting, but we don't adjust internally
|
# Use to adjust before muxing or outputting, but we don't adjust internally
|
||||||
@ -238,7 +243,7 @@ def _stream_worker_internal(hass, stream, quit_event):
|
|||||||
|
|
||||||
# Update last_dts processed
|
# Update last_dts processed
|
||||||
last_dts[packet.stream] = packet.dts
|
last_dts[packet.stream] = packet.dts
|
||||||
# mux video packets immediately, save audio packets to be muxed all at once
|
# mux packets
|
||||||
if packet.stream == video_stream:
|
if packet.stream == video_stream:
|
||||||
mux_video_packet(packet) # mutates packet timestamps
|
mux_video_packet(packet) # mutates packet timestamps
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user