Skip to content

Commit

Permalink
renew video
Browse files Browse the repository at this point in the history
  • Loading branch information
huangzhengxiang committed Jun 6, 2023
1 parent 634c78f commit 670af7d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions convert.py
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")
Binary file modified video/Ant-v2/DDPG.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 670af7d

Please sign in to comment.