1

I am trying to convert a .avi file into a .mp4 one using FFMPEG using the libx264 codec.

This is the command I am running:

ffmpeg -i filename.avi -c:v libx264 -crf 19 -strict experimental filenameAvi.mp4 

I sometimes get the following error:

[libx264 @ 0x85b460] height not divisible by 2 (176x99)

I used the following answer:

https://stackoverflow.com/questions/20847674/ffmpeg-libx264-height-not-divisible-by-2

and modified the command accordingly as follows:

ffmpeg -i filename.avi -c:v libx264 -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -crf 19 -strict experimental filenameAvi.mp4 

For the same file what now happens is it hangs up after a couple of frames. I have not much idea about ffmpeg, kindly suggest how to solve this. Fscreenshot

phuclv
  • 30,396
  • 15
  • 136
  • 260

1 Answers1

1

I do have same problem.

Step1: change resolution of your .avi file

ffmpeg -i filename.avi -vf "scale=176:98" filename1.avi

Step2: convert .avi to .mp4

ffmpeg -i filename1.avi filename.mp4

That works for me