1

I'm using a FLIR Boson thermal imaging camera, whose 'video' output consists of sequences of 'one-second long' multipage TIFF files.

The frame rate is variable, but averages 8.6 fps. So, each TIFF can contain up to 9 monochrome 16-bit images (example TIFF can be downloaded here).

I'd like to batch split the multipage TIFFS into individual images - firstly for processing, but also so I can create lossless videos from them (using FFMPEG).

However, I can't work out how to extract the individual frames with their timestamp intact (according to the FLIR TIFF documentation it's recorded in the metadata as Exif.Photo.DateTimeOriginal. But EXIFTool doesn't display it – see output of exiftool -a -G1 -s Boson_Capture.tiff:

[ExifTool]      ExifToolVersion                 : 12.30
[System]        FileName                        : Boson_Capture.tiff
[System]        Directory                       : .
[System]        FileSize                        : 5.6 MiB
[System]        FileModifyDate                  : 2022:05:06 16:54:24-04:00
[System]        FileAccessDate                  : 2022:05:06 19:54:06-04:00
[System]        FileInodeChangeDate             : 2022:05:06 19:54:04-04:00
[System]        FilePermissions                 : -rw-------
[File]          FileType                        : TIFF
[File]          FileTypeExtension               : tif
[File]          MIMEType                        : image/tiff
[File]          ExifByteOrder                   : Little-endian (Intel, II)
[IFD0]          ImageWidth                      : 640
[IFD0]          ImageHeight                     : 512
[IFD0]          BitsPerSample                   : 16
[IFD0]          Compression                     : Uncompressed
[IFD0]          PhotometricInterpretation       : BlackIsZero
[IFD0]          FillOrder                       : Normal
[IFD0]          StripOffsets                    : 8
[IFD0]          Orientation                     : Horizontal (normal)
[IFD0]          SamplesPerPixel                 : 1
[IFD0]          RowsPerStrip                    : 512
[IFD0]          StripByteCounts                 : 655360
[IFD0]          XResolution                     : 1
[IFD0]          YResolution                     : 1
[IFD0]          PlanarConfiguration             : Chunky
[IFD0]          ResolutionUnit                  : None
[IFD0]          PageNumber                      : 0 2
[IFD0]          Software                        : 7CTiff - FLIR Systems, Indigo Operations
[IFD0]          SampleFormat                    : Unsigned
[IFD1]          ImageWidth                      : 640
[IFD1]          ImageHeight                     : 512
[IFD1]          BitsPerSample                   : 16
[IFD1]          Compression                     : Uncompressed
[IFD1]          PhotometricInterpretation       : BlackIsZero
[IFD1]          FillOrder                       : Normal
[IFD1]          StripOffsets                    : 655662
[IFD1]          Orientation                     : Horizontal (normal)
[IFD1]          SamplesPerPixel                 : 1
[IFD1]          RowsPerStrip                    : 512
[IFD1]          StripByteCounts                 : 655360
[IFD1]          XResolution                     : 1
[IFD1]          YResolution                     : 1
[IFD1]          PlanarConfiguration             : Chunky
[IFD1]          ResolutionUnit                  : None
[IFD1]          PageNumber                      : 1 3
[IFD1]          Software                        : 7CTiff - FLIR Systems, Indigo Operations
[IFD1]          SampleFormat                    : Unsigned
[IFD2]          ImageWidth                      : 640
[IFD2]          ImageHeight                     : 512
[IFD2]          BitsPerSample                   : 16
[IFD2]          Compression                     : Uncompressed
[IFD2]          PhotometricInterpretation       : BlackIsZero
[IFD2]          FillOrder                       : Normal
[IFD2]          StripOffsets                    : 1311316
[IFD2]          Orientation                     : Horizontal (normal)
[IFD2]          SamplesPerPixel                 : 1
[IFD2]          RowsPerStrip                    : 512
[IFD2]          StripByteCounts                 : 655360
[IFD2]          XResolution                     : 1
[IFD2]          YResolution                     : 1
[IFD2]          PlanarConfiguration             : Chunky
[IFD2]          ResolutionUnit                  : None
[IFD2]          PageNumber                      : 2 4
[IFD2]          Software                        : 7CTiff - FLIR Systems, Indigo Operations
[IFD2]          SampleFormat                    : Unsigned
[IFD3]          ImageWidth                      : 640
[IFD3]          ImageHeight                     : 512
[IFD3]          BitsPerSample                   : 16
[IFD3]          Compression                     : Uncompressed
[IFD3]          PhotometricInterpretation       : BlackIsZero
[IFD3]          FillOrder                       : Normal
[IFD3]          StripOffsets                    : 1966970
[IFD3]          Orientation                     : Horizontal (normal)
[IFD3]          SamplesPerPixel                 : 1
[IFD3]          RowsPerStrip                    : 512
[IFD3]          StripByteCounts                 : 655360
[IFD3]          XResolution                     : 1
[IFD3]          YResolution                     : 1
[IFD3]          PlanarConfiguration             : Chunky
[IFD3]          ResolutionUnit                  : None
[IFD3]          PageNumber                      : 3 5
[IFD3]          Software                        : 7CTiff - FLIR Systems, Indigo Operations
[IFD3]          SampleFormat                    : Unsigned
[IFD4]          ImageWidth                      : 640
[IFD4]          ImageHeight                     : 512
[IFD4]          BitsPerSample                   : 16
[IFD4]          Compression                     : Uncompressed
[IFD4]          PhotometricInterpretation       : BlackIsZero
[IFD4]          FillOrder                       : Normal
[IFD4]          StripOffsets                    : 2622624
[IFD4]          Orientation                     : Horizontal (normal)
[IFD4]          SamplesPerPixel                 : 1
[IFD4]          RowsPerStrip                    : 512
[IFD4]          StripByteCounts                 : 655360
[IFD4]          XResolution                     : 1
[IFD4]          YResolution                     : 1
[IFD4]          PlanarConfiguration             : Chunky
[IFD4]          ResolutionUnit                  : None
[IFD4]          PageNumber                      : 4 6
[IFD4]          Software                        : 7CTiff - FLIR Systems, Indigo Operations
[IFD4]          SampleFormat                    : Unsigned
[IFD5]          ImageWidth                      : 640
[IFD5]          ImageHeight                     : 512
[IFD5]          BitsPerSample                   : 16
[IFD5]          Compression                     : Uncompressed
[IFD5]          PhotometricInterpretation       : BlackIsZero
[IFD5]          FillOrder                       : Normal
[IFD5]          StripOffsets                    : 3278278
[IFD5]          Orientation                     : Horizontal (normal)
[IFD5]          SamplesPerPixel                 : 1
[IFD5]          RowsPerStrip                    : 512
[IFD5]          StripByteCounts                 : 655360
[IFD5]          XResolution                     : 1
[IFD5]          YResolution                     : 1
[IFD5]          PlanarConfiguration             : Chunky
[IFD5]          ResolutionUnit                  : None
[IFD5]          PageNumber                      : 5 7
[IFD5]          Software                        : 7CTiff - FLIR Systems, Indigo Operations
[IFD5]          SampleFormat                    : Unsigned
[IFD6]          ImageWidth                      : 640
[IFD6]          ImageHeight                     : 512
[IFD6]          BitsPerSample                   : 16
[IFD6]          Compression                     : Uncompressed
[IFD6]          PhotometricInterpretation       : BlackIsZero
[IFD6]          FillOrder                       : Normal
[IFD6]          StripOffsets                    : 3933932
[IFD6]          Orientation                     : Horizontal (normal)
[IFD6]          SamplesPerPixel                 : 1
[IFD6]          RowsPerStrip                    : 512
[IFD6]          StripByteCounts                 : 655360
[IFD6]          XResolution                     : 1
[IFD6]          YResolution                     : 1
[IFD6]          PlanarConfiguration             : Chunky
[IFD6]          ResolutionUnit                  : None
[IFD6]          PageNumber                      : 6 8
[IFD6]          Software                        : 7CTiff - FLIR Systems, Indigo Operations
[IFD6]          SampleFormat                    : Unsigned
[IFD7]          ImageWidth                      : 640
[IFD7]          ImageHeight                     : 512
[IFD7]          BitsPerSample                   : 16
[IFD7]          Compression                     : Uncompressed
[IFD7]          PhotometricInterpretation       : BlackIsZero
[IFD7]          FillOrder                       : Normal
[IFD7]          StripOffsets                    : 4589586
[IFD7]          Orientation                     : Horizontal (normal)
[IFD7]          SamplesPerPixel                 : 1
[IFD7]          RowsPerStrip                    : 512
[IFD7]          StripByteCounts                 : 655360
[IFD7]          XResolution                     : 1
[IFD7]          YResolution                     : 1
[IFD7]          PlanarConfiguration             : Chunky
[IFD7]          ResolutionUnit                  : None
[IFD7]          PageNumber                      : 7 9
[IFD7]          Software                        : 7CTiff - FLIR Systems, Indigo Operations
[IFD7]          SampleFormat                    : Unsigned
[IFD8]          ImageWidth                      : 640
[IFD8]          ImageHeight                     : 512
[IFD8]          BitsPerSample                   : 16
[IFD8]          Compression                     : Uncompressed
[IFD8]          PhotometricInterpretation       : BlackIsZero
[IFD8]          FillOrder                       : Normal
[IFD8]          StripOffsets                    : 5245240
[IFD8]          Orientation                     : Horizontal (normal)
[IFD8]          SamplesPerPixel                 : 1
[IFD8]          RowsPerStrip                    : 512
[IFD8]          StripByteCounts                 : 655360
[IFD8]          XResolution                     : 1
[IFD8]          YResolution                     : 1
[IFD8]          PlanarConfiguration             : Chunky
[IFD8]          ResolutionUnit                  : None
[IFD8]          PageNumber                      : 8 8
[IFD8]          Software                        : 7CTiff - FLIR Systems, Indigo Operations
[IFD8]          SampleFormat                    : Unsigned
[Composite]     ImageSize                       : 640x512
[Composite]     Megapixels                      : 0.328

