decided to actually go through git as was doing too many scripts... uses ffmpeg to transcode a list of files into AV1 format.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
950 B

1 year ago
1 year ago
  1. #!/bin/bash
  2. #Use ffprobe to find .mkv files with h264 encoding:
  3. ffBin="/usr/bin/"
  4. parentDir=$1
  5. destDir="/tmp/transcode/"
  6. mkdir -p "$destDir"
  7. while read -r line;
  8. do
  9. codec="$( $ffBin/ffprobe -loglevel error -select_streams v:0 -show_entries \
  10. stream=codec_name -of default=noprint_wrappers=1:nokey=1 "$line" )"
  11. if [ $? -eq 0 ]
  12. then
  13. if [[ $codec == *"264"* ]]
  14. then
  15. #Sometimes scp has issues with double spaces?
  16. if [[ "$line" == *" "* ]]
  17. then
  18. repLine="$( echo "$line" | sed "s/ //g" )"
  19. mv "$line" "$repLine"
  20. if [ -f "$( dirname "$line" )/$( basename "$line" .mkv ).nfo" ]
  21. then
  22. mv "$( dirname "$line" )/$( basename "$line" .mkv ).nfo" "$( dirname "$repLine" )/$( basename "$repLine" .mkv ).nfo"
  23. fi
  24. line=$repLine
  25. unset repLine
  26. fi
  27. echo "$line" >>"$destDir/list.txt"
  28. fi
  29. else
  30. echo "NON-ZERO for $line"
  31. fi
  32. done<<<"$( find "$parentDir" -name "*.mkv" -print )"