Search code examples
openimageio

oiiotool to process a MOV input file


Is it possible to use oiio tool to convert a mov to a sequence of images? There is a way to extract a single frame (--subimage) but this gets very slow for longer QTs (more than 2000 frames). Since it can extract one frame there should be a way to tell it to extract all to a sequence but so far I failed to find the right syntax. -a instead of -i looks promising as it should process all subimages but then there seems to be no valid syntax to specify a sequence for the output.

oiiotool -a "input.mov" --colorconvert "Output - sRGB" "ACES - ACEScct" --resize 1920x0 --ch R,G,B --compression jpeg:90 --colorconvert "ACES - ACEScct" "Output - sRGB" -o c:\temp\__jpgs\output.####.jpg

I'm trying to avoid going through ffmpeg before using oiio for colour handling but that seems to be not supported.


Solution

  • What you want here is to use the -sisplit command (split the subimages of the big multi-image file into separate images, after doing the color correction and resize) and the "all=1" modifier to the -o command:

    oiiotool -a "input.mov" --colorconvert "Output - sRGB" "ACES - ACEScct" --resize 1920x0 --ch R,G,B --compression jpeg:90 --colorconvert "ACES - ACEScct" "Output - sRGB"  -sisplit -o:all=1 c:\temp\__jpgs\output.%04d.jpg
    

    note the slightly different notation used to format the frame number that is specific to the -o:all=1 situation.

    I'm a little worried about the efficiency of doing the color conversions and rescale of all the frames and keeping them in memory, before outputting them all at once at the end. It may be better to break it up into two steps:

    oiiotool input.mov --sisplit -o:all=1 "tmp.%04d.tif"
    oiiotool tmp.####.tif --colorconvert "Output - sRGB" "ACES - ACEScct" --resize 1920x0 --ch R,G,B --compression jpeg:90 --colorconvert "ACES - ACEScct" "Output - sRGB"  -o output.####.jpg
    

    (note that the wildcards in the input of the second command implies a loop, and the set of input files it finds will tell it the frames to loop over)

    I'm honestly not sure if this will be an improvement. You should try both ways and see which is more efficient.