Archive for January, 2009

Problems after updating ffmpeg and libmp3lame

Saturday, January 31st, 2009

Once in a while I fire ‘yum update’ to download and install new updates for software running on my CentOS box. Besides the default CentOS repository I also use the ATrpms repository. The ATrpms repository supplies many packages, including ffmpeg and lame.

After updating to the latest lame release supplied by ATrpms (lame-3.98.2-19.1.el5.i386.rpm) I ran into problems using ffmpeg. When using ffmpeg together with the libmp3lame to encode audio, the following error message shows:

[libmp3lame @ 0xe84840]lame: output buffer too small (buffer index:
7905, free bytes: 735)

To fix this problem you should downgrade to version 3.97-16.0 like this:

# wget http://dl.atrpms.net/all/lame-3.97-16.0.el5.i386.rpm
# wget http://dl.atrpms.net/all/libmp3lame0-3.97-16.0.el5.i386.rpm
# rpm -hUv --oldpackage libmp3lame0-3.97-16.0.el5.i386.rpm  lame-3.97-16.0.el5.i386.rpm
Preparing...                ########################################### [100%]
   1:libmp3lame0            ########################################### [ 50%]
   2:lame                   ########################################### [100%]

To prevent updating libmp3lame0 and lame again when running ‘yum update’, be sure to edit /etc/yum.conf and exclude these packages. Add the following line:

exclude=lame* libmp3lame*

Have fun and happy encoding!

Transcoding DVB to DIVX

Sunday, January 4th, 2009

In my post about CentOS and DVB-T I talk about transcoding a recorded dvb-t (MPEG2) stream to divx using mencoder. While mencoder can do that job, I experience problems keeping audio and video in sync. The past weeks I have been trying to fix this problem with mencoder. I’ve been tweaking with the -audio-delay option and some others, but the results didn’t satisfy me.

Luckily I found an alternative that works far more easier and has no problem keeping video and audio in sync. So while still using mencoder to record the initial dvb-t stream, I use ffmpeg to transcode the recorded dvb-t stream to divx. The following command I use to transcode the dvb-t stream using ffmpeg:

ffmpeg -i dvbtstream.ts -vtag DIVX -f avi -vcodec mpeg4 -aspect 16:9 -s 640x368 -b 1000000 -acodec libmp3lame -ab 160000 -ar 48000 -ac 2 dvbtstream.avi

Another useful utility I started using is avisplit. After transcoding the dvb-t stream to divx, I use avisplit to remove for example the commercials. The following command removes the commercials in the beginnen and the end of the program that has been recorded.

avisplit -i dvbtstream.avi -c -o Final-Program.avi -t 00:07:57-01:32:49

UPDATE: Besides avisplit you can also use mencoder.

mencoder -ss 00:07:57 -endpos 01:32:49 -ovc copy -oac copy dvbstream.avi -o Final-Program.avi

Hope you’ll find this post useful ;-)