0
1

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 5 years have passed since last update.

Twitterに投稿できるmp4をffmpegでトリミングして作る

0
Posted at

ffmpegで動画をトリミングしてTwitterにあげようとしたら画質の問題で失敗したので書いておきます。

mp4の画質制限

Twitterに投稿できる画質の上限はhigh-L4.2らしいんですが、以下のffmpegではデフォルトで4.3らしくそのままトリミングを行うとTwitterに投稿できません。

.sh
$ ffmpeg -v
ffmpeg version N-75517-gf559812 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.3 (GCC)

画質を指定してエンコード

画質を上げるならhigh-L4.2を使うのが正解なんでしょうが、めんどくさいのでbaselineでエンコードします。

.sh
$ ffmpeg.exe -i input.mp4 -profile:v baseline -ss 10:10 -t 20 out.mp4

これで元動画の10分10秒から10分20秒までの間がトリミングされて出力されます。

0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?