videoffmpegvideo-editing

Using -ss and -to to play a video using ffplay


I want to display the video before trimming it

to trim we can use 2 ways:

method 1:

FFmpeg -i input.mp4 -ss 00:00:10.000 -to 00:00:15.000 output.mp4

This Generates a video of length 5 seconds [Note here to is used we can also use -t]

method 2

FFmpeg -i input.mp4 -ss 00:00:10.000 -t 00:00:5.000 output.mp4

This Generates a video of length 5 seconds[here we used -t so we specify duration]

If I want to display a video I'm using

FFplay -i input.mp4 -ss 00:00:10 -t 00:00:5

but its starting video from 5 sec and to 15 sec [video length being 10 sec where it should be 10 sec to 15 sec [5 secs]]

and if the file format is different again its starting at random points like for .mkv its stating at 8 sec to 15 sec if im using -to im getting this error

Failed to set value '00:00:15.123' for option 'to': Option not found

im testing this from past 1 hr some one clear me how can i do ffplay for a trimming video Thank you


Solution

  • It was the issue with only that file which i used for any other files is working fine with this command

    FFplay -i input.mp4 -ss 00:00:10 -t 00:00:5