47 lines
1.4 KiB
Bash
Executable File
47 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
# Test upload script - Creates a small test video and uploads it
|
|
|
|
set -e # Exit on error
|
|
|
|
echo "=================================================="
|
|
echo "OBS R2 Uploader - Test Upload"
|
|
echo "=================================================="
|
|
echo ""
|
|
|
|
# Get the directory where this script is located
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
|
|
|
|
cd "$PROJECT_DIR"
|
|
|
|
# Check if ffmpeg is installed (for creating test video)
|
|
if command -v ffmpeg &> /dev/null; then
|
|
echo "Creating test video with ffmpeg..."
|
|
|
|
# Create tests directory if it doesn't exist
|
|
mkdir -p tests
|
|
|
|
# Generate a 5-second test video
|
|
ffmpeg -f lavfi -i testsrc=duration=5:size=1280x720:rate=30 \
|
|
-f lavfi -i sine=frequency=1000:duration=5 \
|
|
-c:v libx264 -c:a aac -pix_fmt yuv420p \
|
|
tests/test-video.mp4 -y
|
|
|
|
TEST_VIDEO="tests/test-video.mp4"
|
|
echo "✓ Test video created: $TEST_VIDEO"
|
|
else
|
|
echo "⚠ ffmpeg not found - cannot create test video"
|
|
echo "Please provide a video file manually:"
|
|
echo " ./scripts/upload.sh /path/to/your/video.mp4"
|
|
exit 1
|
|
fi
|
|
|
|
echo ""
|
|
echo "Uploading test video..."
|
|
./scripts/upload.sh "$TEST_VIDEO"
|
|
|
|
echo ""
|
|
echo "=================================================="
|
|
echo "Test upload complete!"
|
|
echo "=================================================="
|