3

I have a lot of (20,000) TIFF images. How can I create a lossless video out of them in one of common video formats (e.g. mp4, AVI) using FFMPEG or any other tools?

I am not sure what was the framerate and it could have been variable. The capture has been done in 133MHZ but it had variable framerate.

I tried the following command on a sample of 350ish TIFF image but I am not sure how to check if the produced video is lossy or lossless. How could I check that?

$ ffmpeg -framerate 60 -i 'frame%04d.tiff'  vid.mp4
Mona Jalal
  • 4,299
  • 20
  • 64
  • 96
  • What is the color space for the TIFF files? RGB or YUV? `ffmpeg -i 'frame%04d.tiff'` will provide this info. – llogan Aug 01 '20 at 21:33

1 Answers1

2

According to the ffmpeg documentation, the H.264 codec has a lossless mode using -crf 0.

You aren't certain about the framerate so I can't offer any advice there, but you should try ffmpeg -i *.tiff -crf 0 OUT.mp4 first, then compare the size of all the images to the size of the final video. If roughly the same, that's probably good enough.

If you truly need absolute lossless output, you might be better off running a CLI script to display a (very rapid) slideshow of the images, though your hardware may not support it for large images and it is more of a wild guess than a practical solution.

Tom Brossman
  • 12,953
  • 11
  • 66
  • 134
  • how do you make sure tiff images are fed in order and order is preserved? – Mona Jalal Jul 30 '20 at 15:15
  • I believe ffmpeg will process the images based on file name, so frame0000.tiff - frame9999.tiff if your example command matches the file names. – Tom Brossman Jul 30 '20 at 17:30
  • Be careful using `*.tiff` or else it will overwrite the inputs. Add `-pattern_type glob` input option or use the sequence pattern as shown in the question. – llogan Aug 01 '20 at 21:34