VideoHelp Forum
+ Reply to Thread
Results 1 to 7 of 7
Thread
  1. 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?
    Last edited by codemaster; 9th Oct 2017 at 17:35.
    Quote Quote  
  2. Mediainfo CLI, it reads header, flags, it does not analyze video.

    JPEG images, especially taken down from a DVD, DV file. As soon as you create that image, you do not know what correct aspect ratio was, you need to get that from video.
    Quote Quote  
  3. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    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.
    Quote Quote  
  4. 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.
    Quote Quote  
  5. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    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
    Quote Quote  
  6. Originally Posted by Cornucopia View Post
    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
    Agree. The script I linked to is only useful if you have to do a LOT of this, and every video is different, or if you have changes within a given video file.
    Quote Quote  
  7. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    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)

    Click image for larger version

Name:	MICLImouseover.jpg
Views:	102
Size:	30.5 KB
ID:	43341

    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_
    Click image for larger version

Name:	mICLI 1.jpg
Views:	166
Size:	75.3 KB
ID:	43342
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!