0
0

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 1 year has passed since last update.

FFmpeg で動画のファイル形式を簡単に変換する

Posted at

概要

FFmpeg(エフエフエムペグ)は、動画・音声のデータを簡単に記録・変換・再生できる、無料のコマンドツールです。

背景としては、私が動画制作の仕事では mac を使用してるため、いつも書き出す動画ファイルは .mov
しかし、「mov ではなく mp4 にして欲しい」とご要望があったため、「わざわざ動画制作ツールから書き出し直さなくてもよい方法ないかな?」と思って見つけたのが FFmpeg です。

FFmpeg インストール

mac ユーザーなので、Homebrew 使ってインストールしました
(Windows の方は公式サイトの導入方法をご覧くださいませ)

brew install ffmpeg

インストールできたか確認

# バージョン確認コマンド
ffmpeg -version

# 実行結果
ffmpeg version 5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
 :

使い方

基本

基本的な使用方法は

ffmpeg {オプション} ({入力ファイルオプション} -i {入力ファイルパス}) ({入力ファイルオプション} {出力ファイルパス})

サンプル

例)カレントディレクトリの .mov の動画を .mp4 に変換するコマンド

ffmpeg -i input.mov output.mp4
👇 実行結果

実行後に数秒待つと、無事に変換完了(変換対象のファイルサイズによっては、少し時間がかかる)。
変換前のファイルは消えることなく、.mp4 形式でコピーが作られた。

ffmpeg実行サンプル.png

  • input: 変換前のファイル
  • output: 変換後のファイル

動画再生自体も問題なくできた👍
ファイル名は日本語が入っていても問題なく変換できましたが、できれば半角英数字のみの方がより安心かなと個人的には思いました。

ヘルプコマンド

以下でコマンドのヘルプが表示されるので、オプション指定など調べられます

ffmpeg -h
0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?