Skip to content

Commit

Permalink
python/example: use yuv420p8 for encode (#716)
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Du <frank.du@intel.com>
  • Loading branch information
frankdjx authored Jan 22, 2024
1 parent feb046b commit 512772b
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 512772b

Please sign in to comment.