Skip to content

Commit

Permalink
Maj GitHub Sync - Tuesday, 23 January, 2024 08:01:32 AM PST
Browse files Browse the repository at this point in the history
  • Loading branch information
majal committed Jan 23, 2024
1 parent 17d99c0 commit 888b6b1
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions SL/sldl_nwt
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,24 @@ process_lang() {
cat "${data_toprocess}" | \
while read data; do

url="$(echo ${data} | cut -d , -f 2 | tr -d '"')"
echo "${url}" | grep -Eq "^https.*(mp4|m4v)$" || continue
file_save="${dir_lang}/"$(basename "${url}")

while [ $(pgrep -c ffmpeg) -ge ${parallel_ffmpeg} ]; do
# while [ $(ps aux | grep /usr/bin/ffmpeg | tr -s ' ' | cut -d ' ' -f 8 | grep -c '^R') -ge ${parallel_ffmpeg} ]; do
sleep 2
sleep 1
done

url="$(echo ${data} | cut -d , -f 2 | tr -d '"')"
wget -qO "${file_save}.recode" -o /dev/null "${url}" && \
nice -n 19 /usr/bin/chrt -i 0 "${ff}" ${ff_banner} -i "${file_save}.recode" -vf "${filter}" ${ff_opts_post} "${file_save}" && \
echo "${data}" >> "${data_processed}" && \
rm "${file_save}.recode" &

echo "${url}" | grep -Eq "^https.*(mp4|m4v)$" || continue

file_save="${dir_lang}/"$(basename "${url}")
sleep 1 # Allow time for wget to write save file, prevent race condition on parallel_ffmpeg count

nice -n 19 /usr/bin/chrt -i 0 "${ff}" ${ff_banner} -i "${url}" -vf "${filter}" ${ff_opts_post} "${file_save}" && echo "${data}" >> "${data_processed}" &
while [ $(ls "${dir_lang}/"*.recode 2>/dev/null | wc -l) -ge ${parallel_ffmpeg} ]; do
sleep 1
done

done

Expand Down

0 comments on commit 888b6b1

Please sign in to comment.