ffmpeg video editing command in milliseconds timestamp
32,885
Solution 1
you can try:
ffmpeg -i a.ogg -ss 00:01:02.500 -t 00:01:03.250 -c copy x2.ogg
Timestamps need to be in HH:MM:SS.xxx format for advanced precision (where xxx are milliseconds).
Let me know if it works.
Solution 2
Time duration can be present two format. (FFmpeg 4.3 or newer)
Format 1 :
[-][HH:]MM:SS[.m...]
or
Format 2 :
[-]S+[.m...][s|ms|us]
Format 1 samples
01:20:10 1 hour 20 minute 10 seconds
04:03 4 minutes 3 seconds
07:02:05.100 7 hours 2 minutes 5 seconds 100 miliseconds
Format 2 samples
120 120 seconds
120.2 120.2 seconds or 120 seconds 200 miliseconds
1200ms 1200 milliseconds
1300us 1300 microseconds
I never rely on decimals. If possible, use always format2 (-ss '120534ms').
ffmpeg -i a.ogg -ss '100ms' -t '600ms' -c copy x2.ogg
Related videos on Youtube
Author by
Harjit Singh
Updated on July 09, 2022Comments
-
Harjit Singh almost 2 years
I am editing a video with
ffmpeg
where I have to keep in view the timestamp further deep from seconds to milliseconds. I know such command :ffmpeg -i a.ogg -ss 00:01:02 -to 00:01:03 -c copy x2.ogg
. This uses seconds, but I want down to milliseconds. -
Arnaud Leyder about 10 yearsGood to know. Remember to accept an answer when your problem is solved so that people on Stackoverflow can continue to provide good answers to good questions. Welcome!
-
Ahmed Mahmoud about 6 yearsThanks for your time and effort!
-
Michael about 4 yearsthis is weird. i'm requesting 13 frames of video but it's only saying it copied 3!