From 7ff2fdf34364797060aac7b2b63fb5a1a666a3e8 Mon Sep 17 00:00:00 2001 From: "James P. Ketrenos" Date: Mon, 23 Sep 2019 19:24:08 -0700 Subject: [PATCH] Moved assets/cmd_* to assets/commands/* Signed-off-by: James P. Ketrenos --- assets/{cmd_1N_transcode => commands/1N_transcode} | 4 ++-- assets/{cmd_decode => commands/decode} | 4 ++-- assets/{cmd_encode => commands/encode} | 10 ++++------ assets/{cmd_transcode => commands/transcode} | 4 ++-- assets/entry | 10 +++++----- 5 files changed, 15 insertions(+), 17 deletions(-) rename assets/{cmd_1N_transcode => commands/1N_transcode} (96%) rename assets/{cmd_decode => commands/decode} (96%) rename assets/{cmd_encode => commands/encode} (90%) rename assets/{cmd_transcode => commands/transcode} (96%) diff --git a/assets/cmd_1N_transcode b/assets/commands/1N_transcode similarity index 96% rename from assets/cmd_1N_transcode rename to assets/commands/1N_transcode index 88b1440..f1aa43b 100755 --- a/assets/cmd_1N_transcode +++ b/assets/commands/1N_transcode @@ -1,8 +1,8 @@ #!/bin/bash PARAM=$0 -# Strip path and cmd_ prefix from command name -PARAM=${PARAM##*/cmd_} +# Strip path from command name +PARAM=${PARAM##*/} short() { echo "Transcode AVC (H.264) to to streams: 1280x720@5Mbps and 60FPS@4Mbps" diff --git a/assets/cmd_decode b/assets/commands/decode similarity index 96% rename from assets/cmd_decode rename to assets/commands/decode index 5bb2bc0..b1f92e8 100755 --- a/assets/cmd_decode +++ b/assets/commands/decode @@ -1,8 +1,8 @@ #!/bin/bash PARAM=$0 -# Strip path and cmd_ prefix from command name -PARAM=${PARAM##*/cmd_} +# Strip path from command name +PARAM=${PARAM##*/} short() { echo "Decode AVC (H.264) video and save as YUV 420P raw file" diff --git a/assets/cmd_encode b/assets/commands/encode similarity index 90% rename from assets/cmd_encode rename to assets/commands/encode index b0ffcc6..e091dd4 100755 --- a/assets/cmd_encode +++ b/assets/commands/encode @@ -1,11 +1,11 @@ #!/bin/bash PARAM=$0 -# Strip path and cmd_ prefix from command name -PARAM=${PARAM##*/cmd_} +# Strip path from command name +PARAM=${PARAM##*/} short() { - echo "Encode 10 frames from YUV420 raw input as H264 with 5Mbps using VBR mode" + echo "Encode frames from YUV420 raw input as H264 with 5Mbps using VBR mode" } help() { @@ -37,11 +37,10 @@ ffmpeg command: -f rawvideo \ -pix_fmt yuv420p \ -s:v 176x144 \ - -i /media/\$(IN_FILE} \ + -i /media/\${IN_FILE} \ -vf hwupload=extra_hw_frames=64,format=qsv \ -c:v h264_qsv \ -b:v 5M \ - -frames:v 10 \ -y \ /media/\${OUT_FILE} @@ -130,6 +129,5 @@ ffmpeg \ -vf hwupload=extra_hw_frames=64,format=qsv \ -c:v h264_qsv \ -b:v 5M \ - -frames:v 10 \ -y \ /media/${OUT_FILE} diff --git a/assets/cmd_transcode b/assets/commands/transcode similarity index 96% rename from assets/cmd_transcode rename to assets/commands/transcode index 8b0543d..cf5249c 100755 --- a/assets/cmd_transcode +++ b/assets/commands/transcode @@ -1,8 +1,8 @@ #!/bin/bash PARAM=$0 -# Strip path and cmd_ prefix from command name -PARAM=${PARAM##*/cmd_} +# Strip path from command name +PARAM=${PARAM##*/} short() { echo "Transcode AVC (H.264) to HEVC (H.265) with 5Mbps using VBR" diff --git a/assets/entry b/assets/entry index d3158fb..5cfe05a 100755 --- a/assets/entry +++ b/assets/entry @@ -15,7 +15,7 @@ request=${arguments[0]} arguments=("${arguments[@]:1}") commands=(info help version ffmpeg shell) -commands+=(/assets/cmd_*) +commands+=(/assets/commands/*) . /assets/SOLUTION . /assets/MANIFEST @@ -87,7 +87,7 @@ $(name) Commands: EOF for cmd in ${commands[@]}; do - printf " %-15s %s\n" ${cmd##*/cmd_} "$(${cmd} --short)" + printf " %-15s %s\n" ${cmd##*/} "$(${cmd} --short)" done } @@ -122,13 +122,13 @@ for option in "${options[@]}"; do esac done -[ ! -f /assets/cmd_$request ] && { +[ ! -f /assets/commands/$request ] && { echo "'${request}' is not a recognized command." } || { (( $debug )) && { - /bin/bash -x /assets/cmd_$request "${arguments[@]}" + /bin/bash -x /assets/commands/$request "${arguments[@]}" } || { - /assets/cmd_$request "${arguments[@]}" + /assets/commands/$request "${arguments[@]}" } exit $? }