Same logic as used for Webm and Theora support in #19937 and #21084, fixing issues when exporting projects.