Page 1 of 1

OT: How to get properties

Posted: Thu Jun 13, 2019 4:19 pm
by andrewk89
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?

Re: OT: How to get properties

Posted: Thu Jun 13, 2019 5:42 pm
by BradleyS

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.

Re: OT: How to get properties

Posted: Thu Jun 13, 2019 6:39 pm
by JohnAStebbins
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

Re: OT: How to get properties

Posted: Fri Jun 14, 2019 5:55 pm
by mduell
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