I'm looking for a program that has the following features:
- it's free to download and use;
- can be used from a command line interface, not just from a graphical user interface;
- can analyze the contents of the frames in a video file (but not all frames, maybe one each 15 seconds), or the contents of jpeg images of frames extracted from a video file, and guess if the image has an aspect ratio of either 16:9 or 4:3 (the video file resolution is 720x576 px, which means the aspect ratio is 5:4, but the images in it's frames can have either 16:9 or 4:3);
- can output the aspect ratio as text in the command line interface, or as text in a text file.
Does such a program exist?
+ Reply to Thread
Results 1 to 7 of 7
-
Last edited by codemaster; 9th Oct 2017 at 16:35.
-
I don't know of any such program. But I would start by checking for letterboxing and pillarboxing (which is easy), then move to face recognition and analyzing whether the average face width was below a threshold, indicating a squashed 16:9 image.
-
It is not at all clear what you are really trying to do. As already pointed out, Mediainfo and many other programs can read the header in a video or still file and give you the pixel count in each direction and, in some cases, the pixel aspect ratio (i.e., whether the pixel is square or rectangular).
So if that is all you want to do, this is simple stuff, and there are lots of options. Those who have already posted have pointed you in the right direction.
If instead you have photos or videos that have been encoded to a certain aspect ratio (for instance 1920x1080, using square pixels), but the content is not that aspect ratio, resulting in hard-coded black bars, then you need to create a script which looks at frames and determines how to crop it. One such script exists in the long RT_Stats thread over at doom9.org. Here is a direct link to that script:
"QueryBorderCrop()" returns the crop coords to remove letter boxing or other black bars around the edges of a clip. -
It is usually so much quicker and easier to fix them by hand after eyeballing and making educated guesses.
(Also, being finicky about your sources and knowing in detail their common provenance helps a lot).
Scott -
-
As mentioned previously MediainforCLI will give a screen or text result and if you have MediaInfo installed, the mouseover can be activated in the options to show also. Notice it gives aspect as 2.35:1 but the dimensions tells it is anamorphic (1.91:1, 704x368)
OR CLI:
Template.txt:
Code:General;Container Format = %Format%_\r\nOverAllBitRate = %OverallBitRate/String%_\r\nDuration = %Duration/String%_\r\n Video;Aspect = %DisplayAspectRatio/String%_\r\nResolution = %Width%x%Height%_\r\nVideo Codec = %CodecID%_\r\nVideo Format = %Format%_\r\nVideo Bit Rate = %BitRate/String%_\r\nFrame Rate = %FrameRate%_\r\nScan Type = %ScanType%_\r\nTotal Frames = %FrameCount%_\r\n Audio;Audio Codec = %CodecID%_\r\nAudio Format = %Format%_\r\nChannels = %Channel(s)%_\r\nAudio Bit Rate = %BitRate/String%_\r\nSample Rate = %SamplingRate/String%_\r\nAudio Profile = %Format_Profile%_\r\nAudio Delay = %Video_Delay/String1%_\r\n
Output:
C:\Users\Bud\Desktop\Mega_FLV Only stripped\bin\Debug>"C:\Users\Bud\Desktop\Mega_FLV Only stripped\bin\Debug\MediaInfo.exe" --Output=file://"C:\Users\Bud\Desktop\Mega_FLV Only stripped\bin\Debug\Template.txt" "C:\Users\Bud\Desktop\aCommercial HDCNVRTED.flv"
Container Format = Flash Video_
OverAllBitRate = 1 513 Kbps_
Duration = 14s 999ms_
Aspect = 16:9_
Resolution = 720x480_
Video Codec = 7_
Video Format = AVC_
Video Bit Rate = 1 348 Kbps_
Frame Rate = 23.976_
Scan Type = Progressive_
Total Frames = 358_
Audio Codec = 2_
Audio Format = MPEG Audio_
Channels = 2_
Audio Bit Rate = 96.0 Kbps_
Sample Rate = 44.1 KHz_
Audio Profile = Layer 3_
Audio Delay = 83ms_
Similar Threads
-
Aspect ratio as a number rather than a ratio
By pooksahib in forum Newbie / General discussionsReplies: 38Last Post: 22nd Aug 2017, 18:18 -
Converting 1:85 aspect ratio to 2:39 aspect ratio using Virtual Dub
By maxgremlin in forum EditingReplies: 1Last Post: 8th Jun 2017, 22:06 -
Aspect Ratio help: What ratio is this?
By bergqvistjl in forum RestorationReplies: 20Last Post: 20th Aug 2016, 06:00 -
Keep Aspect Ratio
By monteverde in forum Video ConversionReplies: 8Last Post: 31st Dec 2013, 12:26 -
Aligning together frames of different aspect ratio
By Mephesto in forum EditingReplies: 6Last Post: 15th Nov 2012, 02:23