OT: How to get properties

HandBrake for Windows support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
andrewk89
Posts: 49
Joined: Thu Jun 13, 2013 4:29 pm

OT: How to get properties

Post by andrewk89 » Thu Jun 13, 2019 4:19 pm

Yes, I know this is off topic (but tangentially related)...

I'm running out of hard drive space. To help me limp along until I buy more storage, I want to find candidate videos that could get highest file size reduction from transcoding. Videos using older codecs or low compression are obvious candidates,but how to find these videos automagically so I don't have to inspect each one to make a yes/no decision ...

My first attempt was dragging a folder into MediaInfo and switching to Spreadsheet view. Show the file size, resolution, frame rate, video CODEC, bits/pixel/frame (interesting metric), audio codec, etc. I exported it and imported it into LO Calc and ran in to two problems: 1) MediaInfo exported EVERYTHING, not just the columns I had visible; 2) Columns were jumbled. I think it may be because of punctuation in the file name and other fields. This isn't useful without a lot of data cleanup.

Is there an easier way to skin this cat with ffmpeg, grep (via MingW, MSYS, etc.), or other methods?

User avatar
BradleyS
Moderator
Posts: 1609
Joined: Thu Aug 09, 2007 12:16 pm

Re: OT: How to get properties

Post by BradleyS » Thu Jun 13, 2019 5:42 pm

Code: Select all

du -s *.mp4 **/*.mp4 2>/dev/null | sort -nr
Replace the two .mp4 with your choice or .* to search all file types:

Code: Select all

du -s *.* **/*.* 2>/dev/null | sort -nr
This only shows total file size but should be useful for identifying large files (listed first) for further analysis.

User avatar
JohnAStebbins
HandBrake Team
Posts: 5441
Joined: Sat Feb 09, 2008 7:21 pm

Re: OT: How to get properties

Post by JohnAStebbins » Thu Jun 13, 2019 6:39 pm

mediainfo can also be used to query individual properties with it's '--Inform' option (at least the linux version of mediainfo can do this)
e.g.

Code: Select all

$ mediainfo --Inform=Video\;%CodecID% test.mkv
V_MPEG4/ISO/AVC
Syntax of the command line will differ somewhat since you are on windows. Above is what is required for linux (i.e. '\' to escape the ';').

However the output when using filename wildcards is stupid :cry:

Code: Select all

$ mediainfo --Inform=Video\;%CodecID% *.mkv
V_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEGH/ISO/HEVCV_THEORAV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEGH/ISO/HEVCV_MPEG4/ISO/AVCV_MPEGH/ISO/HEVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVCV_MPEG4/ISO/AVC

mduell
Veteran User
Posts: 6635
Joined: Sat Apr 21, 2007 8:54 pm

Re: OT: How to get properties

Post by mduell » Fri Jun 14, 2019 5:55 pm

JohnAStebbins wrote:
Thu Jun 13, 2019 6:39 pm
However the output when using filename wildcards is stupid :cry:
Seems like you'd be better off with grep than --Inform

Post Reply