简体   繁体   中英

Is their any way to split video into multiple segment using ffmpeg in android?

I want to trim video into 30 seconds multiple segments in android studio.I have used the following command to trim video into 30 seconds but this is not the way i want,its just trimming video into 30 sec.Is there any FFmpeg command available to split video into multiple segments in android studio of specific duration like 30 secs?

you can use this linux command in android:

ffmpeg -i source-file.foo -ss 0 -t 30 first-30-sec.m4v
ffmpeg -i source-file.foo -ss 30 -t 60 first-30-sec.m4v
...

with this you extract two parts one from second 0 to 30, and the other from 30 to 60. you can modify it as your need, like put it in a for or change the start and end seconds:

ffmpeg -i [source-file-address] -ss [start second] -t [end second] [output-file-name]

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