I have two video files on my iPhone. Is it possible, using Dart, to find two specific 10-second segments in each, and merge them both into a valid 20 second video file?
Asked
Active
Viewed 3,998 times
1 Answers
3
Ok, so there's a FFMpeg plugin for flutter that allows you to do all of this.
https://github.com/tanersener/flutter-ffmpeg
Cutting a 15 second video segment starting at second 20:
ffmpeg -i Funny.mkv -ss 00:00:20 -codec copy -t 15 Funny_cut.mkv
Merging a list of videos that is stored in videos.txt:
ffmpeg -f concat -i videos.txt -c copy Funny_join.mkv
For more about FFMpeg:
https://www.poftut.com/ffmpeg-command-tutorial-examples-video-audio/

DataGrump
- 213
- 3
- 12
-
Hi there, where do you save these videos, @DataGrump? – hoangquyy Feb 20 '20 at 06:44
-
The app’s documents folder. Search for the shared_preferences plugin. @hoangquyy – DataGrump Feb 20 '20 at 06:55
-
@hoangquyy sorry, getApplicationDocumentsDirectory in path_provider...not shared_preferences. – DataGrump Feb 20 '20 at 07:06
-
sorry, i mean in android not ios, thanks for your help. – hoangquyy Feb 20 '20 at 07:07
-
@hoangquyy it maps to the correct directory based on your os. That’s the point. Why use Android specific code when you don’t have to? – DataGrump Feb 20 '20 at 07:09
-
Hi @DataGrump do you have issue with merge video? I can cut video but can't merge videos, what is the format of txt file? "a.mp4\nb.mp4", right? – hoangquyy Feb 25 '20 at 08:06
-
@hoangquyy https://stackoverflow.com/questions/7333232/how-to-concatenate-two-mp4-files-using-ffmpeg – DataGrump Feb 26 '20 at 15:18
-
Is there a way to do this in flutter web? – Shashwat Aditya Mar 21 '20 at 16:50