for i in *.flac; do ffmpeg -i "&i" "${i%.*}.mp3"; done; rm *.flac
>>109066389Here's my interactive bash script for cleaning up .mkvs with niche audio formats to clean & portable .aac audio for .mp4 containers :)#!/bin/bash#MacOS only# Ask the user to choose a file (Call Finder GUI dialog)SOURCE_FILE=$(osascript -e 'POSIX path of (choose file with prompt "Select a video file (.mp4 or .mkv) to convert")')# Remove trailing newline just in caseSOURCE_FILE=$(echo "$SOURCE_FILE" | tr -d '\n')# If cancelledif [[ -z "$SOURCE_FILE" ]]; then echo "No file selected. Exiting." exit 1fi# Ask if source audio is 7.1, 5.1, 2.1 or 2.0echo "Is the source audio 7.1, 5.1, 2.1 or 2.0?"select AUDIO_TYPE in "7.1" "5.1" "2.1" "2.0" "Cancel"; do case $AUDIO_TYPE in "7.1") AC_CHANNELS=8; break ;; "5.1") AC_CHANNELS=6; break ;; "2.1") AC_CHANNELS=3; break ;; "2.0") AC_CHANNELS=2; break ;; "Cancel") echo "Cancelled."; exit 0 ;; *) echo "Invalid choice. Please choose 1, 2, 3 or 4." ;; esacdone# Get file name without extensionBASENAME=$(basename "$SOURCE_FILE")NAME_NO_EXT="${BASENAME%.*}"# Create output filename in the same folder, always .mp4OUTPUT_FILE="$(dirname "$SOURCE_FILE")/${NAME_NO_EXT}-aac.mp4"# Run ffmpeg command - copy video, convert audio to AAC, force .mp4 containerffmpeg -i "$SOURCE_FILE" -c:v copy -c:a aac -b:a 896k -ac "$AC_CHANNELS" -movflags +faststart "$OUTPUT_FILE"# Notify when doneif [[ $? -eq 0 ]]; then osascript -e 'display notification "Audio conversion completed" with title "FFmpeg"' echo "Conversion completed: $OUTPUT_FILE"else osascript -e 'display notification "Conversion failed" with title "FFmpeg"' echo "Conversion failed."fi
>>109066389for f in *.flac; do oggenc -q 6 "$f" && rm -- "$f"; done
>>109066389why would anyone destroy a flac filejust kys
beet import
>>109066389Shitty script. If the ffmpeg conversion fails, you still unconditionally remove the original source.
>>109066389>&iThis won't even work! You get a bunch of missing file errors then delete all the flacs anyway
>>109066477>bashfiltered and retarded>>109066795>losing sourceyour fault for not having backup nigger
>>109066389audiophile bros wtf is he doing
>>109066389find . -name "*.flac" -follow -print0 | parallel -0 ffmpeg -i {} -b:a 128k {.}.opus -y
>>109066389>128kbps MP3b..b..based?
>>109066389>>109066642based *.flac destroyers
>>109066389I look like this and run this
>>109068968that is so cool. gotta keep those cores cookin'
>>109066389bash syntax is so bad
kill all chuds