mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +00:00
use the input stream codec as the template for the output streams (#22747)
This commit is contained in:
parent
a75b151dfa
commit
8c657d4254
@ -29,11 +29,7 @@ def create_stream_buffer(stream_output, video_stream, audio_frame):
|
|||||||
segment = io.BytesIO()
|
segment = io.BytesIO()
|
||||||
output = av.open(
|
output = av.open(
|
||||||
segment, mode='w', format=stream_output.format)
|
segment, mode='w', format=stream_output.format)
|
||||||
vstream = output.add_stream(
|
vstream = output.add_stream(template=video_stream)
|
||||||
stream_output.video_codec, video_stream.rate)
|
|
||||||
# Fix format
|
|
||||||
vstream.codec_context.format = \
|
|
||||||
video_stream.codec_context.format
|
|
||||||
# Check if audio is requested
|
# Check if audio is requested
|
||||||
astream = None
|
astream = None
|
||||||
if stream_output.audio_codec:
|
if stream_output.audio_codec:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user