Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

ffmepg is a integrated tool for video encoding/decoding processing as open source project - http://ffmpeg.org



Typical syntax of ffmpeg command is like below:

...

Code Block
$ ffmpeg -i input.mp4 -t 00:00:30 -c copy part1.mp4 -ss 00:00:30 -codec copy part2.mp4


Below is an advanced version of splitting video files showing the way to implement one command instead of multiple command even though that does not reduce efforts to type the necessary options.

Code Block
echo "Two commands" 
time ffmpeg -v quiet -y -i input.ts -vcodec copy -acodec copy -ss 00:00:00 -t 00:30:00 -sn test1.mkv
time ffmpeg -v quiet -y -i input.ts -vcodec copy -acodec copy -ss 00:30:00 -t 01:00:00 -sn test2.mkv
echo "One command" 
time ffmpeg -v quiet -y -i input.ts -vcodec copy -acodec copy -ss 00:00:00 -t 00:30:00 \
  -sn test3.mkv -vcodec copy -acodec copy -ss 00:30:00 -t 01:00:00 -sn test4.mkv


13. Joining multiple video parts into one

...

Code Block
$ fmpeg -i input.mp4 -i subtitle.srt -map 0 -map 1 -c copy -c:v libx264 -crf 23 -preset veryfast output.mp4


15. Adding multi subtitles to a video file

Code Block
$ ffmpeg -i $movie.mov -i $sub_en.srt -i $sub_de.srt -map 0:v -map 0:a -map 1 -map 2 \
-c:v copy -c:a copy -c:s srt \
-metadata:s:s:0 language=eng -metadata:s:s:1 language=ger \
$output.mkv



Children Display
excerptTypesimple