0

Can FFMPEG cut to a hundredths of a second?

When I try to cut a video using :

ffmpeg -i input.mov -ss 0.989 -t 0.238 -r 30 -y output.mov

The video duration of output.mov is 0.27 seconds and not 0.238 seconds.

Is this something that is limited by the video frame rate?

This is the input video data:

  Metadata:
    major_brand     : qt  
    minor_version   : 512
    compatible_brands: qt  
    encoder         : Lavf58.29.100
  Duration: 00:00:04.43, start: 0.000000, bitrate: 12070 kb/s
    Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc), 1920x1080 [SAR 1:1 DAR 16:9], 11995 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : Core Media Video
      encoder         : Lavc58.54.100 libx264
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 133 kb/s (default)
    Metadata:
      handler_name    : Core Media Audio

This is the output video data:

 Metadata:
    major_brand     : qt  
    minor_version   : 512
    compatible_brands: qt  
    encoder         : Lavf58.29.100
  Duration: 00:00:00.27, start: 0.000000, bitrate: 15299 kb/s
    Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc), 1920x1080 [SAR 1:1 DAR 16:9], 15144 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : Core Media Video
      encoder         : Lavc58.54.100 libx264
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 123 kb/s (default)
    Metadata:
      handler_name    : Core Media Audio
0

I believe you cannot cut less than a frame dealing with video streams.

With 30 fps a single frame is 0.033(3) seconds. The closest value for your requested 0.238 is 0.233(3). But it is less than needed and to not miss any data ffmpeg takes one more frame which results in 0.266(6). When rounded it is exactly 0.27.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.