More music fixes
This commit is contained in:
18
Dockerfile
18
Dockerfile
@@ -21,13 +21,25 @@ RUN apk add --no-cache \
|
|||||||
python3
|
python3
|
||||||
|
|
||||||
# Download and extract Weatherscan music
|
# Download and extract Weatherscan music
|
||||||
RUN mkdir -p /music && \
|
RUN mkdir -p /music /music-temp && \
|
||||||
echo "Downloading Weatherscan music..." && \
|
echo "Downloading Weatherscan music..." && \
|
||||||
wget -O /tmp/weatherscan.zip "https://archive.org/compress/weatherscancompletecollection/formats=OGG%20VORBIS&file=/weatherscancompletecollection.zip" && \
|
wget -O /tmp/weatherscan.zip "https://archive.org/compress/weatherscancompletecollection/formats=OGG%20VORBIS&file=/weatherscancompletecollection.zip" && \
|
||||||
echo "Extracting OGG files..." && \
|
echo "Extracting OGG files..." && \
|
||||||
unzip -j /tmp/weatherscan.zip "*.ogg" -d /music && \
|
unzip -j /tmp/weatherscan.zip "*.ogg" -d /music-temp && \
|
||||||
echo "Music files extracted: $(ls -1 /music/*.ogg | wc -l) files" && \
|
|
||||||
rm /tmp/weatherscan.zip && \
|
rm /tmp/weatherscan.zip && \
|
||||||
|
echo "Repairing and validating music files (fast parallel processing)..." && \
|
||||||
|
cd /music-temp && \
|
||||||
|
JOBS=0 && MAX_JOBS=12 && \
|
||||||
|
for file in *.ogg; do \
|
||||||
|
while [ $JOBS -ge $MAX_JOBS ]; do \
|
||||||
|
wait -n 2>/dev/null && JOBS=$((JOBS-1)) || JOBS=0; \
|
||||||
|
done; \
|
||||||
|
(ffmpeg -y -v error -i "$file" -c:a libvorbis -b:a 128k "/music/$file" 2>&1 && echo "✓ $file" || echo "✗ $file") & \
|
||||||
|
JOBS=$((JOBS+1)); \
|
||||||
|
done && \
|
||||||
|
wait && \
|
||||||
|
cd / && rm -rf /music-temp && \
|
||||||
|
echo "Music files ready: $(ls -1 /music/*.ogg 2>/dev/null | wc -l) files" && \
|
||||||
echo "Weatherscan music setup complete!"
|
echo "Weatherscan music setup complete!"
|
||||||
|
|
||||||
# Set Puppeteer to use installed Chromium
|
# Set Puppeteer to use installed Chromium
|
||||||
|
|||||||
@@ -86,12 +86,18 @@ async function streamHandler(req, res, { useMusic = false, musicPath, lateGeocod
|
|||||||
|
|
||||||
ffmpegProcess.stderr.on('data', (data) => {
|
ffmpegProcess.stderr.on('data', (data) => {
|
||||||
const message = data.toString();
|
const message = data.toString();
|
||||||
// Log important warnings about audio discontinuities or errors
|
// Suppress expected warnings from corrupted audio frames and HLS piping
|
||||||
|
if (message.includes('failed to delete old segment') ||
|
||||||
|
message.includes('Error submitting packet to decoder') ||
|
||||||
|
message.includes('Invalid data found when processing input')) {
|
||||||
|
// These are expected with some music files - FFmpeg handles them gracefully
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Log important warnings about stream issues
|
||||||
if (message.includes('Non-monotonous DTS') ||
|
if (message.includes('Non-monotonous DTS') ||
|
||||||
message.includes('Application provided invalid') ||
|
message.includes('Application provided invalid') ||
|
||||||
message.includes('past duration') ||
|
message.includes('past duration') ||
|
||||||
message.includes('Error while decoding stream') ||
|
message.includes('Error while decoding stream')) {
|
||||||
message.includes('Invalid data found')) {
|
|
||||||
console.warn(`FFmpeg warning: ${message.trim()}`);
|
console.warn(`FFmpeg warning: ${message.trim()}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user