Hey,
I’m having quite a bit of trouble getting the colour space correct when converting from DNxHD to PNG. Here the code;
[code]import sys
import os
import Draft
from DraftParamParser import *
The argument name/types we’re expecting from the command line arguments
expectedTypes = dict()
expectedTypes[‘inFile’] = ‘’ # expects a path like “path/movie.mov”
expectedTypes[‘outFile’] = ‘’ # expects a path like “path/image.####.jpeg”
expectedTypes[‘sourceIn’] = ‘’ # expects a frame number
expectedTypes[‘sourceOut’] = ‘’ # expects a frame number
expectedTypes[‘colourSpace’] = ‘’ # expects a frame number
Parse the command line arguments
params = ParseCommandLine(expectedTypes, sys.argv)
in_file = params[‘inFile’]
out_file = params[‘outFile’]
source_in = int(params[‘sourceIn’])
source_out = int(params[‘sourceOut’])
colour_space = params[‘colourSpace’]
colour = None
if colour_space == ‘rec709’:
colour = Draft.LUT.CreateRec709()
Main encoding loop
decoder = Draft.VideoDecoder(in_file)
frame = Draft.Image.CreateImage(1, 1)
for count in range(source_in, source_out + 1):
decoder.DecodeFrame(count, frame)
f = ReplaceFilenameHashesWithNumber(out_file, count)
frame.WriteToFile(f)
[/code]
Should it not just be a straight forward transcode?