Skip to content

Instantly share code, notes, and snippets.

@LvJC
Last active November 14, 2021 07:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LvJC/eed4c259015030b98c254e7ee107d274 to your computer and use it in GitHub Desktop.
Save LvJC/eed4c259015030b98c254e7ee107d274 to your computer and use it in GitHub Desktop.
# Get all metadata
ffprobe -hide_banner -loglevel fatal -show_error -show_format -show_streams -show_programs -show_chapters -show_private_data -print_format json <video>.mp4
# {
# "programs": [
# ],
# "streams": [
# {
# "index": 0,
# "codec_name": "h264",
# "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
# "profile": "High",
# "codec_type": "video",
# "codec_time_base": "1/110",
# "codec_tag_string": "avc1",
# "codec_tag": "0x31637661",
# "width": 1280,
# "height": 704,
# "coded_width": 1280,
# "coded_height": 704,
# "closed_captions": 0,
# "has_b_frames": 2,
# "pix_fmt": "yuv420p",
# "level": 32,
# "color_range": "tv",
# "color_primaries": "bt470bg",
# "chroma_location": "left",
# "refs": 1,
# "is_avc": "true",
# "nal_length_size": "4",
# "r_frame_rate": "55/1",
# "avg_frame_rate": "55/1",
# "time_base": "1/14080",
# "start_pts": 0,
# "start_time": "0.000000",
# "duration_ts": 291840,
# "duration": "20.727273",
# "bit_rate": "1014250",
# "bits_per_raw_sample": "8",
# "nb_frames": "1140",
# "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": {
# "rotate": "90",
# "language": "und",
# "handler_name": "VideoHandler"
# },
# "side_data_list": [
# {
# "side_data_type": "Display Matrix",
# "displaymatrix": "\n00000000: 0 65536 0\n00000001: -65536 0 0\n00000002: 46137344 0 1073741824\n",
# "rotation": -90
# }
# ]
# },
# {
# "index": 1,
# "codec_name": "aac",
# "codec_long_name": "AAC (Advanced Audio Coding)",
# "profile": "LC",
# "codec_type": "audio",
# "codec_time_base": "1/48000",
# "codec_tag_string": "mp4a",
# "codec_tag": "0x6134706d",
# "sample_fmt": "fltp",
# "sample_rate": "48000",
# "channels": 2,
# "channel_layout": "stereo",
# "bits_per_sample": 0,
# "r_frame_rate": "0/0",
# "avg_frame_rate": "0/0",
# "time_base": "1/48000",
# "start_pts": 0,
# "start_time": "0.000000",
# "duration_ts": 995328,
# "duration": "20.736000",
# "bit_rate": "96395",
# "max_bit_rate": "96395",
# "nb_frames": "973",
# "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": {
# "language": "und",
# "handler_name": "SoundHandler"
# }
# }
# ],
# "chapters": [
# ],
# "format": {
# "filename": "d867489626cb1c514e96c1d3ad47366f.mp4",
# "nb_streams": 2,
# "nb_programs": 0,
# "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
# "format_long_name": "QuickTime / MOV",
# "start_time": "0.000000",
# "duration": "20.758000",
# "size": "2899764",
# "bit_rate": "1117550",
# "probe_score": 100,
# "tags": {
# "major_brand": "isom",
# "minor_version": "512",
# "compatible_brands": "isomiso2avc1mp41",
# "encoder": "Lavf57.25.100"
# }
# }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment