Web Projects Outsourcing

Fixing Wrong or Different Frame Rate of a Video File and Container (The Right Way)

The problem is seen well when you get video file information with ffmpeg:

ffmpeg -i [bad_file].avi

It will show something like:

Seems stream 0 codec frame rate differs from container frame rate: 30000.00 (30000/1) -> 25.00 (25/1)
Input #0, avi, from '[bad_file].avi':
Duration: 01:06:42.20, start: 0.000000, bitrate: 1466 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 608x320 [PAR 1:1 DAR 19:10], 25.00 tb(r)
Stream #0.1: Audio: mp3, 44100 Hz, stereo, s16, 160 kb/s

The files like the above do not play at my WDTV device and re-encoding them in a normal way with Avidemux or HandBrake leads to some funny results.

To salvage files like these get HandBrake, install it and run opening a bad file or DVD.

Most important settings are in red:

Fixing Wrong or Different Frame Rate

Frame rate fix

Fixing Wrong or Different Frame Rate

Audio

Fixing Wrong or Different Frame Rate

Picture settings

My x.264 settings:

Fixing Wrong or Different Frame Rate

x264 settings

Save as template. Enjoy.

P.S. You might want to remux the resulting m4v file to mkv with mkvmerge to support rewinds in WDTV.

2 thoughts on “Fixing Wrong or Different Frame Rate of a Video File and Container (The Right Way)

  1. Alec

    At least, everything I was trying at the time of writing of this post did not work. Should you find your own way with the command line, I would be glad to have it in under this post.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.