简体   繁体   中英

ffmpeg - how can I scale the video while perserving the total frames in it?

I have a video with a size of 515 x 755 , that I would like to resize proportionally to 206 x 302 (so, factor is 2.5 ).

In this video, I have the total of 588 frames, and I use ffmpeg to scale it, with this command .

ffmpeg -i video.mp4 -vf scale=206:-1 xRotation_206.mp4

And I use this to check how many frames are there in the video, based on this answer .

ffmpeg -i video.mp4 -map 0:v:0 -c copy -f null - 2>&1 | awk '/frame=/ {print $2}'

The original video frames is good (588 frames). But, after resizing with the command above, my converted video now has 604 frames.

The question is, how can I resize the video by preserving the total frames in it? It doesn't really have to be ffmpeg approach, and any suggestion is appreciated.

Here's the sample video that I use: Link

FFmpeg, by default, generates constant frame-rate MP4s, so if your original video is variable-frame rate then ffmpeg will drop or duplicate frames to generate a constant frame rate output.

To avoid that, use

ffmpeg -i video.mp4 -vf scale=206:-1 -vsync passthrough xRotation_206.mp4

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM