ffmpegとffprobeの概要と使い方
概要
- 動画関係の便利ソフトウェア
- 動画を時間でスライスして加増にしたりその逆を行える
ffprobe
というコマンドが含まれ、動画のフォーマットの詳細をjson
で確認できる
movファイルをgifアニメーションファイルに変換する
$ ffmpeg -i <path-to-mov.mov> -r 24 <name-of-gif.gif>
動画の詳細情報をffprobe
で確認する
$ ffprobe -v quiet -print_format json -show_format -show_streams ${VIDEO_PATH}
{
"streams": [
{
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "Constrained Baseline",
"codec_type": "video",
"codec_time_base": "1/60",
"codec_tag_string": "avc1",
"codec_tag": "0x31637661",
"width": 640,
"height": 360,
"coded_width": 640,
"coded_height": 368,
"has_b_frames": 0,
"sample_aspect_ratio": "1:1",
"display_aspect_ratio": "16:9",
"pix_fmt": "yuv420p",
"level": 30,
"color_range": "tv",
"color_space": "bt709",
"color_transfer": "bt709",
"color_primaries": "bt709",
"chroma_location": "left",
"refs": 1,
"is_avc": "true",
"nal_length_size": "4",
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/15360",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 112979456,
"duration": "7355.433333",
"bit_rate": "262838",
"bits_per_raw_sample": "8",
"nb_frames": "220663",
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0
},
"tags": {
"creation_time": "2020-07-17T14:27:47.000000Z",
"language": "und",
"handler_name": "ISO Media file produced by Google Inc. Created on: 07/17/2020."
}
},
...
- ffprobe documentation
- 動画の統計情報を確認できる