Chez moi :
FILE "data.wav" WAVE
TRACK 01 AUDIO
TITLE "Souvenir"
PERFORMER "Nicky & Nicky"
INDEX 01 00:00:00
TRACK 02 AUDIO
TITLE "Say Yes (ZYX Extended Version)"
PERFORMER "Digitalo"
INDEX 01 01:09:00
TRACK 03 AUDIO
TITLE "Everything You Love"
PERFORMER "Chip Chip"
INDEX 01 07:48:00
TRACK 04 AUDIO
TITLE "It's You"
PERFORMER "Sheila Steward"
INDEX 01 10:49:00
1 "Souvenir"
PERFORMER "Nicky & Nicky"
2 "Say Yes (ZYX Extended Version)"
PERFORMER "Digitalo"
3 "Everything You Love"
PERFORMER "Chip Chip"
4 "It's You"
PERFORMER "Sheila Steward"
voici la sortie terminale:
./stream_bis_test
Mes radios:
1. Oldies_but_goldies
2. Radio_Italo4You
3. Radio_BOB
Entrer votre choix, 0 pour quitter: 2
Connecting...
stream: Radio Italo4you
server name: SHOUTcast/
declared bitrate: 256
meta interval: 8192
[skipping... ] Nicky & Nicky - Souvenir [ 2,10M]
[ripping... ] Digitalo - Say Yes (ZYX Extended Version) [ 12,19M]
[ripping... ] Chip Chip - Everything You Love [ 5,52M]
[ripping... ] Sheila Steward - It's You [ 1,70M]
^Cshutting down
bye..
ffmpeg version n4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.1.0 (GCC)
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-omx --enable-shared --enable-version3
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
[mp3 @ 0x5626a254d5c0] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'sr_program_2020_11_07_12_32_46.mp3':
Duration: 00:11:56.80, start: 0.000000, bitrate: 256 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 256 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mp3 (mp3float) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, wav, to 'data.wav':
Metadata:
ISFT : Lavf58.45.100
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
Metadata:
encoder : Lavc58.91.100 pcm_s16le
[mp3float @ 0x5626a2575580] invalid new backstep -1s/s speed= 407x
size= 123620kB time=00:11:57.60 bitrate=1411.2kbits/s speed= 400x
video:0kB audio:123620kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000062%
712
ffmpeg version n4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.1.0 (GCC)
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-omx --enable-shared --enable-version3
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from 'data.wav':
Metadata:
encoder : Lavf58.45.100
Duration: 00:11:57.61, bitrate: 1411 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, wav, to 'data-fade.wav':
Metadata:
ISFT : Lavf58.45.100
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
Metadata:
encoder : Lavc58.91.100 pcm_s16le
size= 123620kB time=00:11:57.60 bitrate=1411.2kbits/s speed=1.42e+03x
video:0kB audio:123620kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000062%
Durée sur 4 titres :
à la lecture sur le cue :
Bon, le script retouché :
#!/bin/bash
#### Help
# https://stackoverflow.com/questions/23577516/how-to-replace-all-matches-with-an-incrementing-number-in-bash
# https://unix.stackexchange.com/questions/23545/insert-a-new-line-after-every-n-lines
# How can I add lines to document every four lines?
# https://unix.stackexchange.com/questions/474172/how-can-i-add-lines-to-document-every-four-lines
#### Radios.
while true; do
echo "Mes radios:"
echo -e "\e[3;32m1. \033[m \e[3;94mOldies_but_goldies\033[m"
echo -e "\e[3;32m2. \033[m \e[3;94mRadio_Italo4You\033[m"
echo -e "\e[3;32m3. \033[m \e[3;94mRadio_BOB\033[m"
echo
echo -n "Entrer votre choix, 0 pour quitter: "
read -r choice
echo
if [[ $choice == 1 ]]; then
stream=http://orion.shoutca.st:8248/stream
folder=Oldies_but_goldies
fi
if [[ $choice == 2 ]]; then
stream=http://s0.radiohost.pl:8018/stream
folder=Radio_Italo4You
fi
if [[ $choice == 3 ]]; then
stream=http://bob.hoerradar.de/radiobob-acdc-mp3-mq
folder=Radio_BOB
fi
case $choice in
"$choice")
mkdir -p "$folder/$(date +%d-%m-%y) à $(date +%H:%M:%S)"
( cd "$folder/$(date +%d-%m-%y) à $(date +%H:%M:%S)" || exit
mpv $stream >/dev/null 2>&1 | \
streamripper $stream -a -A -s \
--codeset-filesys=UTF-8 \
--codeset-id3=ISO-8859-15 \
--codeset-id3=ISO-8859-15 \
--codeset-relay=ISO-8859-15 \
-u FreeAmp/2.x
filename_cue=$(find . -type f -name "*.cue" | xargs --null basename)
filename=$(find . -type f \( -name "*.mp3" -o -name "*.ogg" -o -name "*.flac" \) -print0 | xargs --null basename)
tr -d '\0' < "$filename_cue" > data.cue
sed -i -e '1 s/^.*$/FILE "data.wav" WAVE/' data.cue
rm -f "$filename_cue"
ffmpeg -i "$filename" -acodec pcm_s16le -ar 44100 data.wav
rm -f "$filename"
grep -e 'TITLE' -e 'PERFORMER' data.cue | \
awk '{for(x=1;x<=NF;x++)if($x~/TITLE/){sub(/TITLE/,++i)}}1' | \
sed '0~2G' \
>> "Titres.txt"
#### Pour le fondu en ouverture et fermeture sur le single wave.
times=()
_t=$(ffmpeg -i data.wav 2>&1 | awk '/^ Duration/ { split($2, A, ":"); split(A[3], B, "."); print 3600*A[1] + 60*A[2] + B[1] - 5 }')
times+=("$_t")
echo "${times[@]}" | sed 's/ /+/g' | bc
ffmpeg -i data.wav \
-acodec pcm_s16le -ar 44100 \
-af "afade=t=in:ss=0:d=1,afade=t=out:st=${times[*]} :d=4" \
data-fade.wav
rm -f data.wav
mv data-fade.wav data.wav
)
break
;;
0)
echo "OK, see you!"
exit 1
;;
*)
echo "Invalid input..."
echo "Quit"
exit 1
;;
esac
done
Dernière modification par Anonyme (07-11-2020 12:57:08)