Answers.Body: <p>According to <a href="https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Containers" rel="nofollow noreferrer">Mozilla Developers</a> MPEG-4 containers can include FLAC audio.  Ditto for OGG containers.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-05T18:30:01.243Z
Answers.LastActivityDate: 2022-06-05T18:30:01.243Z
Answers.UserDisplayName: user38574
Answers.Body: <p>To my knowledge, the only lossless audio format with really wide compatibility is plain old <strong>linear PCM</strong>.
  As container format, MP4 is the most wide-spread.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-29T16:52:59.950Z
Answers.LastActivityDate: 2023-06-29T16:52:59.950Z
Answers.UserDisplayName: soundflix
Answers.Body: <p>The MP4 container officially supports the Apple Lossless Audio Codec (ALAC). Doesn't mean it's supported by other software, though.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-29T17:35:44.033Z
Answers.LastActivityDate: 2023-06-29T17:35:44.033Z
Answers.UserDisplayName: damian101
Body: <p>I'm a software developer. My software produces animated video files with music.</p>
  <p>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.</p>
  <p>For the longest time I wrote <strong>AVI</strong> 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.</p>
  <p><strong>MP4</strong> 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.</p>
  <p><strong>MKV</strong> files support WAV audio, but are unsupported by Sony Vegas.</p>
  <p><strong>What container format and audio codec</strong> should I pick for wide compatibility and lossless audio? I'm using ffmpeg, so I have the ability to produce almost any format.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-10-08T15:49:02.527Z
Comments.Text: So, it has to be readable by Vegas and Youtube? Looks like Vegas will be the limiting factor here. Ask in their forums. My guess is, MOV container with ALAC or FLAC audio. Certainly MOV with PCM audio.
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-10-15T03:13:53.097Z
Comments.Text: I know you have your reasons, but AAC at 320 or 384 kbps, sampled at 48K, is indistinguishable from WAV in any real world setting. And it's widely compatible.
Comments.UserDisplayName: Jim Mack
Tags: <ffmpeg><codec><mp4><mkv><avi>
Title: Widely compatible video format with lossless audio
UserDisplayName: LTR
ThreadText: # Widely compatible video format with lossless audio
  
  (Asked by: username_0 on 2020-10-08)
  
  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.
  
  **Tags:** ffmpeg, codec, mp4, mkv, avi
  
  > **Comments:**
  > **username_1**: So, it has to be readable by Vegas and Youtube? Looks like Vegas will be the limiting factor here. Ask in their forums. My guess is, MOV container with ALAC or FLAC audio. Certainly MOV with PCM audio.  
  > **username_2**: I know you have your reasons, but AAC at 320 or 384 kbps, sampled at 48K, is indistinguishable from WAV in any real world setting. And it's widely compatible.  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_3 on 2022-06-05. Score: 1
  
  According to [Mozilla Developers](https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Containers) MPEG-4 containers can include FLAC audio. Ditto for OGG containers.
  
  
  ---
  
  ### Answer by username_4 on 2023-06-29. Score: 1
  
  To my knowledge, the only lossless audio format with really wide compatibility is plain old **linear PCM**.
  As container format, MP4 is the most wide-spread.
  
  
  ---
  
  ### Answer by username_5 on 2023-06-29. Score: 0
  
  The MP4 container officially supports the Apple Lossless Audio Codec (ALAC). Doesn't mean it's supported by other software, though.
  
  
  ---
  
  