Greetings,
I'm working on a script that will perform a transcode using FFMpeg, and I'm encountering some strange behavior.
Location
The script.sh
The list.txt content
Run the script
The output
The result of run the script
The error is in the file called 'file2.wav'
I don't understand why FFMpeg in the second file cuts off the initial 'f' from the name...
The list.txt file has no strange characters, I have checked it several times and even created it from the 'vi' editor.
I'm using the default shell
Thanks for your advice in advance.
I'm working on a script that will perform a transcode using FFMpeg, and I'm encountering some strange behavior.
Location
$ pwd
Code:
/tmp/test
The script.sh
$ cat script.sh
Code:
#!/bin/sh
WORKDIR='/tmp/test'
cd "${WORKDIR}" || exit 1
# Bucle
while read -r FILENAME; do
if [ -e ./"${FILENAME}" ]; then
echo "Transcoding ${FILENAME}. . ."
ffmpeg -y -hide_banner -i "${FILENAME}" -c:a libvorbis -ar 44100 "${FILENAME}".ogg
else
echo "File ${FILENAME} not found"
fi
done < ./list.txt
exit 0
The list.txt content
$ cat list.txt
Code:
file1.wav
file2.wav
file3.wav
Run the script
$ ./script.sh
The output
Code:
Transcoding file1.wav. . .
[aist#0:0/pcm_s16le @ 0x2ad11385a300] Guessed Channel Layout: mono
Input #0, wav, from 'file1.wav':
Duration: 00:00:12.53, bitrate: 768 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 1 channels, s16, 768 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le (native) -> vorbis (libvorbis))
Press [q] to stop, [?] for help
Output #0, ogg, to 'file1.wav.ogg':
Metadata:
encoder : Lavf60.16.100
Stream #0:0: Audio: vorbis, 44100 Hz, mono, fltp
Metadata:
encoder : Lavc60.31.102 libvorbis
[out#0/ogg @ 0x2ad113858340] video:0kB audio:103kB subtitle:0kB other streams:0kB global headers:3kB muxing overhead: 4.170636%
size= 107kB time=00:00:12.50 bitrate= 69.9kbits/s speed= 166x
File ile2.wav not found
Transcoding file3.wav. . .
[aist#0:0/pcm_s16le @ 0x2f629be5a300] Guessed Channel Layout: mono
Input #0, wav, from 'file3.wav':
Duration: 00:00:12.53, bitrate: 768 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 1 channels, s16, 768 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le (native) -> vorbis (libvorbis))
Press [q] to stop, [?] for help
Output #0, ogg, to 'file3.wav.ogg':
Metadata:
encoder : Lavf60.16.100
Stream #0:0: Audio: vorbis, 44100 Hz, mono, fltp
Metadata:
encoder : Lavc60.31.102 libvorbis
[out#0/ogg @ 0x2f629be58340] video:0kB audio:103kB subtitle:0kB other streams:0kB global headers:3kB muxing overhead: 4.170636%
size= 107kB time=00:00:12.50 bitrate= 69.9kbits/s speed= 166x
The result of run the script
$ ls *.ogg
Code:
file1.wav.ogg file3.wav.ogg
The error is in the file called 'file2.wav'
Code:
File ile2.wav not found
I don't understand why FFMpeg in the second file cuts off the initial 'f' from the name...
The list.txt file has no strange characters, I have checked it several times and even created it from the 'vi' editor.
I'm using the default shell
$ echo $SHELL
Code:
/bin/sh
Thanks for your advice in advance.