Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python/example: use yuv420p8 for encode #716

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions python/example/st20p_rx_encode.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
def main():
args = misc_util.parse_args(False)

mtl_output_fmt = mtl.ST_FRAME_FMT_YUV422PLANAR8
av_pixel_input_format = "yuv422p"
mtl_output_fmt = mtl.ST_FRAME_FMT_YUV420PLANAR8
av_pixel_input_format = "yuv420p"

output_file = args.rx_url

Expand Down Expand Up @@ -89,8 +89,8 @@ def main():
ptr = (ctypes.c_ubyte * p_size).from_address(
mtl.st_frame_addr_cpuva(frame, plane)
)
y = np.ctypeslib.as_array(ptr, (p_size,))
video_frame.planes[plane].update(y)
p = np.ctypeslib.as_array(ptr, (p_size,))
video_frame.planes[plane].update(p)

for packet in h264_stream.encode(video_frame):
h264.mux(packet)
Expand Down