i would like to use ffmpeg to cut out sections of a mp4 file. i understand how to do it if it is at the beginning or end of the film using the start time or duration options, how can i cut out a section that is in the middle of the film?
spiritech
i would like to use ffmpeg to cut out sections of a mp4 file. i understand how to do it if it is at the beginning or end of the film using the start time or duration options, how can i cut out a section that is in the middle of the film?
spiritech
Keep those cups of Ubuntu comming.
Ubuntu 12.10
After doing some searching it seems the way to do this is to extract the beginning and end and then join the files. However, as mentioned here http://stackoverflow.com/questions/7...eo-from-ffmpeg, .mp4 cant be joined with the cat command. Therefore, you need to convert to .mpg during the extraction of the two halves of the video, as .mpg video can be joined with the cat command according to the above link. NOTE: All this was found with a few minutes of searching.
That StackOverflow answer is outdated. The method of converting to mpeg-2 video and using cat is no longer required now that there is the concat demuxer, protocol, and filter. You can create the segments that you want to join:
And then join them with the concat demuxer as shown in How to concatenate (join, merge) media files.Code:ffmpeg -i input.mp4 -ss 10 -t 5 -c copy -map 0 output1.mp4 ffmpeg -i input.mp4 -ss 120 -t 12 -c copy -map 0 output2.mp4
I don't think the fake "ffmpeg" from libav in the repo can do this, so you'll have to get a recent real ffmpeg. Static builds are easy to use: example instructions.
Last edited by FakeOutdoorsman; March 7th, 2013 at 06:28 AM.
i will give the concat demuxer a go, seems like the simplest option.
Keep those cups of Ubuntu comming.
Ubuntu 12.10
Bookmarks