move track timescale/sampleDuration init to write_header and return error if not set