Answers.Body: <p>For my use case, it was enough to do:</p>
  <blockquote>
  <p>ffmpeg -i file-with-vp9-video-and-opus-audio.webm <strong>-f mp4</strong> -vcodec copy -acodec aac_at test.mov</p>
  </blockquote>
  <p>This is cheating, really. The output isn't actually a MOV file, but rather an mp4, which uses a similar but not identical structure. Even so, it successfully coerced the program I'm using into opening the file.</p>
  <p>Notably, outputting an mp4 and changing the file extension does <em>not</em> work, so the above command is producing output that's somehow different from an actual mp4. I obviously don't understand all the intricacies of how these containers work, but it was enough for today!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-14T19:06:50.963Z
Answers.Text: I can't run this cmd successfully. I get `Could not find tag for codec pcm_s16be in stream #1, codec not currently supported in container`
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-20T20:09:20.843Z
Answers.Text: Oops! I posted this wrong the first time, I switched the audio codec to aac (since the container required it, and the audio isn't as important.)
Answers.UserDisplayName: Wowfunhappy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-14T18:54:57.800Z
Answers.LastActivityDate: 2021-01-20T20:08:22.113Z
Answers.LastEditDate: 2021-01-20T20:08:22.113Z
Answers.UserDisplayName: Wowfunhappy
Body: <p>FFmpeg has no trouble putting all sorts of weird video codecs into QuickTime/MOV containers, including <code>utvideo</code>, <code>hap</code>, <code>snow</code>, <code>ffv1</code>, and <code>cinepak</code>. This makes sense, as it is my understanding that the MOV format should be extendable to any type of video stream.</p>
  <p>However, when I ask FFmpeg to put a vp9 video stream into a MOV container, FFmpeg refuses.</p>
  <pre><code>$ ffmpeg -i file-with-vp9-video-and-opus-audio.webm -vcodec copy -acodec pcm_s16be test.mov
  
  [...]
  
  [mov @ 0x7fbb1b822400] vp9 only supported in MP4.
  Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
  </code></pre>
  <p>Due to stupid and buggy software which is out of my control, I need a way to get VP9 streams into MOV containers. I cannot use a different container format, including mp4 or mkv. (I might be able to use WebM, but that does not support PCM audio.)</p>
  <p>Is there another way to do this? It doesn't need to be with ffmpeg, but it does need to be with a UNIX program which I can automate in a shell script.</p>
  <hr />
  <p>Edit: Quick note, I'm not opposed to doing something <em>super</em> weird, like muxing into an mp4 and then hex editing the header (just as an example, I don't know if the formats are close enough for that).</p>
  <p>Which is to say, it can be a total hack. The software I'm working with will absolutely refuse to open anything that isn't a MOV, even though I have given it the capability to decode vp9.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-14T05:49:36.957Z