Everything I've tried which splits the TIFFs (e.g. ImageMagick, ImageJ) also seems to remove the metadata. Is there any way to batch split these files from the command line and keep the timestamp?

3
  • "I haven't managed to view it using EXIFTool" — what does that mean exactly? exiftool.org documents FLIR metadata, so it should be able to extract that. Please show what you've tried!
    – slhck
    Commented May 7, 2022 at 11:34
  • I've added a link to the EXIFTool output in the question - it doesn't show Exif.Photo.DateTimeOriginal. This is what I meant by not having managed to view it using EXIFTool. I'm not so experienced with EXIFTool, so wasn't sure whether it's just the way I'm using it, or that the tag isn't actually there?
    – pajul
    Commented May 7, 2022 at 15:25
  • Thanks for providing the output. Could be that the tag actually isn't there … not an expert on FLIR images, just wanted to help you add all the info to the question.
    – slhck
    Commented May 7, 2022 at 17:51

1 Answer 1

0

The file you shared does not conform to the specification you linked to.


Section 3.5 says "if it is a multi-image file, the first IFD will have a FrameRate and the remainder will not". That is not the case here, each and every IFD has exactly 18 entries, and the FrameRate tag doesn't appear in any of them.


Section 3.3.1 says "there will be private tags with values 0x8769 and 0x8825 pointing to custom IFDs". Neither of those is present. You can see that with exiftool and also list all the tags with tiffdump and neither shows those tags:

