Answers.Body: <p>An AVI file is just a container and can contain any codec, so if you want to encode to QuickTime and Media player, you need to:</p>
  
  <pre><code>ffmpeg -i input.mp4 -c:v libx264 -c:a libmp3lame -b:a 384K output.avi
  </code></pre>
  
  <p>and above means:</p>
  
  <ul>
  <li>Use the h264 Codec which both QT and WPlayer can display nowadays</li>
  <li>use 384 Kbps MP3 encoding for audio</li>
  </ul>
  
  <p>don't touch anything else like frame rate, resolution, ... and copy these as is.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-02T20:15:55.670Z
Answers.LastActivityDate: 2019-06-03T19:46:37.530Z
Answers.LastEditDate: 2019-06-03T19:46:37.530Z
Answers.UserDisplayName: Fabby
Body: <p>I'm trying to convert an mp4 file to avi.
  I've tried this basic ffmpeg script:</p>
  
  <pre><code>ffmpeg -i inputFile.mp4 outputFile.avi
  </code></pre>
  
  <p>It works, but:</p>
  
  <ul>
  <li>the encoded avi file is very pixelated </li>
  <li>does not work with Quicktime Player.</li>
  </ul>
  
  <p>I've also tried using these settings (as described here: <a href="https://askubuntu.com/questions/83161/use-ffmpeg-to-transform-mp4-to-same-high-quality-avi-file">https://askubuntu.com/questions/83161/use-ffmpeg-to-transform-mp4-to-same-high-quality-avi-file</a>)</p>
  
  <pre><code>ffmpeg -i filename.mp4 -vcodec copy -acodec copy filename.avi
  </code></pre>
  
  <p>But the problem there is that the MP4 codec is just copied into an AVI wrapper, and so the resulting video won't play in Quicktime Player nor Windows Media Player.</p>
  
  <p>Can anyone suggest how to encode MP4 as AVI while still maintaining the quality and aspect ratio of the original while maintaining QuickTime compatibility?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-01-12T15:26:27.007Z
Comments.Text: Use `ffmpeg -i inputFile.mp4 -q:v 6 outputFile.avi` for better quality. Lower Q values are better but produce larger files. Are you playing in QT on Windows?
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-01-12T15:48:35.310Z
Comments.Text: @Mulvya, thank you that seems to work! We're using QT on Macs - [apparently AVI is not supported without installing Perian](https://www.google.ca/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0ahUKEwi6gMns-bzRAhUr2IMKHQF9CHwQFggfMAE&url=https%3A%2F%2Fdiscussions.apple.com%2Fthread%2F5477286%3Ftstart%3D0&usg=AFQjCNG8D4NjnmjjDe8ZkwbbbK2fc5PLTw&sig2=kDdWwXecYYrpIiXdSIdimg).
Comments.UserDisplayName: d13
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-01-12T18:02:41.333Z
Comments.Text: @d13 Why do you need AVI?
Comments.UserDisplayName: llogan
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-19T09:53:42.883Z
Comments.Text: Have you tried the answer suggested here? https://unix.stackexchange.com/questions/40321/how-get-the-best-quality-when-converting-from-mp4-to-avi-with-ffmpeg
Comments.UserDisplayName: Jim
Tags: <ffmpeg><mp4><avi>
Title: Convert mp4 to avi while keeping frame rate and quality and being able to play in QuickTime?
UserDisplayName: d13
ThreadText: # Convert mp4 to avi while keeping frame rate and quality and being able to play in QuickTime?
  
  (Asked by: username_0 on 2017-01-12)
  
  I'm trying to convert an mp4 file to avi.
  I've tried this basic ffmpeg script:
  
  ```
  ffmpeg -i inputFile.mp4 outputFile.avi
  
  ```
  
  It works, but:
  
  * the encoded avi file is very pixelated
  * does not work with Quicktime Player.
  
  I've also tried using these settings (as described here: <https://askubuntu.com/questions/83161/use-ffmpeg-to-transform-mp4-to-same-high-quality-avi-file>)
  
  ```
  ffmpeg -i filename.mp4 -vcodec copy -acodec copy filename.avi
  
  ```
  
  But the problem there is that the MP4 codec is just copied into an AVI wrapper, and so the resulting video won't play in Quicktime Player nor Windows Media Player.
  
  Can anyone suggest how to encode MP4 as AVI while still maintaining the quality and aspect ratio of the original while maintaining QuickTime compatibility?
  
  **Tags:** ffmpeg, mp4, avi
  
  > **Comments:**
  > **username_1**: Use `ffmpeg -i inputFile.mp4 -q:v 6 outputFile.avi` for better quality. Lower Q values are better but produce larger files. Are you playing in QT on Windows?  
  > **username_0**: @Mulvya, thank you that seems to work! We're using QT on Macs - [apparently AVI is not supported without installing Perian](https://www.google.ca/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0ahUKEwi6gMns-bzRAhUr2IMKHQF9CHwQFggfMAE&url=https%3A%2F%2Fdiscussions.apple.com%2Fthread%2F5477286%3Ftstart%3D0&usg=AFQjCNG8D4NjnmjjDe8ZkwbbbK2fc5PLTw&sig2=kDdWwXecYYrpIiXdSIdimg).  
  > **username_2**: @username_0 Why do you need AVI?  
  > **username_3**: Have you tried the answer suggested here? https://unix.stackexchange.com/questions/40321/how-get-the-best-quality-when-converting-from-mp4-to-avi-with-ffmpeg  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_4 on 2019-06-02. Score: 4
  
  An AVI file is just a container and can contain any codec, so if you want to encode to QuickTime and Media player, you need to:
  
  ```
  ffmpeg -i input.mp4 -c:v libx264 -c:a libmp3lame -b:a 384K output.avi
  
  ```
  
  and above means:
  
  * Use the h264 Codec which both QT and WPlayer can display nowadays
  * use 384 Kbps MP3 encoding for audio
  
  don't touch anything else like frame rate, resolution, ... and copy these as is.
  
  
  ---
  
  