Moribus

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Moribus

  1. If you want to monitor file progress. Here is a REALLY ugly script I came up with. #!/bin/bash # # A simple loop to display what file handbrake is working on and what the current status is. # ############################################################################################################################# # #Example line: #[autovideoconverter] Starting conversion of '/watch/Hercules (1997).mkv' (935bbed22b281c68d6e1840256fede3f) using preset 'Fast 480p30'... # #Find the last line in the log that contains the word "Starting" #Set AWK's Field seperator to a single quote and print fields 2 and 4 to extract the movie title and preset #Set AWK's Field seperator to a "/" and print the 3rd field to remove the path before the movie title #Tail the log and print the last line to provide status. #Final output: #Hercules (1997).mkv Fast 480p30 #Encoding: 99.65 % (152.25 fps, avg 121.85 fps, ETA 00h00m04s) #Encoding: 99.74 % (138.93 fps, avg 121.84 fps, ETA 00h00m03s) #Encoding: 99.86 % (126.57 fps, avg 121.85 fps, ETA 00h00m02s) #Encoding: 99.97 % (122.81 fps, avg 121.85 fps, ETA 00h00m01s) #Encoding: 99.97 % (122.81 fps, avg 121.85 fps, ETA 00h00m01s) # #Last line will be encoding status or one of the below #Change detected in watch folder '/watch'. #Processing watch folder '/watch'... #Waiting 5 seconds before processing '/watch/Hercules (1997).mkv'... #Skipping '/watch/Hercules (1997).mkv': currently being copied. #Starting conversion of '/watch/Hercules (1997).mkv' (935bbed22b281c68d6e1840256fede3f) using preset 'Fast 480p30'... #1 title(s) to process. #Conversion ended successfully. #Removed /watch/Hercules (1997).mkv'. #Watch folder '/watch' processing terminated. ############################################################################################################################ while : do clear docker logs HandBrake | grep Starting | tail -1 | awk -F"'" '{print $2,$4}' | awk -F"/" '{print $3}' docker logs HandBrake --tail 1 | cut -d' ' -f 2- sleep 5 docker logs HandBrake --tail 1 | cut -d' ' -f 2- sleep 5 docker logs HandBrake --tail 1 | cut -d' ' -f 2- sleep 5 docker logs HandBrake --tail 1 | cut -d' ' -f 2- sleep 5 done
  2. I am sure someone can find a better way to accomplish this, but here is a script I cooked up for monitoring the progress of handbrakes watch folder. Please forgive how crude it is, but I am still new to linux and I am not a programmer. The script itself is quite small I just included documentation to at least attempt to explain what I have this script doing. #!/bin/bash # # A simple loop to display what file handbrake is working on and what the current status is. # ############################################################################################################################# # #Example line: #[autovideoconverter] Starting conversion of '/watch/Hercules (1997).mkv' (935bbed22b281c68d6e1840256fede3f) using preset 'Fast 480p30'... # #Find the last line in the log that contains the word "Starting" #Set AWK's Field seperator to a single quote and print fields 2 and 4 to extract the movie title and preset #Set AWK's Field seperator to a "/" and print the 3rd field to remove the path before the movie title #Tail the log and print the last line to provide status. #Final output: #Hercules (1997).mkv Fast 480p30 #Encoding: 99.65 % (152.25 fps, avg 121.85 fps, ETA 00h00m04s) #Encoding: 99.74 % (138.93 fps, avg 121.84 fps, ETA 00h00m03s) #Encoding: 99.86 % (126.57 fps, avg 121.85 fps, ETA 00h00m02s) #Encoding: 99.97 % (122.81 fps, avg 121.85 fps, ETA 00h00m01s) #Encoding: 99.97 % (122.81 fps, avg 121.85 fps, ETA 00h00m01s) # #Last line will be encoding status or one of the below #Change detected in watch folder '/watch'. #Processing watch folder '/watch'... #Waiting 5 seconds before processing '/watch/Hercules (1997).mkv'... #Skipping '/watch/Hercules (1997).mkv': currently being copied. #Starting conversion of '/watch/Hercules (1997).mkv' (935bbed22b281c68d6e1840256fede3f) using preset 'Fast 480p30'... #1 title(s) to process. #Conversion ended successfully. #Removed /watch/Hercules (1997).mkv'. #Watch folder '/watch' processing terminated. ############################################################################################################################ while : do clear docker logs HandBrake | grep Starting | tail -1 | awk -F"'" '{print $2,$4}' | awk -F"/" '{print $3}' docker logs HandBrake --tail 1 | cut -d' ' -f 2- sleep 5 docker logs HandBrake --tail 1 | cut -d' ' -f 2- sleep 5 docker logs HandBrake --tail 1 | cut -d' ' -f 2- sleep 5 docker logs HandBrake --tail 1 | cut -d' ' -f 2- sleep 5 done