0
votes

I use ffmpeg to check the length of the video and to cut video.

I have a video with the lenght of 19.458333 seconds that's why i want to cut it to only have 19 seconds because i don't want the floating point.

I check the video length using below command

ffprobe -i "video.avi" -show_entries format=duration -v quiet -of csv="p=0"

And I use below command to cut video the video

ffmpeg -i  "video.avi" -ss 00:00:00 -t 00:00:19.000 -c copy out.mp4

or

ffmpeg -i  "video.avi" -ss 00:00:00 -t 19 -c copy output.avi

The problem i have is when i cut the video with the above command and check the length the output file's length is 19.018 seconds. Can someone help me with this problem?

1
Videos length is calculated by frames and its time base. You can't just specify a length and get what you want. - halfelf
@halfelf does that mean i need to get the length of a video with a specified frame per seconds? - jameshwart lopez

1 Answers

0
votes

If your video is 30 frames per second, that means each frame is 1/30 or 0.0333 seconds per frame. So .018 is less than one frames duration.