Compare commits

..

No commits in common. "141dbd97e01e68178d90749bac621af5713fa6bf" and "6209a087d77235d57fda0bae03dd52c827dc7256" have entirely different histories.

2 changed files with 3 additions and 16 deletions

1
.gitignore vendored
View File

@ -5,5 +5,4 @@
positions.txt positions.txt
volume.txt volume.txt
.claude/ .claude/
audio/

View File

@ -74,10 +74,9 @@ for f in "${inputs[@]}"; do
[ -z "$dur" ] && die "Could not read duration of: $f" [ -z "$dur" ] && die "Could not read duration of: $f"
dur_ms=$(awk "BEGIN { printf \"%d\", $dur * 1000 }") dur_ms=$(awk "BEGIN { printf \"%d\", $dur * 1000 }")
# Chapter title from filename (strip path, extension, and leading track number) # Chapter title from filename (strip path and extension)
title=$(basename "$f") title=$(basename "$f")
title="${title%.*}" title="${title%.*}"
title=$(echo "$title" | sed 's/^[0-9][0-9]*[[:space:]._-]*//')
end_ms=$((cumulative_ms + dur_ms)) end_ms=$((cumulative_ms + dur_ms))
cat >> "$metadata" <<EOF cat >> "$metadata" <<EOF
@ -91,21 +90,10 @@ EOF
cumulative_ms=$end_ms cumulative_ms=$end_ms
done done
# --- Extract album art from first input (if present) ---
art="$tmpdir/cover.jpg"
ffmpeg -v error -i "${inputs[0]}" -an -vcodec copy "$art" 2>/dev/null || true
# --- Concatenate --- # --- Concatenate ---
if [ -f "$art" ]; then ffmpeg -y -f concat -safe 0 -i "$concat_list" -i "$metadata" \
ffmpeg -y -f concat -safe 0 -i "$concat_list" -i "$metadata" -i "$art" \ -map_metadata 1 -c copy -movflags +faststart "$output" 2>&1
-map 0:a -map 2:v -map_metadata 1 -c copy \
-disposition:v:0 attached_pic -movflags +faststart "$output" 2>&1
else
ffmpeg -y -f concat -safe 0 -i "$concat_list" -i "$metadata" \
-map 0:a -map_metadata 1 -c copy -movflags +faststart "$output" 2>&1
fi
# --- Summary --- # --- Summary ---