-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
huangzhengxiang
committed
Jun 6, 2023
1 parent
634c78f
commit 670af7d
Showing
2 changed files
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import imageio | ||
import cv2 | ||
|
||
video_path="video\Ant-v2\DDPG.mp4" | ||
content=imageio.get_reader(video_path,"MP4") | ||
frames = [] | ||
for j in range(600): | ||
try: | ||
frame = content.get_next_data() | ||
frame = cv2.resize(frame,(800,400)) | ||
frames.append(frame) | ||
except IndexError: | ||
break | ||
imageio.mimwrite(video_path.replace("mp4","gif"),frames,"GIF") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.