M
M
Miku Hatsune2015-11-12 03:12:11
fmpeg
Miku Hatsune, 2015-11-12 03:12:11

How to detect "video quality" via ffmpeg?

I don’t even know how to formulate the question, how to determine the quality of the video through ffmpeg? That is, 720p or 420p, etc.
That is, I execute the command: ffmpeg -i /my-video-file.mp4
What should I look for in the answer?
// At first I saw yuv420p there - I thought it, but when I gave ffmpeg a video of very poor quality and low resolution (320x240 which is basically like 144p) he answered - yuv420p
I googled it, but it turned out to be the color model of the video :D
ps I'm with ffmpeg I’m not very friendly and I’ve never had to work with media files, so you don’t need to shout at my wrong wording, but you can fix it)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
monah_tuk, 2015-11-12
@Hatsune-Miku

ffmpeg -i lightning-timezones.mkv
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, matroska,webm, from 'lightning-timezones.mkv':
  Metadata:
    ENCODER         : Lavf56.15.102
  Duration: 00:02:21.61, start: 0.067000, bitrate: 442 kb/s
    Stream #0:0: Video: h264 (High 4:4:4 Predictive), yuv444p, 1920x1080, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc (default)
    Metadata:
      ENCODER         : Lavc56.13.100 libx264
    Stream #0:1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s (default)

specifically:
Selected **ITEM**, first resolution, second - FPS, DAR - Display Aspect Ratio - aspect ratio of the picture (more about SAR, DAR, PAR: https://en.wikipedia.org/wiki/Pixel_aspect_ratio).
144p is not a quality, but a resolution encoding: 176x144 progressive scan. I can make you 1080p so disgusting that you will be sick of the mere memory. Typically, this view is used to represent resolution on the low side, and p or i after - progressive or interline scanning (progressive - full frame, FPS 1: 1, interline - in each frame two (theoretically and more) half-frames, which are then cunning algorithms are restored to a full frame, which increases the output FPS by 2 times). One such encoding can hide several resolutions, for example: 1080p is both 1920x1080 and 1440x1080, in both cases DAR 16:9, but SAR in the first case is 1:1, and in the second 1.33:1. Or 720p, in addition to the popular 1280x720 (DAR 16:9, SAR 1:1), it can be 960x720 at DAR 4:3 and SAR 1:1 or 960x720 at DAR 16:
I forgot to write about ffprobe - use it. If there is ffmpeg, there is also it:
as "-print_format" parameters you can specify: flat, json, xml, csv, compact, ini - whatever you find more convenient. "-select_streams" allows you to select streams by any criteria supported by ffmpeg: v - video, a - audio, # - by number, etc. Exhaust example:
streams.stream.0.index=0
streams.stream.0.codec_name="h264"
streams.stream.0.codec_long_name="H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"
streams.stream.0.profile="High 4:4:4 Predictive"
streams.stream.0.codec_type="video"
streams.stream.0.codec_time_base="1001/60000"
streams.stream.0.codec_tag_string="[0][0][0][0]"
streams.stream.0.codec_tag="0x0000"
streams.stream.0.width=640
streams.stream.0.height=480
streams.stream.0.coded_width=640
streams.stream.0.coded_height=480
streams.stream.0.has_b_frames=2
streams.stream.0.sample_aspect_ratio="1:1"
streams.stream.0.display_aspect_ratio="4:3"
streams.stream.0.pix_fmt="yuv444p"
streams.stream.0.level=30
streams.stream.0.color_range="N/A"
streams.stream.0.color_space="unknown"
streams.stream.0.color_transfer="unknown"
streams.stream.0.color_primaries="unknown"
streams.stream.0.chroma_location="left"
streams.stream.0.timecode="N/A"
streams.stream.0.refs=4
streams.stream.0.is_avc="1"
streams.stream.0.nal_length_size="4"
streams.stream.0.id="N/A"
streams.stream.0.r_frame_rate="30000/1001"
streams.stream.0.avg_frame_rate="30000/1001"
streams.stream.0.time_base="1/1000"
streams.stream.0.start_pts=67
streams.stream.0.start_time="0.067000"
streams.stream.0.duration_ts="N/A"
streams.stream.0.duration="N/A"
streams.stream.0.bit_rate="N/A"
streams.stream.0.max_bit_rate="N/A"
streams.stream.0.bits_per_raw_sample="8"
streams.stream.0.nb_frames="N/A"
streams.stream.0.nb_read_frames="N/A"
streams.stream.0.nb_read_packets="N/A"
streams.stream.0.disposition.default=1
streams.stream.0.disposition.dub=0
streams.stream.0.disposition.original=0
streams.stream.0.disposition.comment=0
streams.stream.0.disposition.lyrics=0
streams.stream.0.disposition.karaoke=0
streams.stream.0.disposition.forced=0
streams.stream.0.disposition.hearing_impaired=0
streams.stream.0.disposition.visual_impaired=0
streams.stream.0.disposition.clean_effects=0
streams.stream.0.disposition.attached_pic=0
streams.stream.0.tags.ENCODER="Lavc56.13.100 libx264"
format.filename="/home/alexd/thunderbird-timezones-fix.mkv"
format.nb_streams=1
format.nb_programs=0
format.format_name="matroska,webm"
format.format_long_name="Matroska / WebM"
format.start_time="0.067000"
format.duration="84.451000"
format.size="80212"
format.bit_rate="7598"
format.probe_score=100
format.tags.ENCODER="Lavf56.15.102"

A
Alexander Taratin, 2015-11-12
@Taraflex

superuser.com/a/595205

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question