オープンメモ帳
書き殴ったっていいじゃないか メモ帳だもの    since January, 2007




コマンドラインツールはよく使うヤツでさえメモしとかないと覚えられない。

FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations.
FFmpeg


◆基本 ffmpeg [入力オプション] -i [入力ファイル] [出力オプション] [出力ファイル]

◎変換 (例)mkv → mp4
 ffmpeg -i in.mkv -c copy out.mp4
   -c copy:再エンコードなし

◎トリミング (例)1分29秒から1時間25分10秒
 ffmpeg -ss 89 -i in.mp4 -t 5110 -c copy out.mp4
   1分29秒→89 1時間25分10秒→1時間(3600)+25分(1500)+10秒(10)=5110

◎リサイズ
 ffmpeg -i in.mp4 -vf scale=1280:-1 out.mp4 1280 x (xxx) アスペクト比を維持して自動
 ffmpeg -i in.mp4 -vf scale=-1:720 out.mp4 (xxx) x 720 アスペクト比を維持して自動

◎動画に音声を付ける (例)in1.mp4から映像、in2.mp4から音声
 ffmpeg -i in1.mp4 -i in2.mp4 -c copy -map 0:0 -map 1:1 -shortest out.mp4
   -shortest:入力ファイル間で長さが違う場合、一番短いものの長さ分だけエンコードする
 ffmpeg -i video.mp4 -i audio.mp3 -c:v copy -c:a aac -map 0:v:0 -map 1:a:0 out.mp4

◎映像を遅らせる (例)1.64秒遅らせる
 ffmpeg -i in.mp4 -itsoffset 1.64 -i in.mp4 -map 1:v -map 0:a -vcodec copy -acodec copy out.mp4
◎音声を遅らせる (例)1.64秒遅らせる
 ffmpeg -i in.mp4 -itsoffset 1.64 -i in.mp4 -map 0:v -map 1:a -vcodec copy -acodec copy out.mp4

◎動画連結
 ①下記のテキストファイル(file.txt)を作る
   file 'in1.mp4'
   file 'in2.mp4'
   file 'in3.mp4'
   file 'in4.mp4'
 ② ffmpeg -f concat -i file.txt -c copy out.mp4

◎音量調整 (例)10db上げる
 ffmpeg -i in.mp3 -vcodec copy -af volume=10dB out.mp3
◎音量調整 (例)10db下げる
 ffmpeg -i in.mp3 -vcodec copy -af volume=-10dB out.mp3

コメント ( 0 ) | Trackback ( 0 )
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする


« EIDAI 室内ド... 記事一覧画像一覧読者一覧フォトチャンネル一覧 フロント ブレ... »
 
コメント
 
コメントはありません。
コメントを投稿する
 
名前
タイトル
URL
コメント
コメント利用規約に同意の上コメント投稿を行ってください。

数字4桁を入力し、投稿ボタンを押してください。