drewThomasson
commited on
Commit
•
8ed3516
1
Parent(s):
b16e08c
Upload 3 files
Browse files- tools/convert_24khz_to_16khz.bat +27 -0
- tools/convert_to_gif.sh +43 -0
tools/convert_24khz_to_16khz.bat
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@echo off
|
2 |
+
setlocal enabledelayedexpansion
|
3 |
+
|
4 |
+
:: Set the path to FFmpeg
|
5 |
+
set FFmpegPath="C:\path\to\ffmpeg.exe"
|
6 |
+
|
7 |
+
:: Root directory to start the search
|
8 |
+
set RootDir=.
|
9 |
+
|
10 |
+
:: Step 1: Find and delete _22khz.wav files
|
11 |
+
for /r "%RootDir%" %%F in (*_22khz.wav) do (
|
12 |
+
echo Deleting "%%F"
|
13 |
+
del "%%F"
|
14 |
+
)
|
15 |
+
|
16 |
+
:: Step 2: Find _24khz.wav files and convert them to _16khz.wav
|
17 |
+
for /r "%RootDir%" %%F in (*_24khz.wav) do (
|
18 |
+
set "InputFile=%%F"
|
19 |
+
set "OutputFile=%%~dpF%%~nF"
|
20 |
+
set "OutputFile=!OutputFile:_24khz=_16khz!.wav"
|
21 |
+
|
22 |
+
echo Converting "!InputFile!" to "!OutputFile!"
|
23 |
+
%FFmpegPath% -i "!InputFile!" -ar 16000 "!OutputFile!"
|
24 |
+
)
|
25 |
+
|
26 |
+
echo Done!
|
27 |
+
pause
|
tools/convert_to_gif.sh
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
# Help function
|
4 |
+
function show_help() {
|
5 |
+
echo "Usage: $0 <input_video>"
|
6 |
+
echo
|
7 |
+
echo "This script converts a video file to a GIF with the following properties:"
|
8 |
+
echo " - Frame rate: 10 fps"
|
9 |
+
echo " - Resolution: 1728x1028 (with padding if needed)"
|
10 |
+
echo
|
11 |
+
echo "Example:"
|
12 |
+
echo " $0 input.mov"
|
13 |
+
echo
|
14 |
+
echo "The output file will be named 'output.gif'."
|
15 |
+
}
|
16 |
+
|
17 |
+
# Check if help is requested
|
18 |
+
if [[ "$1" == "-h" || "$1" == "--h" || "$1" == "-help" || "$1" == "--help" ]]; then
|
19 |
+
show_help
|
20 |
+
exit 0
|
21 |
+
fi
|
22 |
+
|
23 |
+
# Check if the input file is provided
|
24 |
+
if [ "$#" -ne 1 ]; then
|
25 |
+
echo "Error: Missing input file."
|
26 |
+
echo "Use --help for usage information."
|
27 |
+
exit 1
|
28 |
+
fi
|
29 |
+
|
30 |
+
# Input video file
|
31 |
+
input_file="$1"
|
32 |
+
output_file="output.gif"
|
33 |
+
|
34 |
+
# Conversion parameters
|
35 |
+
fps=10
|
36 |
+
width=1728
|
37 |
+
height=1028
|
38 |
+
|
39 |
+
# Convert the video to GIF
|
40 |
+
ffmpeg -i "$input_file" -vf "fps=$fps,scale=${width}:${height}:force_original_aspect_ratio=decrease,pad=${width}:${height}:(ow-iw)/2:(oh-ih)/2" "$output_file"
|
41 |
+
|
42 |
+
echo "Conversion complete! Output file: $output_file"
|
43 |
+
|