[v2.0-alpha11] Change JPEG sampling factor from 4:4:4 to 4:2:0 (common sub-sampling in MP4)

This commit is contained in:
2024-07-03 01:53:02 +02:00
parent 8579b26955
commit 0cb9d1e877

View File

@@ -513,7 +513,7 @@ try:
image_name = "{}_f{}.jpg".format(video_file_name.split('.')[0], frame_name) image_name = "{}_f{}.jpg".format(video_file_name.split('.')[0], frame_name)
image_path = "{}/{}".format(output_folder, image_name) image_path = "{}/{}".format(output_folder, image_name)
cv2.imwrite(image_path, frame, [cv2.IMWRITE_JPEG_QUALITY, 88, cv2.IMWRITE_JPEG_PROGRESSIVE, 1, cv2.IMWRITE_JPEG_SAMPLING_FACTOR, 0x111111]) cv2.imwrite(image_path, frame, [cv2.IMWRITE_JPEG_QUALITY, 88, cv2.IMWRITE_JPEG_PROGRESSIVE, 1, cv2.IMWRITE_JPEG_SAMPLING_FACTOR, 0x221111])
# Time tags formatting # Time tags formatting
time_shift = i * frame_sampling time_shift = i * frame_sampling