-
-
Notifications
You must be signed in to change notification settings - Fork 6
push macos silicon compatible impd #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
It seems this version has to be checked out on top of v0.8, not on the current HEAD. So as it seems, Macos doesn't support |
I think I was just using an older version of impd, or not sure why I changed that. You should be able to just change it to the current. Yeah MacOS doesn't support those. There might be ways around that, didn't care to investigate because it wasn't necessary for my needs. Note that I made this to work entirely to my own standard which I use with a batch process script because as mentioned I just don't use immersionpod etc. the only thing I care about is being able to rip my entire library as condensed audio. Sorry that it isn't like a rewrite in order to maintain the exact same functionality. I was really just trying to get it to make proper use of Apple's new silicon. Basically, I run this which runs impd in the same dir. It iterates over my entire library and condenses everything. So the version issue would be due to me using this bash script on top of it. #!/bin/bash
# Set up trap for graceful exit
trap 'echo -e "\nScript terminated by user"; exit 0' SIGINT SIGTERM
# Check for existing .ogg files
if ls newaudio/*.ogg >/dev/null 2>&1; then
echo "WARNING: Audio files already exist in newaudio folder!"
echo "Please remove or move existing .ogg files before running this script."
echo "Press 'q' to exit..."
while read -r -n1 key; do
if [[ $key == "q" ]]; then
echo
exit 0
fi
done
fi
# Initialize counter and exit flag
count=1
exit_flag=0
# Set up background key check
read_input() {
while read -r -n1 key; do
if [[ $key == "q" ]]; then
exit_flag=1
kill -SIGINT $
break
fi
done
}
read_input &
input_pid=$!
# Count total files
total=$(ls -1 newvideos/* | wc -l)
echo "Starting audio extraction for $total files..."
echo "-------------------------------------------"
# Process each video file
for video in newvideos/*; do
# Check exit flag
if [ $exit_flag -eq 1 ]; then
break
fi
# Get first 10 chars of filename
basename=$(basename "$video")
prefix=${basename:0:10}
# Create output filename
outfile="newaudio/${prefix}${count}.ogg"
# Show progress
echo -e "\nProcessing file $count of $total: $basename -> ${prefix}${count}.ogg"
# Run impd command with local path
./impd condense -i "$video" -o "$outfile"
# Check if command was successful
if [ $? -eq 0 ]; then
echo "DONE: $basename"
else
echo "ERROR processing: $basename"
fi
# Increment counter
((count++))
done
# Clean up background process
kill $input_pid 2>/dev/null
echo "-------------------------------------------"
echo "All files processed successfully!"
echo "Press 'q' to exit..."
# Wait for 'q' key
while read -r -n1 key; do
if [[ $key == "q" ]]; then
echo
break
fi
done |
Sometime in my free time, I could clone impd and go through and rewrite it again to support Apple Silicon whilst trying as best as I can to preserve the original functionality. That said, most of the stuff I changed I think is precisely why it is so much faster. As I doubt it's all just up to the fact that Apple is using an ARM chip. |
I think we could try to abstract operations like |
328b5c9
to
3df09d0
Compare
replaced |
we can define a function like this to abstract all grep calls _grep() {
if [[ "$(uname)" == "Darwin" ]]; then
if command -v ggrep >/dev/null 2>&1; then
ggrep "$@"
else
echo "ggrep is not installed." >&2
exit 1
fi
else
grep "$@"
fi
} |
3df09d0
to
745f780
Compare
handle missing xdg-user-dir
745f780
to
f024d95
Compare
Description - What does this PR do?
Provides an impd that works on MacOS Apple Silicon.
My performance is 34x higher than using the original impd. The application features all work flawlessly on MacOS Silicon, eg. M4 Pro/Max.
Note that you will need to downoad ffmpeg eg. with homebrew.
Related: #16