Skip to main content

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

  1. run script
  2. replace \t./ with \n./
  3. copy list into sheets (vertical)
  4. re-copy transposed (horizontal)
  5. re-paste into txt & replace \t\t with \n
  6. paste into a clean sheet
    -maxdepth 2 = folder recursiveness ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 -i {} = WxH
    ffprobe -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 recalc)
    du -m {} = size (can add 'h' e.g. '-mh' but makes unit variable)
    echo = makes 2 newlines after each item

    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)

    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://stackoverflow.com/questions/8015888/linux-script-to-find-all-video-file-extensions-and-file-sizes

    https://linuxize.com/post/how-get-size-of-file-directory-linux/

    https://www.baeldung.com/linux/concatenate-files-separator