Skip to content

Commit

Permalink
Change video saving in plotting function to higher quality
Browse files Browse the repository at this point in the history
  • Loading branch information
frankong committed Jul 7, 2019
1 parent d7f865c commit e17fabd
Showing 1 changed file with 20 additions and 30 deletions.
50 changes: 20 additions & 30 deletions sigpy/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,21 +325,16 @@ def key_press(self, event):
format='png', bbox_inches=bbox, pad_inches=0)

subprocess.run(['ffmpeg',
'-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),
'-vf',
"scale=trunc(iw/2)*2:trunc(ih/2)*2",
'-vcodec',
'libx264',
'-pix_fmt',
'yuv420p',
'-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),
'-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 Expand Up @@ -739,21 +734,16 @@ def key_press(self, event):
format='png', bbox_inches=bbox, pad_inches=0)

subprocess.run(['ffmpeg',
'-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),
'-vf',
"scale=trunc(iw/2)*2:trunc(ih/2)*2",
'-vcodec',
'libx264',
'-pix_fmt',
'yuv420p',
'-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),
'-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 e17fabd

Please sign in to comment.