Open TuxRobotics opened 1 month ago
I think you can already do that by clicking on the change speed icon next to the fps in the lower left
That is close but it still outputs all the frames and just tells the player to speed up. This means big files and most hardware can't handle high frame rates. Also, it can't be applied to cut sections.
Itβs not possible to losslessly change the speed without re-encoding or playing existing frames faster afaik, or am i missing something?
FFMPEG can actually do this by grabbing only the keyframes and copying them, at least for H264.
I tried this quickly on a video and it worked (no transcoding involved).
ffmpeg -discard nokey -i t1.mp4 -c copy t1.264
ffmpeg -r 30 -i t1.264 -c copy t1keys.mp4
Ohh okay cool! Gyan from the ffmpeg team always seems to have the answers π
But then you are at the mercy of the keyframe interval, right? it wouldn't allow "speed up the frame rate by an integer multiple". The resulting file would play only the keyframes and nothing else. That would effectively give a keyframe interval of 1. I think some players have problems playing back videos that only have keyframes (as it requires more bandwidth and cpu to decode keyframes compared to other frames).
I agree it would be a cool trick, maybe we can have a tool in the "Tools" menu that allows stripping out non-keyframes from a video using this command.
also: even though technically the keyframes don't lose any quality, in a whole it's quite a lossy operation because all non-keyframes are lost π but I guess the main benefit is that the operation would be very fast.
Yes, I agree it is lossy, but it is fast and less lossy than "cut" right? π
For playback, I had made the assumption that it would take less CPU power to play keyframe-only sections, but you are right that the memory/file bandwidth probably jumps a lot.
Instead of the tools menu, if a user could click on the "trash" icon in the timeline and have it change to a ">>" or similar for the segment it would be slick. Might be difficult to differentiate the icon click from a seek click?
I am poking around the FFMPEG source to see if there is a way to throw out some of the keyframes as well to be able to adjust the speedup
Yeah, doesn't look like there is a way to do any faster than keyframes only. Still pretty useful level of speed up though. I will look at submitting a pull request to FFMPEG for skipping a variable number of keyframes as well. A surprising number of codecs work with this.
For playback, I had made the assumption that it would take less CPU power to play keyframe-only sections, but you are right that the memory/file bandwidth probably jumps a lot.
I just assumed that rendering a high quality detailed keyframe takes more cpu than calculating the next frame based on an existing frame and a motion vector, but i might be wrong.
Instead of the tools menu, if a user could click on the "trash" icon in the timeline and have it change to a ">>" or similar for the segment it would be slick. Might be difficult to differentiate the icon click from a seek click?
That would not be trivial to implement so I probably won't implement it that way for such a niche use case unless it becomes a tremendously popular request.
I will look at submitting a pull request to FFMPEG for skipping a variable number of keyframes as well. A surprising number of codecs work with this. cool
The fewer issues I have to read, the more new features I will have time to implement, so I ask that you please try these things first
Description
In the "Export Mode" dropdown, it would be awesome if there were a "Fast Forward Cuts" option. Instead of cutting, it would speed up the frame rate by an integer multiple and merge.
It would be fantastic for quickly cropping down long security camera footage!
To keep export performance, it could:
Thanks, awesome work!