This commit is contained in:
holzi1005 2025-01-07 16:59:23 +01:00
parent 59547f3fb7
commit 63219bc01d

View file

@ -12,14 +12,14 @@ inotifywait -m /out -e close_write |
chunk_size="$CHUNK_SIZE"
id="${FILE%.mp4}"
file_size=$(busybox stat -c%s "$file_path")
file_size=$(/bin/stat -c%s "$file_path")
num_chunks=$(( (file_size + chunk_size - 1) / chunk_size ))
i=0
while [ $i -lt $num_chunks ]; do
offset=$(( i * chunk_size ))
dd if="$file_path" bs=$chunk_size skip=$i count=1 2>/dev/null | \
curl --location "$UPLOAD_URL" \
/bin/dd if="$file_path" bs=$chunk_size skip=$i count=1 2>/dev/null | \
/urs/bin/curl --location "$UPLOAD_URL" \
--header "Authorization: Bearer $AUTH_TOKEN" \
--form "recording_id=${id}" \
--form "chunk_index=${i}" \