• Activity
  • Votes
  • Comments
  • New
  • All activity
  • Showing only topics in ~comp with the tag "scripting". Back to normal view / Search all groups
    1. Detect video noise using FFMpeg

      Hi Folks I've been working on an autoconversion Bash script to pick up videos and convert them to AV1. Yes, I know converting a source to another source means degradation and yada yada yada, but...

      Hi Folks

      I've been working on an autoconversion Bash script to pick up videos and convert them to AV1. Yes, I know converting a source to another source means degradation and yada yada yada, but it's something I can live with as most of my sources are of very high quality to begin with, and I'm going for space-saving. Plus, my eyes aren't what they once were.

      The conversion into AV1 I'm mostly happy with. I'm currently going through some old 90s shows which are of lesser quality, so they would need a little help to look better with AV1 by adding some natural film grain, else AV1 makes them look a little bit too clean.

      I can easily pop into the script and enable film grain in the variables, or add in a simple option, but that's boring and tedious. Why do that when we can automate the world :)

      Where I have got to is using the signalstats filter. The issue I have is I don't know how to analyse it's output enough to work out whether I should or shouldn't enable film grain or not. I know it's subjective either way.

      Does anyone have experience with this? The output per frame looks like:

      frame:1438 pts:59977 pts_time:59.977
      lavfi.signalstats.YMIN=0
      lavfi.signalstats.YLOW=0
      lavfi.signalstats.YAVG=60.6913
      lavfi.signalstats.YHIGH=149
      lavfi.signalstats.YMAX=239
      lavfi.signalstats.UMIN=91
      lavfi.signalstats.ULOW=108
      lavfi.signalstats.UAVG=121.955
      lavfi.signalstats.UHIGH=131
      lavfi.signalstats.UMAX=148
      lavfi.signalstats.VMIN=124
      lavfi.signalstats.VLOW=128
      lavfi.signalstats.VAVG=134.535
      lavfi.signalstats.VHIGH=146
      lavfi.signalstats.VMAX=154
      lavfi.signalstats.SATMIN=0
      lavfi.signalstats.SATLOW=0
      lavfi.signalstats.SATAVG=9.74682
      lavfi.signalstats.SATHIGH=27
      lavfi.signalstats.SATMAX=43
      lavfi.signalstats.HUEMED=147
      lavfi.signalstats.HUEAVG=162.949
      lavfi.signalstats.YDIF=0.737433
      lavfi.signalstats.UDIF=0.642897
      lavfi.signalstats.VDIF=0.162755
      lavfi.signalstats.YBITDEPTH=8
      lavfi.signalstats.UBITDEPTH=8
      lavfi.signalstats.VBITDEPTH=8

      I'm happy to analyse a random 60-second segment and then grab an average from a couple of these outputs, but I'm not sure if this is a good method or not. I'm asked a couple of the biggest LLMs, they have come back with older ways that no longer exist in ffmpeg 7.1.

      I'm trying not to use too many other pieces of software in this script. The dependencies are fairly simple with ffmpeg, awk, grep, etc., the kind of thing you get on nearly every distro of Linux. Any thoughts and/or ideas?

      8 votes
    2. PowersHell and graph - setting SharePoint folder permissions help

      Hello folks Recently we've been playing with Powershell and having to move on to graph to do all the fancy things we want to achieve. MS forced this when they suddenly decided the MSOnline module...

      Hello folks

      Recently we've been playing with Powershell and having to move on to graph to do all the fancy things we want to achieve. MS forced this when they suddenly decided the MSOnline module was retired and things stopped working.

      We've built a great New Team with SharePoint and including folders script. One of the things we used to do with the PNP module is set folder permission on two of the folders in a new team, making them only accessible to Owners. How the devil does one achieve this with Graph?

      Any pointers would be grand.

      8 votes
    3. What are some startup scripts you have on your daily driver?

      In the everlasting quest to customize my laptop and make my life easier, I'm looking for any ideas for startup scripts to run on user login. Personally, I don't know how to write bash scripts yet...

      In the everlasting quest to customize my laptop and make my life easier, I'm looking for any ideas for startup scripts to run on user login.
      Personally, I don't know how to write bash scripts yet and unfortunately I won't have time to pick it up on the side in the near future seeing as how I'm swamped between my studies and work—nevertheless, it's always nice to see how others might have under the hood for future tinkering :)
      I'm currently running i3-gaps on Arch Linux. I have a few programs that I like to run inside i3's config file (Polybar, firefox, file manager, Thunderbird) every time I start i3.
      The problem that I seem to have is that I lack imagination. I don't know the potential of what else I could be doing with startup scripts, so I'm turning to Tildes to see what you guys might have.

      6 votes
    4. Share your useful shell scripts!

      Disclaimer: Don't run scripts offered to you by randos unless you trust them or review it yourself I use this constantly, it just plays music by file name, specifically matching *NAME* with...

      Disclaimer: Don't run scripts offered to you by randos unless you trust them or review it yourself

      I use this constantly, it just plays music by file name, specifically matching *NAME* with case-insensitivity. Requires bash 4.something.

      # play -ln SONGS ...
      # -l don't shuffle
      # -n dry run
      mpv_args="--no-audio-display --no-resume-playback \
                --msg-level=all=status --term-osd-bar"
      shopt -s globstar nullglob nocaseglob
      
      shuffle=true
      dry=false
      while [[ "$1" == -* ]]; do
          if [[ "$1" == "-l" ]]; then 
              shuffle=false
          elif [[ "$1" == "-n" ]]; then
              dry=true
          fi
      
          shift 1
      done
      
      if [[ "$shuffle" == true ]]; then
          mpv_args="--shuffle $mpv_args"
      fi
      
      songs=()
      while [[ "$#" != 0 ]]; do
          songs+=( ~/music/**/**/*"$1"*.* ) # change this to match your music directory layout
          shift 1                                               # could probably use find instead
      done
      
      if [[ "$dry" == true ]]; then
          if [[ "$shuffle" == true ]]; then
              printf "Shuffle mode is on\n"
          fi
      
          for song in "${songs[@]}"; do
              printf "$song\n"
          done
        
          exit
      fi
      
      if [[ ${#songs[@]} != 0 ]]; then
          mpv $mpv_args "${songs[@]}"
      fi
      

      I make no claims to the quality of this but it works!

      36 votes