Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Newbies

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd September 2017, 16:12   #1  |  Link
spamalam
Registered User
 
Join Date: Jul 2006
Posts: 13
Linux Command Line utility for comparing quality between media

Hi, I have a lot of video media I am archiving and often get duplicates. I'm looking to automate the process of determining which copy to keep by comparing the two copies, ensuring they are identical (ie. runtime, frames) and seeing which one has the better encoding (i.e. resolution, drf, interlacing vs progressive, cropping, audio sync, etc.).

I looked around for an appropriate tool, but they are mostly GUI based and don't make a decision.

The outcomes I would like is Archived is better than New, New is better than Archived, Media is different (i.e. different media) and unable to determine (i.e. requires manual validation).

I know there's a lot of complexity in this but I'm wondering if I can reduce most manual cases down.

Is there an application / script that can perform such analysis on two files?
spamalam is offline   Reply With Quote
Old 23rd September 2017, 21:10   #2  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by spamalam View Post
Hi, I have a lot of video media I am archiving and often get duplicates. I'm looking to automate the process of determining which copy to keep by comparing the two copies, ensuring they are identical (ie. runtime, frames) and seeing which one has the better encoding (i.e. resolution, drf, interlacing vs progressive, cropping, audio sync, etc.).

I looked around for an appropriate tool, but they are mostly GUI based and don't make a decision.

The outcomes I would like is Archived is better than New, New is better than Archived, Media is different (i.e. different media) and unable to determine (i.e. requires manual validation).

I know there's a lot of complexity in this but I'm wondering if I can reduce most manual cases down.

Is there an application / script that can perform such analysis on two files?


Probably not, because there is no way to determine accurately or consistently what is "better" between 2 files . eg. Something might have a higher resolution, higher drf, higher bitrate, higher anything and yet be "worse" in quality. There is no good way to automate that type of detection with any accuracy

If you had a third file, the "original", then yes, you could probably run ssim/psnr metrics with ffmpeg for part of the script

Probably better off doing it yourself because there is way too much room for error
poisondeathray is offline   Reply With Quote
Old 23rd September 2017, 22:58   #3  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by poisondeathray View Post
Probably not, because there is no way to determine accurately or consistently what is "better" between 2 files . eg. Something might have a higher resolution, higher drf, higher bitrate, higher anything and yet be "worse" in quality. There is no good way to automate that type of detection with any accuracy

If you had a third file, the "original", then yes, you could probably run ssim/psnr metrics with ffmpeg for part of the script

Probably better off doing it yourself because there is way too much room for error
Well, there exist different types of objective quality metrics. The most widely used ones (PSNR, SSIM, etc) indeed compute the "error" between a reference image/video and a modified (e.g. compressed) image/video – which means that a pristine quality "original" image/video is always required. But there also exist "blind" quality metrics that try to judge quality from a given image/video alone (no reference needed), e.g. by detecting certain "defects", such as blocking artifacts, noise, blurriness and so on... How well quality metrics of the latter kind approximate the "perceived" quality in practice is a completely different question, of course. But the same applies to non-blind metrics (PSNR, SSIM, etc) as well.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 23rd September 2017 at 23:01.
LoRd_MuldeR is offline   Reply With Quote
Old 24th September 2017, 20:02   #4  |  Link
spamalam
Registered User
 
Join Date: Jul 2006
Posts: 13
I think a CLI that can provide blind metrics would be enough for a starting point, I think with that I can filter out most of the core defects and then rely on eyeballing them for validation.

I saw a very old tool called AVInaptic but it doesn't seem to compile/run on a modern linux distro and looks like its UI only?
spamalam is offline   Reply With Quote
Old 24th September 2017, 20:30   #5  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by spamalam View Post
I saw a very old tool called AVInaptic but it doesn't seem to compile/run on a modern linux distro and looks like its UI only?
AFAIK, the tool "AVInaptic" only gives you the "technical characteristics" of the file (audio/video format, bitrate, quantizers, etc), but nothing that would allow you to judge the quality of the video. MediaInfo would be an alternative.

Plase don't make the mistake to judge quality by bitrate or by quantizer values! Higher bitrate (or lower quantizer) does not imply better quality: For example, the higher bitrate (or lower quantizer) encode may actually have been created from a worse source, so a lower bitrate (or higher quantizer) encode made from a higher quality source can actually look way better! Also, resulting quality depends a lot on the encoder used and the encoder's settings. A "bad" encoder can produce very poor quality, even if you crank up the bitrate! At the same time, a "good" encoder may produce decent quality at very low bitrates - from the exactly same source. Last but not least: Modern video formats, such as H.264, support a feature called "adaptive quantization", which means that every block in the frame can have its own separate quantizer. Usually, each block in a frame will store its quantizer as an offset from the frame's "base" quantizer. Consequently, tools that show you the frame quantizers - and that's what most tools do - will not tell you anything about the actual per-block quantizers. Not that the per-block quantizers would tell much about the video's actual quality, for the reasons explained before...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 24th September 2017 at 20:44.
LoRd_MuldeR is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 23:25.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.