Updated: Wed Mar 10, 2010 (05:00), A PHP / MySQL professional (10 yrs.exp.) is seeking employment outside Ukraine, CV and contact pages available at this site.

Welcome!

Contains materials for dummies This blog is for Linux dummies as just I am.

This blog contains various solutions and how-toes on the current release of Fedora Linux distribution and several Linux articles and tutorials.

View a PHP / MySQL / AJAX / JAVASCRIPT Freelancer Programmer profile on LinkedIn Follow me on twitter

Fedora Availability

Historically Test and General Availability releases happen at 10:00am Eastern US Time...

Announcement

A php/mysql freelancer programmer since 2001 is looking for contract work. Please use contact form at this page.

The full resume with examples of PHP/MySQL/Javascript projects, working experience and recommendations is available online from this page.

Get ioncube encoder

Ioncube encoder is the best solution for php developers

Ioncube encoder is the best solution for a php developer

Path: Blog > Linux > Audio Encoding > Fixing Wrong or Different Frame Rate of a Video File and Container

Fixing Wrong or Different Frame Rate of a Video File and Container

WARNING!
This article is deprecated.
A newer article either has been already published or is going to be published within the nearest days.

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 I take the following steps (though there is a zillion ways if doing that better than me).

1. Rip audio

mplayer [BAD_SOURCE].avi -ao pcm:fast:file=audio.wav -vc null -vo null

2. Encode audio (I prefer AAC encoder from Nero):

neroAacEnc -if audio.wav -q .5 -ignorelength -of audio.m4a

3. Rip and encode video with ffmpeg (I prefer x264 codec):

ffmpeg -i [BAD_SOURCE].avi -vcodec libx264 -b 1400000 -sameq -an video.m4v

Hint: choose a 15-20% lower bitrate than original (in our case above: -b 1400000).

4. Mux together into a nice matroska file

mkvmerge -o [GOOD_OUTPUT].mkv  -d 1 -A -S video.m4v -a 1 -D -S audio.m4a --track-order 0:1,1:1

5. Cleanup

rm -f [BAD_SOURCE].avi video.m4v audio.m4a

Enjoy. And please do not use packed bitstream any more, it’s ugly.

Support this site:        

Leave a comment

You must be logged in to post a comment.

Get a Free Web Project Quote from a PHP Freelancer Consultant


 
 
 
 

Fight Spam!   Add to Technorati Favorites Programming Blogs - BlogCatalog Blog Directory       Programming Blog Directory
Software   Top Blogs

blogarama - the blog directory