At a glance Main Projects Tutorials Resume



ffmpeg setting keyframes

Wed, 20 Aug 2008 22:44:06 EST

At work, we routinely use ffmpeg for conversion of various video formats into flv. Recently, one of the things we wanted to do was manually set the keyframes. If you search for the command line switch that is used to set keyframes, then you will get a lot of odd results that won't work.

After a little research, it turns out that ffmpeg refers to keyframes as GOP or group of pictures. You can set the keyframe encoding rate simply by using the command line switch -g. So in order to convert an uncompressed .mov file into a flv of the same quality with a keyframe at every frame, I used the following command:

ffmpeg -i UncompressedMov.mov -sameq -g 1 OutputFile.flv


I hope that saves someone a half hour of searching!

Comments

Sam
Sam
August 12, 2010 03:07 am

Thank you very much!

elad
elad
February 14, 2010 05:16 am

THANKS :)

kirk
kirk
January 3, 2010 04:50 am

thanks ) now my ffm problem is solved in case anyone else came across the same problem the 'ffm' file *should* start with a keyframe!

Mike
Mike
December 15, 2009 1:23 pm

Many thanks. First page I searched. DONE!

alex
alex
December 3, 2009 03:56 am

great, thanks for your time!!

Rosen
Rosen
November 2, 2009 10:50 am

Thanks !

Tom
Tom
October 22, 2009 12:17 am

Saved me half an hour. Cheers!

August 11, 2009 05:33 am

Thanks!

Charles
Charles
July 22, 2009 2:27 pm

Your welcome everyone. Who would have ever thought it would be called "Group of Pictures"...right? I have worked with video editing for several years and never heard that term.

phil
phil
July 22, 2009 2:09 pm

save a lot of time to me too, thanks

Jim J
Jim J
June 23, 2009 5:07 pm

Saved me time too

taksistaZR
taksistaZR
June 9, 2009 3:48 pm

Thank you, it saved me time

gorefest
gorefest
May 26, 2009 1:54 pm

Great hint! Lotsa thanks!

huck fin
huck fin
May 24, 2009 2:57 pm

Wow, Thanks for posting this. I would have never thought it was so simple (and undocumented). I have been trying this for days.

April 26, 2009 05:11 am

Yes it saved me time.. first result on google :D thanks

bad kittie
bad kittie
March 1, 2009 09:03 am

yep, same here, thank you! :)

Guest
Guest
January 25, 2009 00:56 am

Thank you! I've been searching for "keyframe" info for at least half an hour. Definitely saved me time.

Name:

Message:

Avatar:
bomb avatar music player avatar email avatar nerdy tux avatar gimp avatar red hat avatar red time avatar mysterious man avatar tan smiley avatar devil smiley avatar pipe guy avatar

Complete the Re-Captcha to Post Your Message:

Techno Gumbo RSS Feed

Related Links

FFmpeg