Add audio encoder (#1096)

* add audio encoder

* add todos

* add todos

* cleannup and add todos

* fix lint

---------

Co-authored-by: henryruhs <info@henryruhs.com>
This commit is contained in:
Harisreedhar
2026-05-11 19:19:09 +05:30
committed by henryruhs
parent 9321b41e8e
commit ab7110eb92
5 changed files with 151 additions and 63 deletions
+13 -1
View File
@@ -17,12 +17,24 @@ def before_all() -> None:
vpx_module.pre_check()
# TODO: implement
def test_create_vpx_encoder() -> None:
pass
# TODO: rename to test_encode_vpx_buffer
def test_encode_vpx() -> None:
vision_frame = read_video_frame(get_test_example_file('target-240p.mp4'))
height, width = vision_frame.shape[:2]
vpx_encoder = create_vpx_encoder(width, height, 1000)
buffer_valid = cv2.cvtColor(vision_frame, cv2.COLOR_BGR2YUV_I420).tobytes()
buffer_invalid = bytes(0)
vpx_encoder = create_vpx_encoder(width, height, 1000)
assert encode_vpx(vpx_encoder, buffer_valid, width, height, 3, 1)
assert encode_vpx(vpx_encoder, buffer_invalid, width, height, 0, 0) == b''
# TODO: implement
def test_destroy_vpx_encoder() -> None:
pass