[FFmpeg-user] Deinterlace and change framerate with -vcodec copy

Andrew Berg bahamutzero8825 at gmail.com
Mon May 23 16:30:32 CEST 2011

On 2011.05.22 01:43 PM, Peter Bašista wrote:
> >> Let's say I have managed to get a 25fps noninterlaced file movie.mkv. Is there any "easy" way to change the framerate to 24fps? By "easy" I mean without reencoding (or: with -vcodec copy).
> > You could simply drop every 25th frame
> Actually, according to information from Mark, this would require
> reencoding. And I agree with that, because it sounds reasonable. You
> have to somehow fill in the "blank spot" created by a dropped frame.
I was a little simplistic there. If nothing depends on a frame for
information, that frame can be dropped (IIRC, B-frames can be discarded;
otherwise all frames must be I-frames). However, especially with the
short GOPs in broadcast streams, you are still likely to drop a lot of
P-frames and even a few I-frames, which would result in a lot of GOPs
being corrupted. As a general rule, Mark is right.
> But even if I succeed in changing the container's headers in a way
> that the video will play at 96% speed, I am not sure if I want to do
> it. The reason is simple. If someone later extracts the video out of
> this container, what would its frame rate be?
Depends on the video stream. x264 writes the frame rate into the video
streams it creates (this is overridden by the container, however). I
don't know if this is common with other encoders.
> I suppose it will remain unchanged at the "old" value, which means 25
> fps. And this is what I want to avoid. I want the fps change to be
> more robust than that. I don't want the careless container changes to
> blow the fps change away.
> That's why I consider changing PTS (presentation time stamps) of the
> video frames as suggested by Mark as better, more stable solution. The
> only problem is I don't know how to do it. (yet) :)
It is possible to change such information in a video stream, but I'm not
familiar with the tools. There are ways to go from 50i to 24p, but IIRC,
it's not usually pretty and it will require decoding. I can't help much
with the process, though, since I've never had to do it (almost all the
material I work with just need to be deinterlaced, and the little that
needs to be converted to 24p is originally 60i).

More information about the ffmpeg-user mailing list