6
2
I am currently using ffmpeg to slice video files. I automated the process through a script called ffmpeg_split.sh. Although this very slow it is efficient in splitting videos into equivalent settings. The only issue is that it has frame rate issues. Below evil soup recommended a way to do all this using segment
in ffmpeg. I tried this but it does not give me equivalent duration segments.
UPDATE
Per evilsoup using this command to segment videos:
ffmpeg -i input.mp4 -c copy -map 0 -segment_time 8 -f segment output%03d.mp4
OLD:
Here is the syntax to slice a video with script: ffmpeg_split.sh -s test_vid.mp4 -o video-part%03d.mp4 -c 00:00:08
Results
my_split_script.sh
input.mp4 – Duration 00:01:20
#EXTINF:10,
Output01.mp4
#EXTINF:10,
Output02.mp4
#EXTINF:10,
Output03.mp4
#EXTINF:9,
Output04.mp4
#EXTINF:10,
Output05.mp4
#EXTINF:10,
Output06.mp4
#EXTINF:11,
Output07.mp4
#EXTINF:10,
Output08.mp4
real 0m30.517s #execution time
ffmpeg
input.mp4 – Duration 00:01:20
#EXTINF:10,
Output01.mp4
#EXTINF:10,
Output02.mp4
#EXTINF:6,
Output03.mp4
#EXTINF:10,
Output04.mp4
#EXTINF:10,
Output05.mp4
#EXTINF:7,
Output06.mp4
#EXTINF:10,
Output07.mp4
#EXTINF:9,
Output08.mp4
real 0m7.493s #executition time
Essential info is missing: What does your script do, exactly? Can you post it here? Also, mind you that ffmpeg can only split at I-frames when doing a stream copy. If your script however re-encodes the file, it can virtually split anywhere. – slhck – 2014-10-12T18:07:23.723
@slhck my original script splits the video into equivalent segments . For example
– Code_Ed_Student – 2014-10-12T18:13:49.910-c 8
will split video into segments that are 8 seconds. It does not re-encode so which is why certain segments have a still image at the end. Here is a link to the script i am suing: SCRIPT . How can do this? Is it possible to do all this without the need of a script?@Code_Ed_Student They may be identical length but as you reported there is repeated information between segments. The segmenter handles all of this under the hood for you (the best it can). If you want to know more then it may be worthwhile to read on video encoding itself. – dstob – 2014-10-12T19:03:23.847