Continue new wrapper

This commit is contained in:
AlexPresso
2022-05-10 16:25:51 +02:00
parent 346e3f06d9
commit f91fc69f23

View File

@@ -5,10 +5,9 @@
######################### #########################
pid=$$ pid=$$
movie="" defaultargs=${@:3}
hlsslice=${@: -1} hlsslice=${@: -1}
hlsroot=${hlsslice::-14} hlsroot=${hlsslice::-14}
metadata=$(cat "$hlsroot/video_metadata")
stderrfile="/tmp/ffmpeg-$pid.stderr" stderrfile="/tmp/ffmpeg-$pid.stderr"
######################### #########################
@@ -26,25 +25,20 @@ function info() {
# ENTRYPOINT # ENTRYPOINT
######################### #########################
movie=$(echo $metadata | jq -r ".path") movie=$(cat "$hlsroot/video_metadata" | jq -r ".path")
profile=$(echo $metadata | jq -r ".profile_value" | sed -e 's/--/-/g')
seektime=$(cat "$hlsroot/seek_time" || echo 00000)
audiotrack=$(cat "$hlsroot/audio_id")
info "========================================[$pid]" info "========================================[$pid]"
info "MOVIE: $movie" info "MOVIE: $movie"
info "HLS_ROOT: $hlsroot" info "HLS_ROOT: $hlsroot"
info "PROFILE: $profile" info "DEFAULT_ARGS: ${defaultargs[*]}"
info "START_TIME: $seektime"
info "AUDIO_ID: $audiotrack"
declare -a args=("-i" "'$movie'") declare -a args=(
"-i" "'$movie'"
args+=("${profile[@]}") "${defaultargs[@]}"
args+=("-ss" "$seektime") "$hlsroot/slice-%05d.ts"
args+=("$hlsroot/slice-%05d.ts") )
info "ARGS: ${args[*]}" info "ARGS: ${args[*]}"
/var/packages/ffmpeg/target/bin/ffmpeg "${args[@]}" 2> $stderrfile & /var/packages/ffmpeg/target/bin/ffmpeg "${args[@]}" 2> $stderrfile &
rm $stderrfile #rm $stderrfile