Skip to content

Commit

Permalink
Change video encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
frankong committed Sep 10, 2019
1 parent 8e290b8 commit cecb033
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions sigpy/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,16 @@ def key_press(self, event):
format='png', bbox_inches=bbox, pad_inches=0)

subprocess.run(['ffmpeg',
'-framerate', str(self.fps),
'-f', 'image2',
'-s', '{}x{}'.format(
int(bbox.width * self.fig.dpi),
int(bbox.height * self.fig.dpi)),
'-r', str(self.fps),
'-i', '{} %05d.png'.format(temp_basename),
'-vcodec', 'png',
'-vf', 'scale=trunc(iw/2)*2:trunc(ih/2)*2',
'-vcodec', 'libx264',
'-preset', 'veryslow',
'-pix_fmt', 'yuv420p',
filename])

for i in range(self.shape[self.d]):
Expand Down

0 comments on commit cecb033

Please sign in to comment.