Monday, 4 May 2009

Tip of the Day: Convert OGV to FLV Using ffmpeg

In today's tip of the day I'll show how to easily convert an OGV (Theora video) file to FLV (Flash video), for uploading to YouTube or other websites. You will need the ffmpeg audio and video encoder.
To convert an OGV file created by recordMyDesktop for example, all you have to do is issue a command like this:

ffmpeg -i input_file.ogv output_file.flv

You can shrink the size of the output file using something like this:

ffmpeg -i input_file.ogv -s 640x512 output_file.flv

This also reduces the size of the Flash video file.

To select a certain audio codec you can use something which goes like this:

ffmpeg -i input_file.ogv -acodec libmp3lame output_file.flv


KPeter said...

Youtube accepts the .ogv file to uploading, no need convert to .flv

sorry my english is too bad.

Erick said...

KPeter indeed it does, but not all are well uploaded, I recorded a video from RecordmyDesktop and uploaded it , it doesnt decode it good. :S... u see a lot of squares :O

SEIBON Carbon Fiber Hoods said...

When I try ffmpeg or winff to convert a file from GTKrecordMyDesktop it always comes out funky. It's like gray with rainbow pixelation. The sound is there but it doesn't look right, you can hardly make out the shapes. It seems like there is either a bug with ffmpeg or maybe and encoding bug with GTKrecordMyDesktop. Or maybe it's that I need to install an additional codec or something, I already installed ubuntu extras. Not quite sure what to use at this point. OS is Ubuntu x64 10.04, and I'm converting the OGV because youtube displays it the same way, all funky when I upload it.

Gustavo Moreira said...

I use 'mencoder' for the job:
"mencoder -of lavf -oac mp3lame -lameopts abr:br=56 -srate 22050 -ovc lavc -lavcopts vcodec=flv:vbitrate=250:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -vf scale=640:480 -o outputmovie.flv sourcemovie.ogv"
works like a charm =).

Anonymous said...

THX Gustavo. Your post was my last solution to get correct -flv-Files. ffmpeg doesn't work.