Comments.Text: Can you provide a link to an (pseudo-)official doc that VP9 is allowed in MOV?
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-14T06:36:25.463Z
Comments.Text: @Gyan Not explicitly, but https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFPreface/qtffPreface.html says the MOV format "can be used to describe almost any media structure" because "unknown objects can simply be ignored or skipped, allowing considerable forward compatibility as new object types are introduced." So I think the container should be "allowed" to have everything? I also find it hard to believe that Apple specifically defined support for niche formats like utvideo or magicyuv (both work), which were written relatively recently and by individuals.
Comments.UserDisplayName: Wowfunhappy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-14T11:38:02.920Z
Comments.Text: That's fine in theory, but in practice, metadata boxes including codec config/tags have to be written when muxing a track. Those can't be ad-hoc. We'll want either an official-ish spec or some specimen files with such streams generated by prominent apps, preferably by Apple.
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-14T12:07:01.093Z
Comments.Text: VP9 is not supported by QTFF (see 2nd table at https://en.wikipedia.org/wiki/Comparison_of_video_container_formats).
Comments.UserDisplayName: Matt
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-14T14:35:13.717Z
Comments.Text: Thanks all. Even if it's not official, I still would like a way to force it in there! Otherwise I'm forced to transcode the stream.
Comments.UserDisplayName: Wowfunhappy
Tags: <ffmpeg><software-recommendation><codec>
Title: How can I put a VP9 video stream into a QuickTime/MOV container?
UserDisplayName: Wowfunhappy
ThreadText: # How can I put a VP9 video stream into a QuickTime/MOV container?
  
  (Asked by: username_0 on 2021-01-13)
  
  FFmpeg has no trouble putting all sorts of weird video codecs into QuickTime/MOV containers, including `utvideo`, `hap`, `snow`, `ffv1`, and `cinepak`. This makes sense, as it is my understanding that the MOV format should be extendable to any type of video stream.
  
  However, when I ask FFmpeg to put a vp9 video stream into a MOV container, FFmpeg refuses.
  
  ```
  $ ffmpeg -i file-with-vp9-video-and-opus-audio.webm -vcodec copy -acodec pcm_s16be test.mov
  
  [...]
  
  [mov @ 0x7fbb1b822400] vp9 only supported in MP4.
  Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
  
  ```
  
  Due to stupid and buggy software which is out of my control, I need a way to get VP9 streams into MOV containers. I cannot use a different container format, including mp4 or mkv. (I might be able to use WebM, but that does not support PCM audio.)
  
  Is there another way to do this? It doesn't need to be with ffmpeg, but it does need to be with a UNIX program which I can automate in a shell script.
  
  ---
  
  Edit: Quick note, I'm not opposed to doing something *super* weird, like muxing into an mp4 and then hex editing the header (just as an example, I don't know if the formats are close enough for that).
  
  Which is to say, it can be a total hack. The software I'm working with will absolutely refuse to open anything that isn't a MOV, even though I have given it the capability to decode vp9.
  
  **Tags:** ffmpeg, software-recommendation, codec
  
  > **Comments:**
  > **username_1**: Can you provide a link to an (pseudo-)official doc that VP9 is allowed in MOV?  
  > **username_0**: @username_1 Not explicitly, but https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFPreface/qtffPreface.html says the MOV format "can be used to describe almost any media structure" because "unknown objects can simply be ignored or skipped, allowing considerable forward compatibility as new object types are introduced." So I think the container should be "allowed" to have everything? I also find it hard to believe that Apple specifically defined support for niche formats like utvideo or magicyuv (both work), which were written relatively recently and by individuals.  
  > **username_1**: That's fine in theory, but in practice, metadata boxes including codec config/tags have to be written when muxing a track. Those can't be ad-hoc. We'll want either an official-ish spec or some specimen files with such streams generated by prominent apps, preferably by Apple.  
  > **username_2**: VP9 is not supported by QTFF (see 2nd table at https://en.wikipedia.org/wiki/Comparison_of_video_container_formats).  
  > **username_0**: Thanks all. Even if it's not official, I still would like a way to force it in there! Otherwise I'm forced to transcode the stream.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-01-14. Score: 2 | Accepted answer
  
  For my use case, it was enough to do:
  
  > ffmpeg -i file-with-vp9-video-and-opus-audio.webm **-f mp4** -vcodec copy -acodec aac\_at test.mov
  
  This is cheating, really. The output isn't actually a MOV file, but rather an mp4, which uses a similar but not identical structure. Even so, it successfully coerced the program I'm using into opening the file.
  
  Notably, outputting an mp4 and changing the file extension does *not* work, so the above command is producing output that's somehow different from an actual mp4. I obviously don't understand all the intricacies of how these containers work, but it was enough for today!
  
  > **Comments:**
  > **username_1**: I can't run this cmd successfully. I get `Could not find tag for codec pcm_s16be in stream #1, codec not currently supported in container`  
  > **username_0**: Oops! I posted this wrong the first time, I switched the audio codec to aac (since the container required it, and the audio isn't as important.)  
  
  ---
  
  