-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbatch_transcode_h22_ffv1_v210_start.sh
More file actions
executable file
·52 lines (42 loc) · 2.57 KB
/
batch_transcode_h22_ffv1_v210_start.sh
File metadata and controls
executable file
·52 lines (42 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash -x
# =========================================================
# Launcher script for H22 batch_transcode_h22_ffv1_v210.py
# =========================================================
date_FULL=$(date +'%Y-%m-%d - %T')
function control {
boole=$(cat "${CONTROL_JSON}" | grep "power_off_all" | awk -F': ' '{print $2}')
if [ "$boole" = false, ] ; then
echo "Control json requests script exit immediately" >> "${LOG}"
echo 'Control json requests script exit immediately'
exit 0
fi
}
# Control check inserted into code
control
# Local variables from environmental vars
# transcode_path1="${H22_PATH1}prores/SASE/source"
# transcode_path2="${H22_PATH2}prores/NEFA/source"
# transcode_path3="${H22_PATH2}prores/YFA/source"
transcode_path4="${H22_PATH_Q10}lto/v210/NWFA/source"
dump_to="$GIT_TRANSCODE"
log_path="$SCRIPT_LOG"
python_script="$SCRIPT_FFV1_V210"
# replace list to ensure clean data
rm "${dump_to}batch_transcode_h22_ffv1_v210_dump_text.txt"
touch "${dump_to}batch_transcode_h22_ffv1_v210_dump_text.txt"
# Command to build MKV list from two v210 paths containing multiple archive folders
# find "${transcode_path1}" -maxdepth 1 -mindepth 1 -name "*.mkv" -mmin +30 >> "${dump_to}batch_transcode_h22_ffv1_v210_dump_text.txt"
# find "${transcode_path2}" -maxdepth 1 -mindepth 1 -name "*.mkv" -mmin +30 >> "${dump_to}batch_transcode_h22_ffv1_v210_dump_text.txt"
# find "${transcode_path3}" -maxdepth 1 -mindepth 1 -name "*.mkv" -mmin +30 >> "${dump_to}batch_transcode_h22_ffv1_v210_dump_text.txt"
find "${transcode_path4}" -maxdepth 1 -mindepth 1 -name "*.mkv" -mmin +30 >> "${dump_to}batch_transcode_h22_ffv1_v210_dump_text.txt"
if [ -s "${dump_to}batch_transcode_h22_ffv1_v210_dump_text.txt" ]
then
echo " ========================= SHELL SCRIPT LAUNCH ========================== $date_FULL" >> "${log_path}batch_transcode_h22_ffv1_v210.log"
echo " == Start batch_transcode_h22_ffv1_v210 in $transcode_path1 and $transcode_path2 == " >> "${log_path}batch_transcode_h22_ffv1_v210.log"
echo " == Shell script creating dump_text.txt output for parallel launch of Python scripts == " >> "${log_path}batch_transcode_h22_ffv1_v210.log"
echo " == Launching GNU parallel to run muliple Python3 scripts for encoding == " >> "${log_path}batch_transcode_h22_ffv1_v210.log"
grep '/mnt/' "${dump_to}batch_transcode_h22_ffv1_v210_dump_text.txt" | sort -u | parallel --jobs 16 "${PYENV} ${python_script} {}"
echo " ========================= SHELL SCRIPT END ========================== $date_FULL" >> "${log_path}batch_transcode_h22_ffv1_v210.log"
else
exit 1
fi