[FFmpeg-user] Specify frame types when encoding video

Tomáš Znamenáček tomas.znamenacek at gmail.com
Thu Jul 21 10:24:42 CEST 2011


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


More information about the ffmpeg-user mailing list