|
| None | __init__ (self, HomeAssistant hass, av.VideoStream video_stream, av.audio.AudioStream|None audio_stream, str|None audio_bsf, StreamState stream_state, StreamSettings stream_settings) |
| |
| None | check_flush_part (self, av.Packet packet) |
| |
| None | close (self) |
| |
| None | create_segment (self) |
| |
| None | flush (self, av.Packet packet, bool last_part) |
| |
| tuple[ av.container.OutputContainer, av.VideoStream, av.audio.AudioStream|None,] | make_new_av (self, BytesIO memory_file, int sequence, av.VideoStream input_vstream, av.audio.AudioStream|None input_astream) |
| |
| None | mux_packet (self, av.Packet packet) |
| |
| None | reset (self, int video_dts) |
| |
StreamMuxer re-packages video/audio packets for output.
Definition at line 126 of file worker.py.
◆ __init__()
| None homeassistant.components.stream.worker.StreamMuxer.__init__ |
( |
|
self, |
|
|
HomeAssistant |
hass, |
|
|
av.VideoStream |
video_stream, |
|
|
av.audio.AudioStream | None |
audio_stream, |
|
|
str | None |
audio_bsf, |
|
|
StreamState |
stream_state, |
|
|
StreamSettings |
stream_settings |
|
) |
| |
Initialize StreamMuxer.
Definition at line 139 of file worker.py.
◆ check_flush_part()
| None homeassistant.components.stream.worker.StreamMuxer.check_flush_part |
( |
|
self, |
|
|
av.Packet |
packet |
|
) |
| |
Check for and mark a part segment boundary and record its duration.
Definition at line 303 of file worker.py.
◆ close()
| None homeassistant.components.stream.worker.StreamMuxer.close |
( |
|
self | ) |
|
Close stream buffer.
Definition at line 396 of file worker.py.
◆ create_segment()
| None homeassistant.components.stream.worker.StreamMuxer.create_segment |
( |
|
self | ) |
|
Create a segment when the moov is ready.
Definition at line 289 of file worker.py.
◆ flush()
| None homeassistant.components.stream.worker.StreamMuxer.flush |
( |
|
self, |
|
|
av.Packet |
packet, |
|
|
bool |
last_part |
|
) |
| |
Output a part from the most recent bytes in the memory_file.
If last_part is True, also close the segment, give it a duration,
and clean up the av_output and memory_file.
There are two different ways to enter this function, and when
last_part is True, packet has not yet been muxed, while when
last_part is False, the packet has already been muxed. However,
in both cases, packet is the next packet and is not included in
the Part.
This function writes the duration metadata for the Part and
for the Segment. However, as the fragmentation done by ffmpeg
may result in fragment durations which fall outside the
[0.85x,1.0x] tolerance band allowed by LL-HLS, we need to fudge
some durations a bit by reporting them as being within that
range.
Note that repeated adjustments may cause drift between the part
durations in the metadata and those in the media and result in
playback issues in some clients.
Definition at line 317 of file worker.py.
◆ make_new_av()
| tuple[
av.container.OutputContainer,
av.VideoStream,
av.audio.AudioStream | None,
] homeassistant.components.stream.worker.StreamMuxer.make_new_av |
( |
|
self, |
|
|
BytesIO |
memory_file, |
|
|
int |
sequence, |
|
|
av.VideoStream |
input_vstream, |
|
|
av.audio.AudioStream | None |
input_astream |
|
) |
| |
Make a new av OutputContainer and add output streams.
Definition at line 159 of file worker.py.
◆ mux_packet()
| None homeassistant.components.stream.worker.StreamMuxer.mux_packet |
( |
|
self, |
|
|
av.Packet |
packet |
|
) |
| |
Mux a packet to the appropriate output stream.
Definition at line 260 of file worker.py.
◆ reset()
| None homeassistant.components.stream.worker.StreamMuxer.reset |
( |
|
self, |
|
|
int |
video_dts |
|
) |
| |
Initialize a new stream segment.
Definition at line 241 of file worker.py.
◆ _audio_bsf
| homeassistant.components.stream.worker.StreamMuxer._audio_bsf |
|
private |
◆ _audio_bsf_context
| homeassistant.components.stream.worker.StreamMuxer._audio_bsf_context |
|
private |
◆ _hass
| homeassistant.components.stream.worker.StreamMuxer._hass |
|
private |
◆ _input_audio_stream
| homeassistant.components.stream.worker.StreamMuxer._input_audio_stream |
|
private |
◆ _input_video_stream
| homeassistant.components.stream.worker.StreamMuxer._input_video_stream |
|
private |
◆ _memory_file
| homeassistant.components.stream.worker.StreamMuxer._memory_file |
|
private |
◆ _memory_file_pos
| homeassistant.components.stream.worker.StreamMuxer._memory_file_pos |
|
private |
◆ _part_has_keyframe
| homeassistant.components.stream.worker.StreamMuxer._part_has_keyframe |
|
private |
◆ _part_start_dts
| homeassistant.components.stream.worker.StreamMuxer._part_start_dts |
|
private |
◆ _segment
| homeassistant.components.stream.worker.StreamMuxer._segment |
|
private |
◆ _segment_start_dts
| homeassistant.components.stream.worker.StreamMuxer._segment_start_dts |
|
private |
◆ _start_time
| homeassistant.components.stream.worker.StreamMuxer._start_time |
|
private |
◆ _stream_settings
| homeassistant.components.stream.worker.StreamMuxer._stream_settings |
|
private |
◆ _stream_state
| homeassistant.components.stream.worker.StreamMuxer._stream_state |
|
private |
The documentation for this class was generated from the following file:
- core/homeassistant/components/stream/worker.py