update write_video with ffmpeg
This commit is contained in:
1 parent
4d4015350c
commit
0d5689979f
8 files changed
+186
-173
No files matched your search
+1
-3
@@ -31,7 +31,6 @@ def save_animation(data_motion, path_save, suffix, w=128*5, h=72*5, dpi=80):
|
||||
animation.write_videofile(str(ipath_save), fps=fps, logger=None)
|
||||
|
||||
|
||||
|
||||
def save_animation_ws_audio(data_motion, path_save, path_audio=None, start_time=None, end_time=None, fps=30, w=256, h=256, dpi=150):
|
||||
""" convert data_motion to .mp4 animation
|
||||
data_motion, shape [nsteps, 136]
|
||||
@@ -207,7 +206,7 @@ def write_video_with_gt(images_pt, images_gt, raw_speech, path_video, fps=50, sr
|
||||
writer = cv2.VideoWriter(file_video.name, cv2.VideoWriter_fourcc(*'mp4v'), fps, (2*W, H), True)
|
||||
|
||||
for i in range(num_frame):
|
||||
concate_image = np.concatenate((images_pt[i], images_gt), axis=1) # (H, 2*W, 3)
|
||||
concate_image = np.concatenate((images_pt[i], images_gt[i]), axis=1) # (H, 2*W, 3)
|
||||
writer.write(concate_image)
|
||||
|
||||
# close
|
||||
@@ -308,7 +307,6 @@ def save_animation_with_gt2(images_pt, images_gt, path_save, fps=None, path_audi
|
||||
animation.close()
|
||||
|
||||
|
||||
|
||||
def save_animation_with_gt(data_motion, data_motion_gt, path_save, suffix, w=128*5, h=72*5, dpi=80, maxsave=3, fps=30):
|
||||
""" convert data_motion to .mp4 animation
|
||||
data_motion, shape [B, N, 68, 2]
|
||||
|
||||
Reference in new issue
Block a user