At A Glance Main Projects Tutorials Resume

Contact


Email: palen1c at gmail.com




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!

Charles Palen has been involved in the technology sector for several years. His formal education focused on Enterprise Database Administration. He currently works as the principal software architect and manager at Transcending Digital where he can be hired for your next contract project. Charles is a full stack developer who has been on the front lines of small business and enterprise for over 10 years. Charles current expertise covers the areas of .NET, Java, PHP, Node.js, Javascript, HTML, and CSS. Charles created Technogumbo in 2008 as a way to share lessons learned while making original products.

Comments

Drumkruk
Drumkruk
April 16, 2013 11:33 am

Thank you very much! This is exactly what we needed to fix a major bug in our system!

A guest
A guest
March 15, 2013 02:35 am

-sameq does not mean 'same quality', it means 'same quantizers'
http://ffmpeg.org/trac/ffmpeg/wiki/Option%20%27-sameq%27%20does%20NOT%20mean%20%27same%20quality%27

webdiyer
webdiyer
January 14, 2013 04:29 am

File will be very large!

Ryo saeba
Ryo saeba
March 22, 2012 2:13 pm

Save my end of day, first in google! Thank you!

ocvadmin
ocvadmin
December 20, 2011 2:57 pm

That was helpful. We are about to change that and check. Found this in 1 minute and could save 29 like you said.

Johan-Belgium
Johan-Belgium
December 6, 2011 08:08 am

Yep! Saved me some googling time too! Thanks!

q
q
October 21, 2011 11:40 am

still saving people time 3 years later! tks!

tartartar
tartartar
September 22, 2011 09:47 am

Yes, thank you! Saved me hours.

Guest
Guest
May 8, 2011 07:28 am

thankyou!

Done
Done
January 18, 2011 6:19 pm

Thanks a bunch!

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.

Comments are currently disabled.


Techno Gumbo RSS Feed

Related Links

FFmpeg