tiffdump Boson_Capture.tiff
Boson_Capture.tiff:
Magic: 0x4949 <little-endian> Version: 0x2a <ClassicTIFF>
Directory 0: offset 655368 (0xa0008) next 1311022 (0x14012e)
ImageWidth (256) SHORT (3) 1<640>
ImageLength (257) SHORT (3) 1<512>
BitsPerSample (258) SHORT (3) 1<16>
Compression (259) SHORT (3) 1<1>
Photometric (262) SHORT (3) 1<1>
FillOrder (266) SHORT (3) 1<1>
StripOffsets (273) LONG (4) 1<8>
Orientation (274) SHORT (3) 1<1>
SamplesPerPixel (277) SHORT (3) 1<1>
RowsPerStrip (278) SHORT (3) 1<512>
StripByteCounts (279) LONG (4) 1<655360>
XResolution (282) RATIONAL (5) 1<1>
YResolution (283) RATIONAL (5) 1<1>
PlanarConfig (284) SHORT (3) 1<1>
ResolutionUnit (296) SHORT (3) 1<1>
PageNumber (297) SHORT (3) 2<0 2>
Software (305) ASCII (2) 56<7CTiff - FLIR Systems, I ...>
SampleFormat (339) SHORT (3) 1<1>

... and so on for other IFDs.


If you give up on the specification being correct at all, and try and find anything that looks like a date in the format in the "EXIF Extension Section" of the linked specification:

Exif.Photo.DateTimeOriginal value 
offset  value
-----------------------------
3630 32 30 31 31 3a 30 32 3a 31 30
     20 31 34 3a 31 31 3a 32 37 00 ascii "2011:02:10 14:11:27"

You can use strings and grep like this to search for a 4-digit year followed by a colon:

strings Boson_Capture.tiff| grep -E "\d{4}:"

and again but offsetting it in case it happens to split across a line boundary:

tail -c +8 Boson_Capture.tiff | strings | grep -E "\d{4}:"

And you will find no such thing.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .