meta
all
find -maxdepth 2 -name "*.*" -exec ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 -i {} \; -exec ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 -sexagesimal -i {} \; -exec ffprobe -v 0 -of csv=p=0 -select_streams v:0 -show_entries stream=r_frame_rate -i {} \; -exec du -m {} \; -exec echo \; > list_separated.txt
- run script
- replace
\t./
with\n./
- copy list into sheets (vertical)
- re-copy transposed (horizontal)
- re-paste into txt & replace
\t\t
with\n
- replace
./
with null - paste into a clean sheet
-maxdepth 2
= folder recursivenessffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 -i {}
= WxHffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 -sexagesimal -i
= HH:MM:SS.ms-exec ffprobe -v 0 -of csv=p=0 -select_streams v:0 -show_entries stream=r_frame_rate -i {}
= FPS fractions (need external recalc)du -m {}
= size (can add 'h' e.g. '-mh' but that makes units variable/useless)echo
= adds an empty line after each item
TO DO:
- fix small file size info (<1MB is generalized as 1MB)
- format output (but this can be done in post)
- sum up application/folder content size in a separate line (atm has to be done manually)
- list empty folders too
size
grep file dimensions
for nxn in * ; do identify $nxn | grep -oE '([0-9]*)x([0-9]*)[[:space:]]' >> list-sizes.txt; done
grep file dimensions and names
for nxn in * ; do identify $nxn | echo $nxn `grep -oE '([0-9]*)x([0-9]*)[[:space:]]'` >> list-sizes-names.txt ;done
show all file resolutions in a directory
for i in *.*; do ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 $i; done #list_sizes
weight
find file weight
find * -maxdepth 2 -type f -exec du -sh {} \; > list-weight.txt
find directory weight
find * -maxdepth 2 -type d -exec du -sh {} \; > list-weight-dir.txt
alternate find directory weight (not sorted)
du -h -d 1 . > dir-weight.txt
FPS
find fps (in fractions; needs division in post)
ffprobe -v 0 -of csv=p=0 -select_streams v:0 -show_entries stream=r_frame_rate *.*
or (in frames; is troublesome in bash due to special chars)
ffmpeg -i * 2>&1 | sed -n "s/.*, \(.*\) fp.*/\1/p"
for i in *.*; do ffmpeg -i * 2>&1 | sed -n "s/.*, \(.*\) fp.*/\1/p"; done > list-fps.txt
reference:
https://linuxize.com/post/how-get-size-of-file-directory-linux/
https://www.baeldung.com/linux/concatenate-files-separator
https://www.tecmint.com/check-linux-disk-usage-of-files-and-directories