Three things come to mind…
When ffmpeg makes a Matroska file, it defaults the write_crc32
option to True. Check out ffmpeg -h muxer=matroska
to see the defaults of all options. Anyhow, reading and writing that checksum is a huge computational overhead that AVI files do not have. That’s part of the speed difference between MKV and AVI. I haven’t checked if this option can be turned off through Shotcut’s Export > Advanced > Other tab, but if it can, it’s totally worth adding to the HuffYUV preset. (For people that want the checksum for archival purposes, FFV1 may be a better option for archive anyway.)
Second, although AVI is usually slightly faster than MKV even with write_crc32
turned off, AVI is still scary because it loses a lot of valuable functionality. AVI as a container does not have flags for holding stream metadata like color space and color range. If a codec doesn’t specify the color range itself (which I’m pretty sure HuffYUV does not), then Shotcut has to guess those settings, and that’s where color shifting problems start. Meanwhile, Matroska does have flags to properly record all metadata.
Thirdly, FLAC is indeed a less-than-ideal format for real-time playback of multiple streams. It is extremely CPU-heavy as far as audio codecs go. Personally, I don’t understand the value of compressing audio streams during the edit phase when the video streams they’re paired to are orders of magnitude larger in size. I could see using FLAC for the master or an archive copy (which again would make more sense paired with the FFV1 export preset rather than HuffYUV). Your switch to PCM during editing was a good move. That’s what I use for all my intermediates and proxies. AC-3 could be a good alternative if space is really that big a deal.