2

I am using this script to convert an avi file into a mp4 file

ffmpeg -i video.avi video.mp4

The resulting file I got is encoded using H264 but the video is flawed.

What am I doing wrong? I would like the resulting video to be encoded a good codec that is widely spread.

Does this defect have a name? Also I can't upload the video on Twitter, why is that?

andrew.46
  • 37,085
  • 25
  • 149
  • 228
Joe Jobs
  • 139
  • 2
  • 7
  • 2
    Does this answer your question? [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). Opposite direction but the process is the same. `ffmpeg` has a lot of different options for various tasks. When in doubt, consult the [documentation](https://ffmpeg.org/documentation.html) – Nmath Dec 16 '21 at 03:35
  • 1
    Input and output files look ok to me, perhaps try a more embellished command line: `ffmpeg -i Counter-AVI.avi -c:v libx264 -preset slow -crf 16 test.mp4` – andrew.46 Dec 17 '21 at 02:31

1 Answers1

2

MPEG-4 is still currently the most universally compatible and widespread codec, Instead of using H.264 codec

Execute:

ffmpeg -i video.avi -c:v mpeg4 video.mp4

This will specify "MPEG-4 Video (Simple Profile)" codec instead of "H.264 (High 4:4:4 Profile)".

stumblebee
  • 2,963
  • 3
  • 16
  • 31