[FFmpeg-user] Interlaced avi h264 to mp4

pssturges pssturges at gmail.com
Tue Jul 5 12:54:00 CEST 2011


I have many avi's that are mostly encoded from pal dvd's. They were encoded
using ffmpeg, although I don't recall the precise command I used as it was
some time ago. I don't think they were de-interlaced during encoding. The
video is encoded as h264 with the original ac3 soundtrack. I have been
playing them very effectively through xbmc on my HDTV for some time. I would
now like to make them iOS compatible by putting them in mp4 containers and
adding an aac audio track as the first audio track. I'm trying to avoid
having to re-encode so that it can be done quickly and without loss of video

So far I've come up with the following ffmpeg command:

ffmpeg -i video.avi -vcodec copy -acodec libfaac -ac 2 -ab 160k video.m4v
-acodec copy -newaudio

This produces a valid mp4 file, however when watched on an ipad, the video
shakes and wobbles when there is movement. When watched on xbmc, the effect
is far less severe. When xbmc de-interlacing is set to auto, movement
somehow looks 'harsh'. When I set it to bob, it looks great. I have tried
demuxing and remuxing with mp4box and the video plays perfectly on both the
ipad and xbmc, but the audio is always out of sync.

Firstly, is there a way to confirm if the videos are in fact, interlaced?

'My Theory'
My thought at the moment is that there should be some sort of flag in the
MP4 container or the video stream specifying that the video is interlaced so
that the player knows to handle it correctly. I suspect at the moment this
flag isn't being set correctly. Does this sound like it could be the issue?

If this is the problem, can it be corrected during the conversion or after
by modifying the mp4? Or even by rectifying the original avi?

Perhaps the problem is totally different?

Any help much appreciated,

View this message in context: http://ffmpeg-users.933282.n4.nabble.com/Interlaced-avi-h264-to-mp4-tp3645627p3645627.html
Sent from the FFmpeg-users mailing list archive at Nabble.com.

More information about the ffmpeg-user mailing list