Skip to content

Commit d326ff4

Browse files
committed
Set the default bit_rate to 0
1 parent 05b38be commit d326ff4

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

av/container/output.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ cdef class OutputContainer(Container):
7676
codec_context.pix_fmt = lib.AV_PIX_FMT_YUV420P
7777
codec_context.width = kwargs.pop("width", 640)
7878
codec_context.height = kwargs.pop("height", 480)
79-
codec_context.bit_rate = kwargs.pop("bit_rate", 1024000)
79+
codec_context.bit_rate = kwargs.pop("bit_rate", 0)
8080
codec_context.bit_rate_tolerance = kwargs.pop("bit_rate_tolerance", 128000)
8181
try:
8282
to_avrational(kwargs.pop("time_base"), &codec_context.time_base)
@@ -90,7 +90,7 @@ cdef class OutputContainer(Container):
9090
# Some sane audio defaults
9191
elif codec.type == lib.AVMEDIA_TYPE_AUDIO:
9292
codec_context.sample_fmt = codec.sample_fmts[0]
93-
codec_context.bit_rate = kwargs.pop("bit_rate", 128000)
93+
codec_context.bit_rate = kwargs.pop("bit_rate", 0)
9494
codec_context.bit_rate_tolerance = kwargs.pop("bit_rate_tolerance", 32000)
9595
try:
9696
to_avrational(kwargs.pop("time_base"), &codec_context.time_base)

tests/test_encode.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ def test_default_options(self) -> None:
120120
assert stream.time_base is None
121121

122122
# codec context properties
123-
assert stream.bit_rate == 1024000
124123
assert stream.format.height == 480
125124
assert stream.format.name == "yuv420p"
126125
assert stream.format.width == 640
@@ -176,7 +175,6 @@ def test_default_options(self) -> None:
176175
assert stream.time_base is None
177176

178177
# codec context properties
179-
assert stream.bit_rate == 128000
180178
assert stream.format.name == "s16"
181179
assert stream.sample_rate == 48000
182180

0 commit comments

Comments
 (0)