<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>

CC BY-SA 4.0
2019-06-02T20:15:55.670Z
2019-06-03T19:46:37.530Z
2019-06-03T19:46:37.530Z
Fabby
<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>

CC BY-SA 3.0
2017-01-12T15:26:27.007Z
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?
Gyan
CC BY-SA 3.0
2017-01-12T15:48:35.310Z
@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).
d13
CC BY-SA 3.0
2017-01-12T18:02:41.333Z
@d13 Why do you need AVI?
llogan
CC BY-SA 3.0
2017-07-19T09:53:42.883Z
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
Jim
<ffmpeg><mp4><avi>
Convert mp4 to avi while keeping frame rate and quality and being able to play in QuickTime?
d13
# 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.


---

