better error handling when reading original frame
add option to specify name of output file
add option for verbose messages, do not print bitmasks by default