[FFmpeg-user] Specify frame types when encoding video

James Lu luj125 at gmail.com
Tue Jul 26 21:48:02 CEST 2011

Hi Tomas,

The option you are looking for is -g, from the documentation:
`-g gop_size' Set the group of pictures size. The "group of pictures" is 1
series of pictures, containing only 1 intra frame (at the beginning) and
then the rest are B or P frames. In your example, you'd use the option '-g

I'd suggest you place a keyframe at intervals between 1-5 seconds for a
usable, highly compressed video.

Hope this helps,

2011/7/21 Tomáš Znamenáček <tomas.znamenacek at gmail.com>

> Hello!
> I have a video that I play on a mobile device. I have to be able to seek
> very quickly in the video stream. As the seeking was too slow in a regular
> video stream, I added the –intra flag when encoding the stream with ffmpeg.
> This forces all frames to be intra frames and makes seeking much faster on
> the mobile device. Unfortunately it also blows the file size, as all frames
> are stored as individual images.
> As I only seek to several precise points in the video, I figured I could
> make just these “target” frames intra and let the rest of the stream to be
> compressed as usual, with interframe compression. The stream would then look
> like this:
> frame 000, intra, can be jumped to
> frame 001, inter, cannot be jumped to
> frame 002, inter, cannot be jumped to
> frame 003, inter, cannot be jumped to
>> frame 100, intra, can be jumped to
> Is it possible to specify the individual frame types (inter/intra) like
> this when compressing with ffmpeg?
> Thank you,
> T.
> --
> Use what talents you possess: the woods would be very silent
> if no birds sang there except those that sang best. –Henry Van Dyke
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user

More information about the ffmpeg-user mailing list