Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]

jobs:
shellcheck:
name: ShellCheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
scandir: "."
severity: warning

syntax:
name: Bash syntax check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Check bash syntax
run: |
find . -name "*.sh" -print0 | xargs -0 -I{} bash -n {}
echo "All scripts passed syntax check"
8 changes: 5 additions & 3 deletions vc1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ source .probe.rc

# Set up hardware acceleration based on input codec and GPU availability
if [[ $GPU_AVAILABLE == true ]]; then
# shellcheck disable=SC2154 # vCodec sourced from .probe.rc
case "$vCodec" in
h264|avc)
hwaccel_args="-hwaccel cuda -c:v h264_cuvid"
Expand Down Expand Up @@ -108,17 +109,18 @@ EOF
$aMap -c:a libfdk_aac -b:a 160k "$baseName"_recode.mp4

# Check if encoding was successful
if [[ $? -eq 0 ]]; then
STATUS=$?
if [[ $STATUS -eq 0 ]]; then
echo "Encoding completed successfully!"
echo "Output file: ${baseName}_recode.mp4"

# Optional: Display file size comparison
if command -v ls &> /dev/null; then
echo "Original size: $(ls -lh "$inFile" | awk '{print $5}')"
echo "New size: $(ls -lh "${baseName}_recode.mp4" | awk '{print $5}')"
fi
else
echo "Encoding failed with exit code: $?"
echo "Encoding failed with exit code: $STATUS"
exit 1
fi

Expand Down
Loading
Loading