to_vid#

Convert all the image sequence in a given folder to videos (avi). It is a wrapper of ffmpeg, which is a prerequisite of this script. Videos will be saved in the parent folder of the image sequence folder.

Syntax

python to_vid.py folder [fmt=%05d.tif] [fps=50]
  • folder – the folder that contains the 8-bit tif image sequence, this script convert all 8-bit image sequences in given folder by default

  • fmt – specify the format of image file name, default to %05d.tif

  • fps – specify the frame rate of the output video, default to 50

Edit

  • Nov 24, 2021 – initial commit.

  • Nov 26, 2021 – Major change: now convert all the 8-bit folder in given folder to videos Change name to to_vid.py

  • Dec 08, 2021 – Check if the target .avi file exists already. If so, skip the conversion.

  • Jan 05, 2023 – Adapt myimagelib import style.

  • Feb 08, 2023 – Rewrite in function wrapper form, to make autodoc work properly. (autodoc import the script and execute it, so anything outside if __name__=="__main__" will be executed, causing problems)

  • Oct 04, 2024 – Add argument parser to make it more user-friendly. Only convert one video now, instead of all videos in the folder.

  • Oct 17, 2024 – Add a filter to ensure the dimensions are divisible by 2.