1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ffmpeg-pythonで動画をトリミング(切抜き)

Posted at

前回の続きのつもりでしたが、簡単すぎて思いの外やることがありませんでした。

input.mp4の開始5秒後を起点に30秒間を切り抜いてoutput.mp4として出力するなら以下のような感じ。

import ffmpeg

stream = ffmpeg.input("input.mp4", ss=5, t=30).output("output.mp4")
ffmpeg.run(stream)

もちろんss=t=に変数を渡してやってもいいし、何なら小数渡しちゃってもOK。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?