


'-filter_complex', # Cut frames into tiles and rearrange (here: 7 horizontal tiles) '-pix_fmt', 'rgb32', # Use RGB32 pixel format matching MatPlotLib image output '-vf', 'pad=ceil(iw/2)*2:ceil(ih/2)*2', # Pad frames to even pixel numbers (required by many codecs) '-i', os.path.join(frames_renamed_path, 'frame%05d.png'), # Path to input frames '-hwaccel', 'cuda', # Use GPU acceleration '-report', # Write logfile to current working directory '-y', # Overwrite output files without asking Os.chdir(frames_renamed_path) # Temporarily change current working directory The frames are very narrow and high, so I'd like to cut them vertically into seven equal-sized "tiles" using crop and stacked those "tiles" horizontally using hstack, but I'm getting only getting cryptic error messages: ffmpeg_path = notebook_directory # Make sure ffmpeg.exe is in notebook directory!įrames_path = 'C:\\Users\\Username\\Desktop'įrames_renamed_path = os.path.join(frames_path, 'renamed')

I want to use ffmpeg with Python in a Jupyter notebook to create a video from 2000 PNG image files generated by matplotlib.
