I'm a software developer. My software produces animated video files with music.
The video files should be compatible with a wide range of software, and they should have excellent audio quality. The audio that users load into the program might have been encoded twice already, and the resulting video will be encoded one more time when uploading to YouTube. So I'd like to let my software output uncompressed audio into the video file.
For the longest time I wrote AVI files with WAV audio. Unfortunately, this format suffers from compatibility problems. Some versions of Sony Vegas cannot open it, same problem with some versions of Premiere.
MP4 files should be compatible with a wide range of software - unfortunately, there doesn't seem to be a widely supported way for MP4 files to contain lossless audio. Most common seems to be AAC audio, which is transparent at 320kbps - but I'd like to avoid that additional lossy step for reasons mentioned above.
MKV files support WAV audio, but are unsupported by Sony Vegas.
What container format and audio codec should I pick for wide compatibility and lossless audio? I'm using ffmpeg, so I have the ability to produce almost any format.