Characters randomly disappearring from the output of “find”












1















I'm having a really strange behaviour of find, he is "eating" path characters, can't understand why.



This is using a simple shell script to remux some mp4 files using ffmpeg.



Here is the script:



#!/bin/sh

video_remux_dir=/mnt/zbig/media/Movies/Edición/@video-remux

find "$video_remux_dir" -type f -name "*.mp4" -newermt "1990-01-01 00:00:00" -print | while read -r mp4file ; do

echo "$mp4file"

mp4file_basename=${mp4file%.*}

mp4file_basename_out=${mp4file_basename}_out.mp4

echo "$mp4file_basename"

echo "/usr/local/bin/ffmpeg -loglevel warning -i $mp4file -map_metadata -1 -c copy $mp4file_basename_out && mv -f $mp4file_basename_out $mp4file && touch -t 199001010000.00 $mp4file"

/usr/local/bin/ffmpeg -loglevel warning -i "$mp4file" -map_metadata -1 -c copy "$mp4file_basename_out" && mv -f "$mp4file_basename_out" "$mp4file" && touch -t 199001010000.00 "$mp4file"


done


And here the results:



[root@host /mnt/zbig/media/Movies/Edición/@video-remux]# ls -l
total 2326858
-rw-r--r-- 1 vicmarto staff 81050772 Jul 18 2018 1 El habitante del huevo.mp4
-rw-r--r-- 1 vicmarto staff 88078466 Jul 18 2018 10 La tierra de los Tu-Tuts.mp4
-rw-r--r-- 1 vicmarto staff 113562985 Jul 18 2018 11 La fiesta del conejo.mp4
-rw-r--r-- 1 vicmarto staff 106768685 Jul 18 2018 12 Las ciénagas de Crom.mp4
-rw-r--r-- 1 vicmarto staff 87797468 Jul 18 2018 13 El bosque musical.mp4
-rw-r--r-- 1 vicmarto staff 84534410 Jul 18 2018 14 La torre de Mat-Mor.mp4
-rw-r--r-- 1 vicmarto staff 77658927 Jul 18 2018 15 El laberinto de los horrores.mp4
-rw-r--r-- 1 vicmarto staff 97850829 Jul 18 2018 16 El navío de los espectros.mp4
-rw-r--r-- 1 vicmarto staff 104649374 Jul 18 2018 17 El antídoto de Brich.mp4
-rw-r--r-- 1 vicmarto staff 90052253 Jul 18 2018 18 Viaje al país de los Krunis.mp4
-rw-r--r-- 1 vicmarto staff 104629388 Jul 18 2018 19 La cueva de las flores.mp4
-rw-r--r-- 1 vicmarto staff 79170697 Jul 18 2018 2 Las perlas mágicas.mp4
-rw-r--r-- 1 vicmarto staff 111549054 Jul 18 2018 20 Brug, el comesetas.mp4
-rw-r--r-- 1 vicmarto staff 103279764 Jul 18 2018 21 La fiesta de la Luna.mp4
-rw-r--r-- 1 vicmarto staff 83907134 Jul 18 2018 22 Ruadan, el cazador de guerreros.mp4
-rw-r--r-- 1 vicmarto staff 89014058 Jul 18 2018 23 El regreso de Miedo.mp4
-rw-r--r-- 1 vicmarto staff 100884376 Jul 18 2018 24 La bolsa mágica.mp4
-rw-r--r-- 1 vicmarto staff 83778207 Jul 18 2018 25 Los Iquel.mp4
-rw-r--r-- 1 vicmarto staff 87219648 Jul 18 2018 26 La fiesta de Poti-Poti.mp4
-rw-r--r-- 1 vicmarto staff 80171207 Jul 18 2018 3 Iris, la princesa del Lago de Hielo.mp4
-rw-r--r-- 1 vicmarto staff 96901309 Jul 18 2018 4 Orzek, Señor de los Pantanos.mp4
-rw-r--r-- 1 vicmarto staff 84608498 Jul 18 2018 5 El guardián del bosque triste.mp4
-rw-r--r-- 1 vicmarto staff 120853125 Jul 18 2018 6 El brujo Chiprel.mp4
-rw-r--r-- 1 vicmarto staff 88559155 Jul 18 2018 7 El desierto de Zeth.mp4
-rw-r--r-- 1 vicmarto staff 100888377 Jul 18 2018 8 El hijo de Randal.mp4
-rw-r--r-- 1 vicmarto staff 93489946 Jul 18 2018 9 La máquina de granizo.mp4




[root@host /mnt/zbig/media/Movies/Edición/@video-remux]# /home/vicmarto/scripts/avi-mp4-mpeg-remux.sh
/mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal.mp4
big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4
big/media/Movies/Edición/@video-remux/19 La cueva de las flores
/usr/local/bin/ffmpeg -loglevel warning -i big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4 -map_metadata -1 -c copy big/media/Movies/Edición/@video-remux/19 La cueva de las flores_out.mp4 && mv -f big/media/Movies/Edición/@video-remux/19 La cueva de las flores_out.mp4 big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4 && touch -t 199001010000.00 big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4
big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores.mp4
g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos.mp4
g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos
/usr/local/bin/ffmpeg -loglevel warning -i g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos.mp4 -map_metadata -1 -c copy g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos_out.mp4 && mv -f g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos_out.mp4 g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos.mp4 && touch -t 199001010000.00 g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos.mp4
g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti.mp4
zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth.mp4
zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth
/usr/local/bin/ffmpeg -loglevel warning -i zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth.mp4 -map_metadata -1 -c copy zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth_out.mp4 && mv -f zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth_out.mp4 zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth.mp4 && touch -t 199001010000.00 zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth.mp4
zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts.mp4
big/media/Movies/Edición/@video-remux/11 La fiesta del conejo.mp4
big/media/Movies/Edición/@video-remux/11 La fiesta del conejo
/usr/local/bin/ffmpeg -loglevel warning -i big/media/Movies/Edición/@video-remux/11 La fiesta del conejo.mp4 -map_metadata -1 -c copy big/media/Movies/Edición/@video-remux/11 La fiesta del conejo_out.mp4 && mv -f big/media/Movies/Edición/@video-remux/11 La fiesta del conejo_out.mp4 big/media/Movies/Edición/@video-remux/11 La fiesta del conejo.mp4 && touch -t 199001010000.00 big/media/Movies/Edición/@video-remux/11 La fiesta del conejo.mp4
big/media/Movies/Edición/@video-remux/11 La fiesta del conejo.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel.mp4
g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4
g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna
/usr/local/bin/ffmpeg -loglevel warning -i g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4 -map_metadata -1 -c copy g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna_out.mp4 && mv -f g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna_out.mp4 g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4 && touch -t 199001010000.00 g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4
g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros.mp4
big/media/Movies/Edición/@video-remux/17 El antídoto de Brich.mp4
big/media/Movies/Edición/@video-remux/17 El antídoto de Brich
/usr/local/bin/ffmpeg -loglevel warning -i big/media/Movies/Edición/@video-remux/17 El antídoto de Brich.mp4 -map_metadata -1 -c copy big/media/Movies/Edición/@video-remux/17 El antídoto de Brich_out.mp4 && mv -f big/media/Movies/Edición/@video-remux/17 El antídoto de Brich_out.mp4 big/media/Movies/Edición/@video-remux/17 El antídoto de Brich.mp4 && touch -t 199001010000.00 big/media/Movies/Edición/@video-remux/17 El antídoto de Brich.mp4
big/media/Movies/Edición/@video-remux/17 El antídoto de Brich.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor.mp4
ig/media/Movies/Edición/@video-remux/13 El bosque musical.mp4
ig/media/Movies/Edición/@video-remux/13 El bosque musical
/usr/local/bin/ffmpeg -loglevel warning -i ig/media/Movies/Edición/@video-remux/13 El bosque musical.mp4 -map_metadata -1 -c copy ig/media/Movies/Edición/@video-remux/13 El bosque musical_out.mp4 && mv -f ig/media/Movies/Edición/@video-remux/13 El bosque musical_out.mp4 ig/media/Movies/Edición/@video-remux/13 El bosque musical.mp4 && touch -t 199001010000.00 ig/media/Movies/Edición/@video-remux/13 El bosque musical.mp4
ig/media/Movies/Edición/@video-remux/13 El bosque musical.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo.mp4
ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros.mp4
ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros
/usr/local/bin/ffmpeg -loglevel warning -i ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros.mp4 -map_metadata -1 -c copy ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros_out.mp4 && mv -f ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros_out.mp4 ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros.mp4 && touch -t 199001010000.00 ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros.mp4
ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica.mp4
big/media/Movies/Edición/@video-remux/23 El regreso de Miedo.mp4
big/media/Movies/Edición/@video-remux/23 El regreso de Miedo
/usr/local/bin/ffmpeg -loglevel warning -i big/media/Movies/Edición/@video-remux/23 El regreso de Miedo.mp4 -map_metadata -1 -c copy big/media/Movies/Edición/@video-remux/23 El regreso de Miedo_out.mp4 && mv -f big/media/Movies/Edición/@video-remux/23 El regreso de Miedo_out.mp4 big/media/Movies/Edición/@video-remux/23 El regreso de Miedo.mp4 && touch -t 199001010000.00 big/media/Movies/Edición/@video-remux/23 El regreso de Miedo.mp4
big/media/Movies/Edición/@video-remux/23 El regreso de Miedo.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste.mp4
ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas.mp4
ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas
/usr/local/bin/ffmpeg -loglevel warning -i ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas.mp4 -map_metadata -1 -c copy ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas_out.mp4 && mv -f ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas_out.mp4 ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas.mp4 && touch -t 199001010000.00 ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas.mp4
ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom.mp4
g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo.mp4
g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo
/usr/local/bin/ffmpeg -loglevel warning -i g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo.mp4 -map_metadata -1 -c copy g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo_out.mp4 && mv -f g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo_out.mp4 g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo.mp4 && touch -t 199001010000.00 g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo.mp4
g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis.mp4
g/media/Movies/Edición/@video-remux/20 Brug, el comesetas.mp4
g/media/Movies/Edición/@video-remux/20 Brug, el comesetas
/usr/local/bin/ffmpeg -loglevel warning -i g/media/Movies/Edición/@video-remux/20 Brug, el comesetas.mp4 -map_metadata -1 -c copy g/media/Movies/Edición/@video-remux/20 Brug, el comesetas_out.mp4 && mv -f g/media/Movies/Edición/@video-remux/20 Brug, el comesetas_out.mp4 g/media/Movies/Edición/@video-remux/20 Brug, el comesetas.mp4 && touch -t 199001010000.00 g/media/Movies/Edición/@video-remux/20 Brug, el comesetas.mp4
g/media/Movies/Edición/@video-remux/20 Brug, el comesetas.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel.mp4
g/media/Movies/Edición/@video-remux/1 El habitante del huevo.mp4
g/media/Movies/Edición/@video-remux/1 El habitante del huevo
/usr/local/bin/ffmpeg -loglevel warning -i g/media/Movies/Edición/@video-remux/1 El habitante del huevo.mp4 -map_metadata -1 -c copy g/media/Movies/Edición/@video-remux/1 El habitante del huevo_out.mp4 && mv -f g/media/Movies/Edición/@video-remux/1 El habitante del huevo_out.mp4 g/media/Movies/Edición/@video-remux/1 El habitante del huevo.mp4 && touch -t 199001010000.00 g/media/Movies/Edición/@video-remux/1 El habitante del huevo.mp4
g/media/Movies/Edición/@video-remux/1 El habitante del huevo.mp4: No such file or directory




[root@host /mnt/zbig/media/Movies/Edición/@video-remux]# ls -l
total 2354890
-rw-r--r-- 1 vicmarto staff 81050772 Jul 18 2018 1 El habitante del huevo.mp4
-rw-r--r-- 1 root staff 88078342 Jan 1 1990 10 La tierra de los Tu-Tuts.mp4
-rw-r--r-- 1 vicmarto staff 113562985 Jul 18 2018 11 La fiesta del conejo.mp4
-rw-r--r-- 1 root staff 106768564 Jan 1 1990 12 Las ciénagas de Crom.mp4
-rw-r--r-- 1 vicmarto staff 87797468 Jul 18 2018 13 El bosque musical.mp4
-rw-r--r-- 1 root staff 84534275 Jan 1 1990 14 La torre de Mat-Mor.mp4
-rw-r--r-- 1 root staff 77658799 Jan 1 1990 15 El laberinto de los horrores.mp4
-rw-r--r-- 1 root staff 97850685 Jan 1 1990 16 El navío de los espectros.mp4
-rw-r--r-- 1 vicmarto staff 104649374 Jul 18 2018 17 El antídoto de Brich.mp4
-rw-r--r-- 1 root staff 90052127 Jan 1 1990 18 Viaje al país de los Krunis.mp4
-rw-r--r-- 1 vicmarto staff 104629388 Jul 18 2018 19 La cueva de las flores.mp4
-rw-r--r-- 1 vicmarto staff 79170697 Jul 18 2018 2 Las perlas mágicas.mp4
-rw-r--r-- 1 vicmarto staff 111549054 Jul 18 2018 20 Brug, el comesetas.mp4
-rw-r--r-- 1 vicmarto staff 103279764 Jul 18 2018 21 La fiesta de la Luna.mp4
-rw-r--r-- 1 vicmarto staff 83907134 Jul 18 2018 22 Ruadan, el cazador de guerreros.mp4
-rw-r--r-- 1 vicmarto staff 89014058 Jul 18 2018 23 El regreso de Miedo.mp4
-rw-r--r-- 1 root staff 100884244 Jan 1 1990 24 La bolsa mágica.mp4
-rw-r--r-- 1 root staff 83778081 Jan 1 1990 25 Los Iquel.mp4
-rw-r--r-- 1 root staff 87219510 Jan 1 1990 26 La fiesta de Poti-Poti.mp4
-rw-r--r-- 1 vicmarto staff 80171207 Jul 18 2018 3 Iris, la princesa del Lago de Hielo.mp4
-rw-r--r-- 1 vicmarto staff 96901309 Jul 18 2018 4 Orzek, Señor de los Pantanos.mp4
-rw-r--r-- 1 root staff 84608380 Jan 1 1990 5 El guardián del bosque triste.mp4
-rw-r--r-- 1 root staff 120852993 Jan 1 1990 6 El brujo Chiprel.mp4
-rw-r--r-- 1 vicmarto staff 88559155 Jul 18 2018 7 El desierto de Zeth.mp4
-rw-r--r-- 1 root staff 100888244 Jan 1 1990 8 El hijo de Randal.mp4
-rw-r--r-- 1 root staff 93489824 Jan 1 1990 9 La máquina de granizo.mp4
[root@host /mnt/zbig/media/Movies/Edición/@video-remux]#


Some files are remuxed, some not. Can't find a patter!



Looking at the multiples "No such file or directory"



What is wrong?










share|improve this question

























  • To save us searching, could you add a list of which ones were missed?

    – Philip Couling
    Mar 4 at 16:36











  • @StéphaneChazelas your title edit grossly deviates from the original intent and is misleading, since the characters removed are not random, but always from the start of the path, which suggest that read had bit more than it could chew, probably confused by length in bytes vs length in characters (that ó from Edición is probably the culprit).

    – Uncle Billy
    Mar 4 at 17:17













  • @UncleBilly, 0, 4, 5, 6, 7 or 8 bytes are being removed seemingly randomly from the start of each line of the output of find (with no observable relation between that number and the number of non-ASCII characters in those lines). bash's read has no limit on the size of the line it reads (like in any Bourne-like shell). It reads one byte at a time until it finds a newline, it only needs to decode bytes as characters for the IFS processing here, but that happens after the finding of the line delimiter.

    – Stéphane Chazelas
    Mar 4 at 17:31











  • @StéphaneChazelas not from the start of each line; only from some lines -- I may be actually on the wrong path, but I don't see anything like Overwrite ? [y/N] from ffmpeg in the OP's output (which should've appeared if ffmpeg was trying to read from stdin), and I vaguely remember a similar bug with bash's read` reading too much.

    – Uncle Billy
    Mar 4 at 17:34













  • @UncleBilly, note the 0 in my list of numbers ;-)

    – Stéphane Chazelas
    Mar 4 at 17:34
















1















I'm having a really strange behaviour of find, he is "eating" path characters, can't understand why.



This is using a simple shell script to remux some mp4 files using ffmpeg.



Here is the script:



#!/bin/sh

video_remux_dir=/mnt/zbig/media/Movies/Edición/@video-remux

find "$video_remux_dir" -type f -name "*.mp4" -newermt "1990-01-01 00:00:00" -print | while read -r mp4file ; do

echo "$mp4file"

mp4file_basename=${mp4file%.*}

mp4file_basename_out=${mp4file_basename}_out.mp4

echo "$mp4file_basename"

echo "/usr/local/bin/ffmpeg -loglevel warning -i $mp4file -map_metadata -1 -c copy $mp4file_basename_out && mv -f $mp4file_basename_out $mp4file && touch -t 199001010000.00 $mp4file"

/usr/local/bin/ffmpeg -loglevel warning -i "$mp4file" -map_metadata -1 -c copy "$mp4file_basename_out" && mv -f "$mp4file_basename_out" "$mp4file" && touch -t 199001010000.00 "$mp4file"


done


And here the results:



[root@host /mnt/zbig/media/Movies/Edición/@video-remux]# ls -l
total 2326858
-rw-r--r-- 1 vicmarto staff 81050772 Jul 18 2018 1 El habitante del huevo.mp4
-rw-r--r-- 1 vicmarto staff 88078466 Jul 18 2018 10 La tierra de los Tu-Tuts.mp4
-rw-r--r-- 1 vicmarto staff 113562985 Jul 18 2018 11 La fiesta del conejo.mp4
-rw-r--r-- 1 vicmarto staff 106768685 Jul 18 2018 12 Las ciénagas de Crom.mp4
-rw-r--r-- 1 vicmarto staff 87797468 Jul 18 2018 13 El bosque musical.mp4
-rw-r--r-- 1 vicmarto staff 84534410 Jul 18 2018 14 La torre de Mat-Mor.mp4
-rw-r--r-- 1 vicmarto staff 77658927 Jul 18 2018 15 El laberinto de los horrores.mp4
-rw-r--r-- 1 vicmarto staff 97850829 Jul 18 2018 16 El navío de los espectros.mp4
-rw-r--r-- 1 vicmarto staff 104649374 Jul 18 2018 17 El antídoto de Brich.mp4
-rw-r--r-- 1 vicmarto staff 90052253 Jul 18 2018 18 Viaje al país de los Krunis.mp4
-rw-r--r-- 1 vicmarto staff 104629388 Jul 18 2018 19 La cueva de las flores.mp4
-rw-r--r-- 1 vicmarto staff 79170697 Jul 18 2018 2 Las perlas mágicas.mp4
-rw-r--r-- 1 vicmarto staff 111549054 Jul 18 2018 20 Brug, el comesetas.mp4
-rw-r--r-- 1 vicmarto staff 103279764 Jul 18 2018 21 La fiesta de la Luna.mp4
-rw-r--r-- 1 vicmarto staff 83907134 Jul 18 2018 22 Ruadan, el cazador de guerreros.mp4
-rw-r--r-- 1 vicmarto staff 89014058 Jul 18 2018 23 El regreso de Miedo.mp4
-rw-r--r-- 1 vicmarto staff 100884376 Jul 18 2018 24 La bolsa mágica.mp4
-rw-r--r-- 1 vicmarto staff 83778207 Jul 18 2018 25 Los Iquel.mp4
-rw-r--r-- 1 vicmarto staff 87219648 Jul 18 2018 26 La fiesta de Poti-Poti.mp4
-rw-r--r-- 1 vicmarto staff 80171207 Jul 18 2018 3 Iris, la princesa del Lago de Hielo.mp4
-rw-r--r-- 1 vicmarto staff 96901309 Jul 18 2018 4 Orzek, Señor de los Pantanos.mp4
-rw-r--r-- 1 vicmarto staff 84608498 Jul 18 2018 5 El guardián del bosque triste.mp4
-rw-r--r-- 1 vicmarto staff 120853125 Jul 18 2018 6 El brujo Chiprel.mp4
-rw-r--r-- 1 vicmarto staff 88559155 Jul 18 2018 7 El desierto de Zeth.mp4
-rw-r--r-- 1 vicmarto staff 100888377 Jul 18 2018 8 El hijo de Randal.mp4
-rw-r--r-- 1 vicmarto staff 93489946 Jul 18 2018 9 La máquina de granizo.mp4




[root@host /mnt/zbig/media/Movies/Edición/@video-remux]# /home/vicmarto/scripts/avi-mp4-mpeg-remux.sh
/mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal.mp4
big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4
big/media/Movies/Edición/@video-remux/19 La cueva de las flores
/usr/local/bin/ffmpeg -loglevel warning -i big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4 -map_metadata -1 -c copy big/media/Movies/Edición/@video-remux/19 La cueva de las flores_out.mp4 && mv -f big/media/Movies/Edición/@video-remux/19 La cueva de las flores_out.mp4 big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4 && touch -t 199001010000.00 big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4
big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores.mp4
g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos.mp4
g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos
/usr/local/bin/ffmpeg -loglevel warning -i g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos.mp4 -map_metadata -1 -c copy g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos_out.mp4 && mv -f g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos_out.mp4 g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos.mp4 && touch -t 199001010000.00 g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos.mp4
g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti.mp4
zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth.mp4
zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth
/usr/local/bin/ffmpeg -loglevel warning -i zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth.mp4 -map_metadata -1 -c copy zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth_out.mp4 && mv -f zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth_out.mp4 zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth.mp4 && touch -t 199001010000.00 zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth.mp4
zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts.mp4
big/media/Movies/Edición/@video-remux/11 La fiesta del conejo.mp4
big/media/Movies/Edición/@video-remux/11 La fiesta del conejo
/usr/local/bin/ffmpeg -loglevel warning -i big/media/Movies/Edición/@video-remux/11 La fiesta del conejo.mp4 -map_metadata -1 -c copy big/media/Movies/Edición/@video-remux/11 La fiesta del conejo_out.mp4 && mv -f big/media/Movies/Edición/@video-remux/11 La fiesta del conejo_out.mp4 big/media/Movies/Edición/@video-remux/11 La fiesta del conejo.mp4 && touch -t 199001010000.00 big/media/Movies/Edición/@video-remux/11 La fiesta del conejo.mp4
big/media/Movies/Edición/@video-remux/11 La fiesta del conejo.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel.mp4
g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4
g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna
/usr/local/bin/ffmpeg -loglevel warning -i g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4 -map_metadata -1 -c copy g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna_out.mp4 && mv -f g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna_out.mp4 g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4 && touch -t 199001010000.00 g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4
g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros.mp4
big/media/Movies/Edición/@video-remux/17 El antídoto de Brich.mp4
big/media/Movies/Edición/@video-remux/17 El antídoto de Brich
/usr/local/bin/ffmpeg -loglevel warning -i big/media/Movies/Edición/@video-remux/17 El antídoto de Brich.mp4 -map_metadata -1 -c copy big/media/Movies/Edición/@video-remux/17 El antídoto de Brich_out.mp4 && mv -f big/media/Movies/Edición/@video-remux/17 El antídoto de Brich_out.mp4 big/media/Movies/Edición/@video-remux/17 El antídoto de Brich.mp4 && touch -t 199001010000.00 big/media/Movies/Edición/@video-remux/17 El antídoto de Brich.mp4
big/media/Movies/Edición/@video-remux/17 El antídoto de Brich.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor.mp4
ig/media/Movies/Edición/@video-remux/13 El bosque musical.mp4
ig/media/Movies/Edición/@video-remux/13 El bosque musical
/usr/local/bin/ffmpeg -loglevel warning -i ig/media/Movies/Edición/@video-remux/13 El bosque musical.mp4 -map_metadata -1 -c copy ig/media/Movies/Edición/@video-remux/13 El bosque musical_out.mp4 && mv -f ig/media/Movies/Edición/@video-remux/13 El bosque musical_out.mp4 ig/media/Movies/Edición/@video-remux/13 El bosque musical.mp4 && touch -t 199001010000.00 ig/media/Movies/Edición/@video-remux/13 El bosque musical.mp4
ig/media/Movies/Edición/@video-remux/13 El bosque musical.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo.mp4
ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros.mp4
ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros
/usr/local/bin/ffmpeg -loglevel warning -i ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros.mp4 -map_metadata -1 -c copy ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros_out.mp4 && mv -f ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros_out.mp4 ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros.mp4 && touch -t 199001010000.00 ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros.mp4
ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica.mp4
big/media/Movies/Edición/@video-remux/23 El regreso de Miedo.mp4
big/media/Movies/Edición/@video-remux/23 El regreso de Miedo
/usr/local/bin/ffmpeg -loglevel warning -i big/media/Movies/Edición/@video-remux/23 El regreso de Miedo.mp4 -map_metadata -1 -c copy big/media/Movies/Edición/@video-remux/23 El regreso de Miedo_out.mp4 && mv -f big/media/Movies/Edición/@video-remux/23 El regreso de Miedo_out.mp4 big/media/Movies/Edición/@video-remux/23 El regreso de Miedo.mp4 && touch -t 199001010000.00 big/media/Movies/Edición/@video-remux/23 El regreso de Miedo.mp4
big/media/Movies/Edición/@video-remux/23 El regreso de Miedo.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste.mp4
ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas.mp4
ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas
/usr/local/bin/ffmpeg -loglevel warning -i ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas.mp4 -map_metadata -1 -c copy ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas_out.mp4 && mv -f ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas_out.mp4 ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas.mp4 && touch -t 199001010000.00 ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas.mp4
ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom.mp4
g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo.mp4
g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo
/usr/local/bin/ffmpeg -loglevel warning -i g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo.mp4 -map_metadata -1 -c copy g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo_out.mp4 && mv -f g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo_out.mp4 g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo.mp4 && touch -t 199001010000.00 g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo.mp4
g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis.mp4
g/media/Movies/Edición/@video-remux/20 Brug, el comesetas.mp4
g/media/Movies/Edición/@video-remux/20 Brug, el comesetas
/usr/local/bin/ffmpeg -loglevel warning -i g/media/Movies/Edición/@video-remux/20 Brug, el comesetas.mp4 -map_metadata -1 -c copy g/media/Movies/Edición/@video-remux/20 Brug, el comesetas_out.mp4 && mv -f g/media/Movies/Edición/@video-remux/20 Brug, el comesetas_out.mp4 g/media/Movies/Edición/@video-remux/20 Brug, el comesetas.mp4 && touch -t 199001010000.00 g/media/Movies/Edición/@video-remux/20 Brug, el comesetas.mp4
g/media/Movies/Edición/@video-remux/20 Brug, el comesetas.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel.mp4
g/media/Movies/Edición/@video-remux/1 El habitante del huevo.mp4
g/media/Movies/Edición/@video-remux/1 El habitante del huevo
/usr/local/bin/ffmpeg -loglevel warning -i g/media/Movies/Edición/@video-remux/1 El habitante del huevo.mp4 -map_metadata -1 -c copy g/media/Movies/Edición/@video-remux/1 El habitante del huevo_out.mp4 && mv -f g/media/Movies/Edición/@video-remux/1 El habitante del huevo_out.mp4 g/media/Movies/Edición/@video-remux/1 El habitante del huevo.mp4 && touch -t 199001010000.00 g/media/Movies/Edición/@video-remux/1 El habitante del huevo.mp4
g/media/Movies/Edición/@video-remux/1 El habitante del huevo.mp4: No such file or directory




[root@host /mnt/zbig/media/Movies/Edición/@video-remux]# ls -l
total 2354890
-rw-r--r-- 1 vicmarto staff 81050772 Jul 18 2018 1 El habitante del huevo.mp4
-rw-r--r-- 1 root staff 88078342 Jan 1 1990 10 La tierra de los Tu-Tuts.mp4
-rw-r--r-- 1 vicmarto staff 113562985 Jul 18 2018 11 La fiesta del conejo.mp4
-rw-r--r-- 1 root staff 106768564 Jan 1 1990 12 Las ciénagas de Crom.mp4
-rw-r--r-- 1 vicmarto staff 87797468 Jul 18 2018 13 El bosque musical.mp4
-rw-r--r-- 1 root staff 84534275 Jan 1 1990 14 La torre de Mat-Mor.mp4
-rw-r--r-- 1 root staff 77658799 Jan 1 1990 15 El laberinto de los horrores.mp4
-rw-r--r-- 1 root staff 97850685 Jan 1 1990 16 El navío de los espectros.mp4
-rw-r--r-- 1 vicmarto staff 104649374 Jul 18 2018 17 El antídoto de Brich.mp4
-rw-r--r-- 1 root staff 90052127 Jan 1 1990 18 Viaje al país de los Krunis.mp4
-rw-r--r-- 1 vicmarto staff 104629388 Jul 18 2018 19 La cueva de las flores.mp4
-rw-r--r-- 1 vicmarto staff 79170697 Jul 18 2018 2 Las perlas mágicas.mp4
-rw-r--r-- 1 vicmarto staff 111549054 Jul 18 2018 20 Brug, el comesetas.mp4
-rw-r--r-- 1 vicmarto staff 103279764 Jul 18 2018 21 La fiesta de la Luna.mp4
-rw-r--r-- 1 vicmarto staff 83907134 Jul 18 2018 22 Ruadan, el cazador de guerreros.mp4
-rw-r--r-- 1 vicmarto staff 89014058 Jul 18 2018 23 El regreso de Miedo.mp4
-rw-r--r-- 1 root staff 100884244 Jan 1 1990 24 La bolsa mágica.mp4
-rw-r--r-- 1 root staff 83778081 Jan 1 1990 25 Los Iquel.mp4
-rw-r--r-- 1 root staff 87219510 Jan 1 1990 26 La fiesta de Poti-Poti.mp4
-rw-r--r-- 1 vicmarto staff 80171207 Jul 18 2018 3 Iris, la princesa del Lago de Hielo.mp4
-rw-r--r-- 1 vicmarto staff 96901309 Jul 18 2018 4 Orzek, Señor de los Pantanos.mp4
-rw-r--r-- 1 root staff 84608380 Jan 1 1990 5 El guardián del bosque triste.mp4
-rw-r--r-- 1 root staff 120852993 Jan 1 1990 6 El brujo Chiprel.mp4
-rw-r--r-- 1 vicmarto staff 88559155 Jul 18 2018 7 El desierto de Zeth.mp4
-rw-r--r-- 1 root staff 100888244 Jan 1 1990 8 El hijo de Randal.mp4
-rw-r--r-- 1 root staff 93489824 Jan 1 1990 9 La máquina de granizo.mp4
[root@host /mnt/zbig/media/Movies/Edición/@video-remux]#


Some files are remuxed, some not. Can't find a patter!



Looking at the multiples "No such file or directory"



What is wrong?










share|improve this question

























  • To save us searching, could you add a list of which ones were missed?

    – Philip Couling
    Mar 4 at 16:36











  • @StéphaneChazelas your title edit grossly deviates from the original intent and is misleading, since the characters removed are not random, but always from the start of the path, which suggest that read had bit more than it could chew, probably confused by length in bytes vs length in characters (that ó from Edición is probably the culprit).

    – Uncle Billy
    Mar 4 at 17:17













  • @UncleBilly, 0, 4, 5, 6, 7 or 8 bytes are being removed seemingly randomly from the start of each line of the output of find (with no observable relation between that number and the number of non-ASCII characters in those lines). bash's read has no limit on the size of the line it reads (like in any Bourne-like shell). It reads one byte at a time until it finds a newline, it only needs to decode bytes as characters for the IFS processing here, but that happens after the finding of the line delimiter.

    – Stéphane Chazelas
    Mar 4 at 17:31











  • @StéphaneChazelas not from the start of each line; only from some lines -- I may be actually on the wrong path, but I don't see anything like Overwrite ? [y/N] from ffmpeg in the OP's output (which should've appeared if ffmpeg was trying to read from stdin), and I vaguely remember a similar bug with bash's read` reading too much.

    – Uncle Billy
    Mar 4 at 17:34













  • @UncleBilly, note the 0 in my list of numbers ;-)

    – Stéphane Chazelas
    Mar 4 at 17:34














1












1








1








I'm having a really strange behaviour of find, he is "eating" path characters, can't understand why.



This is using a simple shell script to remux some mp4 files using ffmpeg.



Here is the script:



#!/bin/sh

video_remux_dir=/mnt/zbig/media/Movies/Edición/@video-remux

find "$video_remux_dir" -type f -name "*.mp4" -newermt "1990-01-01 00:00:00" -print | while read -r mp4file ; do

echo "$mp4file"

mp4file_basename=${mp4file%.*}

mp4file_basename_out=${mp4file_basename}_out.mp4

echo "$mp4file_basename"

echo "/usr/local/bin/ffmpeg -loglevel warning -i $mp4file -map_metadata -1 -c copy $mp4file_basename_out && mv -f $mp4file_basename_out $mp4file && touch -t 199001010000.00 $mp4file"

/usr/local/bin/ffmpeg -loglevel warning -i "$mp4file" -map_metadata -1 -c copy "$mp4file_basename_out" && mv -f "$mp4file_basename_out" "$mp4file" && touch -t 199001010000.00 "$mp4file"


done


And here the results:



[root@host /mnt/zbig/media/Movies/Edición/@video-remux]# ls -l
total 2326858
-rw-r--r-- 1 vicmarto staff 81050772 Jul 18 2018 1 El habitante del huevo.mp4
-rw-r--r-- 1 vicmarto staff 88078466 Jul 18 2018 10 La tierra de los Tu-Tuts.mp4
-rw-r--r-- 1 vicmarto staff 113562985 Jul 18 2018 11 La fiesta del conejo.mp4
-rw-r--r-- 1 vicmarto staff 106768685 Jul 18 2018 12 Las ciénagas de Crom.mp4
-rw-r--r-- 1 vicmarto staff 87797468 Jul 18 2018 13 El bosque musical.mp4
-rw-r--r-- 1 vicmarto staff 84534410 Jul 18 2018 14 La torre de Mat-Mor.mp4
-rw-r--r-- 1 vicmarto staff 77658927 Jul 18 2018 15 El laberinto de los horrores.mp4
-rw-r--r-- 1 vicmarto staff 97850829 Jul 18 2018 16 El navío de los espectros.mp4
-rw-r--r-- 1 vicmarto staff 104649374 Jul 18 2018 17 El antídoto de Brich.mp4
-rw-r--r-- 1 vicmarto staff 90052253 Jul 18 2018 18 Viaje al país de los Krunis.mp4
-rw-r--r-- 1 vicmarto staff 104629388 Jul 18 2018 19 La cueva de las flores.mp4
-rw-r--r-- 1 vicmarto staff 79170697 Jul 18 2018 2 Las perlas mágicas.mp4
-rw-r--r-- 1 vicmarto staff 111549054 Jul 18 2018 20 Brug, el comesetas.mp4
-rw-r--r-- 1 vicmarto staff 103279764 Jul 18 2018 21 La fiesta de la Luna.mp4
-rw-r--r-- 1 vicmarto staff 83907134 Jul 18 2018 22 Ruadan, el cazador de guerreros.mp4
-rw-r--r-- 1 vicmarto staff 89014058 Jul 18 2018 23 El regreso de Miedo.mp4
-rw-r--r-- 1 vicmarto staff 100884376 Jul 18 2018 24 La bolsa mágica.mp4
-rw-r--r-- 1 vicmarto staff 83778207 Jul 18 2018 25 Los Iquel.mp4
-rw-r--r-- 1 vicmarto staff 87219648 Jul 18 2018 26 La fiesta de Poti-Poti.mp4
-rw-r--r-- 1 vicmarto staff 80171207 Jul 18 2018 3 Iris, la princesa del Lago de Hielo.mp4
-rw-r--r-- 1 vicmarto staff 96901309 Jul 18 2018 4 Orzek, Señor de los Pantanos.mp4
-rw-r--r-- 1 vicmarto staff 84608498 Jul 18 2018 5 El guardián del bosque triste.mp4
-rw-r--r-- 1 vicmarto staff 120853125 Jul 18 2018 6 El brujo Chiprel.mp4
-rw-r--r-- 1 vicmarto staff 88559155 Jul 18 2018 7 El desierto de Zeth.mp4
-rw-r--r-- 1 vicmarto staff 100888377 Jul 18 2018 8 El hijo de Randal.mp4
-rw-r--r-- 1 vicmarto staff 93489946 Jul 18 2018 9 La máquina de granizo.mp4




[root@host /mnt/zbig/media/Movies/Edición/@video-remux]# /home/vicmarto/scripts/avi-mp4-mpeg-remux.sh
/mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal.mp4
big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4
big/media/Movies/Edición/@video-remux/19 La cueva de las flores
/usr/local/bin/ffmpeg -loglevel warning -i big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4 -map_metadata -1 -c copy big/media/Movies/Edición/@video-remux/19 La cueva de las flores_out.mp4 && mv -f big/media/Movies/Edición/@video-remux/19 La cueva de las flores_out.mp4 big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4 && touch -t 199001010000.00 big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4
big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores.mp4
g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos.mp4
g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos
/usr/local/bin/ffmpeg -loglevel warning -i g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos.mp4 -map_metadata -1 -c copy g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos_out.mp4 && mv -f g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos_out.mp4 g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos.mp4 && touch -t 199001010000.00 g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos.mp4
g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti.mp4
zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth.mp4
zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth
/usr/local/bin/ffmpeg -loglevel warning -i zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth.mp4 -map_metadata -1 -c copy zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth_out.mp4 && mv -f zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth_out.mp4 zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth.mp4 && touch -t 199001010000.00 zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth.mp4
zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts.mp4
big/media/Movies/Edición/@video-remux/11 La fiesta del conejo.mp4
big/media/Movies/Edición/@video-remux/11 La fiesta del conejo
/usr/local/bin/ffmpeg -loglevel warning -i big/media/Movies/Edición/@video-remux/11 La fiesta del conejo.mp4 -map_metadata -1 -c copy big/media/Movies/Edición/@video-remux/11 La fiesta del conejo_out.mp4 && mv -f big/media/Movies/Edición/@video-remux/11 La fiesta del conejo_out.mp4 big/media/Movies/Edición/@video-remux/11 La fiesta del conejo.mp4 && touch -t 199001010000.00 big/media/Movies/Edición/@video-remux/11 La fiesta del conejo.mp4
big/media/Movies/Edición/@video-remux/11 La fiesta del conejo.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel.mp4
g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4
g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna
/usr/local/bin/ffmpeg -loglevel warning -i g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4 -map_metadata -1 -c copy g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna_out.mp4 && mv -f g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna_out.mp4 g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4 && touch -t 199001010000.00 g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4
g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros.mp4
big/media/Movies/Edición/@video-remux/17 El antídoto de Brich.mp4
big/media/Movies/Edición/@video-remux/17 El antídoto de Brich
/usr/local/bin/ffmpeg -loglevel warning -i big/media/Movies/Edición/@video-remux/17 El antídoto de Brich.mp4 -map_metadata -1 -c copy big/media/Movies/Edición/@video-remux/17 El antídoto de Brich_out.mp4 && mv -f big/media/Movies/Edición/@video-remux/17 El antídoto de Brich_out.mp4 big/media/Movies/Edición/@video-remux/17 El antídoto de Brich.mp4 && touch -t 199001010000.00 big/media/Movies/Edición/@video-remux/17 El antídoto de Brich.mp4
big/media/Movies/Edición/@video-remux/17 El antídoto de Brich.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor.mp4
ig/media/Movies/Edición/@video-remux/13 El bosque musical.mp4
ig/media/Movies/Edición/@video-remux/13 El bosque musical
/usr/local/bin/ffmpeg -loglevel warning -i ig/media/Movies/Edición/@video-remux/13 El bosque musical.mp4 -map_metadata -1 -c copy ig/media/Movies/Edición/@video-remux/13 El bosque musical_out.mp4 && mv -f ig/media/Movies/Edición/@video-remux/13 El bosque musical_out.mp4 ig/media/Movies/Edición/@video-remux/13 El bosque musical.mp4 && touch -t 199001010000.00 ig/media/Movies/Edición/@video-remux/13 El bosque musical.mp4
ig/media/Movies/Edición/@video-remux/13 El bosque musical.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo.mp4
ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros.mp4
ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros
/usr/local/bin/ffmpeg -loglevel warning -i ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros.mp4 -map_metadata -1 -c copy ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros_out.mp4 && mv -f ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros_out.mp4 ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros.mp4 && touch -t 199001010000.00 ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros.mp4
ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica.mp4
big/media/Movies/Edición/@video-remux/23 El regreso de Miedo.mp4
big/media/Movies/Edición/@video-remux/23 El regreso de Miedo
/usr/local/bin/ffmpeg -loglevel warning -i big/media/Movies/Edición/@video-remux/23 El regreso de Miedo.mp4 -map_metadata -1 -c copy big/media/Movies/Edición/@video-remux/23 El regreso de Miedo_out.mp4 && mv -f big/media/Movies/Edición/@video-remux/23 El regreso de Miedo_out.mp4 big/media/Movies/Edición/@video-remux/23 El regreso de Miedo.mp4 && touch -t 199001010000.00 big/media/Movies/Edición/@video-remux/23 El regreso de Miedo.mp4
big/media/Movies/Edición/@video-remux/23 El regreso de Miedo.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste.mp4
ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas.mp4
ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas
/usr/local/bin/ffmpeg -loglevel warning -i ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas.mp4 -map_metadata -1 -c copy ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas_out.mp4 && mv -f ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas_out.mp4 ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas.mp4 && touch -t 199001010000.00 ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas.mp4
ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom.mp4
g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo.mp4
g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo
/usr/local/bin/ffmpeg -loglevel warning -i g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo.mp4 -map_metadata -1 -c copy g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo_out.mp4 && mv -f g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo_out.mp4 g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo.mp4 && touch -t 199001010000.00 g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo.mp4
g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis.mp4
g/media/Movies/Edición/@video-remux/20 Brug, el comesetas.mp4
g/media/Movies/Edición/@video-remux/20 Brug, el comesetas
/usr/local/bin/ffmpeg -loglevel warning -i g/media/Movies/Edición/@video-remux/20 Brug, el comesetas.mp4 -map_metadata -1 -c copy g/media/Movies/Edición/@video-remux/20 Brug, el comesetas_out.mp4 && mv -f g/media/Movies/Edición/@video-remux/20 Brug, el comesetas_out.mp4 g/media/Movies/Edición/@video-remux/20 Brug, el comesetas.mp4 && touch -t 199001010000.00 g/media/Movies/Edición/@video-remux/20 Brug, el comesetas.mp4
g/media/Movies/Edición/@video-remux/20 Brug, el comesetas.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel.mp4
g/media/Movies/Edición/@video-remux/1 El habitante del huevo.mp4
g/media/Movies/Edición/@video-remux/1 El habitante del huevo
/usr/local/bin/ffmpeg -loglevel warning -i g/media/Movies/Edición/@video-remux/1 El habitante del huevo.mp4 -map_metadata -1 -c copy g/media/Movies/Edición/@video-remux/1 El habitante del huevo_out.mp4 && mv -f g/media/Movies/Edición/@video-remux/1 El habitante del huevo_out.mp4 g/media/Movies/Edición/@video-remux/1 El habitante del huevo.mp4 && touch -t 199001010000.00 g/media/Movies/Edición/@video-remux/1 El habitante del huevo.mp4
g/media/Movies/Edición/@video-remux/1 El habitante del huevo.mp4: No such file or directory




[root@host /mnt/zbig/media/Movies/Edición/@video-remux]# ls -l
total 2354890
-rw-r--r-- 1 vicmarto staff 81050772 Jul 18 2018 1 El habitante del huevo.mp4
-rw-r--r-- 1 root staff 88078342 Jan 1 1990 10 La tierra de los Tu-Tuts.mp4
-rw-r--r-- 1 vicmarto staff 113562985 Jul 18 2018 11 La fiesta del conejo.mp4
-rw-r--r-- 1 root staff 106768564 Jan 1 1990 12 Las ciénagas de Crom.mp4
-rw-r--r-- 1 vicmarto staff 87797468 Jul 18 2018 13 El bosque musical.mp4
-rw-r--r-- 1 root staff 84534275 Jan 1 1990 14 La torre de Mat-Mor.mp4
-rw-r--r-- 1 root staff 77658799 Jan 1 1990 15 El laberinto de los horrores.mp4
-rw-r--r-- 1 root staff 97850685 Jan 1 1990 16 El navío de los espectros.mp4
-rw-r--r-- 1 vicmarto staff 104649374 Jul 18 2018 17 El antídoto de Brich.mp4
-rw-r--r-- 1 root staff 90052127 Jan 1 1990 18 Viaje al país de los Krunis.mp4
-rw-r--r-- 1 vicmarto staff 104629388 Jul 18 2018 19 La cueva de las flores.mp4
-rw-r--r-- 1 vicmarto staff 79170697 Jul 18 2018 2 Las perlas mágicas.mp4
-rw-r--r-- 1 vicmarto staff 111549054 Jul 18 2018 20 Brug, el comesetas.mp4
-rw-r--r-- 1 vicmarto staff 103279764 Jul 18 2018 21 La fiesta de la Luna.mp4
-rw-r--r-- 1 vicmarto staff 83907134 Jul 18 2018 22 Ruadan, el cazador de guerreros.mp4
-rw-r--r-- 1 vicmarto staff 89014058 Jul 18 2018 23 El regreso de Miedo.mp4
-rw-r--r-- 1 root staff 100884244 Jan 1 1990 24 La bolsa mágica.mp4
-rw-r--r-- 1 root staff 83778081 Jan 1 1990 25 Los Iquel.mp4
-rw-r--r-- 1 root staff 87219510 Jan 1 1990 26 La fiesta de Poti-Poti.mp4
-rw-r--r-- 1 vicmarto staff 80171207 Jul 18 2018 3 Iris, la princesa del Lago de Hielo.mp4
-rw-r--r-- 1 vicmarto staff 96901309 Jul 18 2018 4 Orzek, Señor de los Pantanos.mp4
-rw-r--r-- 1 root staff 84608380 Jan 1 1990 5 El guardián del bosque triste.mp4
-rw-r--r-- 1 root staff 120852993 Jan 1 1990 6 El brujo Chiprel.mp4
-rw-r--r-- 1 vicmarto staff 88559155 Jul 18 2018 7 El desierto de Zeth.mp4
-rw-r--r-- 1 root staff 100888244 Jan 1 1990 8 El hijo de Randal.mp4
-rw-r--r-- 1 root staff 93489824 Jan 1 1990 9 La máquina de granizo.mp4
[root@host /mnt/zbig/media/Movies/Edición/@video-remux]#


Some files are remuxed, some not. Can't find a patter!



Looking at the multiples "No such file or directory"



What is wrong?










share|improve this question
















I'm having a really strange behaviour of find, he is "eating" path characters, can't understand why.



This is using a simple shell script to remux some mp4 files using ffmpeg.



Here is the script:



#!/bin/sh

video_remux_dir=/mnt/zbig/media/Movies/Edición/@video-remux

find "$video_remux_dir" -type f -name "*.mp4" -newermt "1990-01-01 00:00:00" -print | while read -r mp4file ; do

echo "$mp4file"

mp4file_basename=${mp4file%.*}

mp4file_basename_out=${mp4file_basename}_out.mp4

echo "$mp4file_basename"

echo "/usr/local/bin/ffmpeg -loglevel warning -i $mp4file -map_metadata -1 -c copy $mp4file_basename_out && mv -f $mp4file_basename_out $mp4file && touch -t 199001010000.00 $mp4file"

/usr/local/bin/ffmpeg -loglevel warning -i "$mp4file" -map_metadata -1 -c copy "$mp4file_basename_out" && mv -f "$mp4file_basename_out" "$mp4file" && touch -t 199001010000.00 "$mp4file"


done


And here the results:



[root@host /mnt/zbig/media/Movies/Edición/@video-remux]# ls -l
total 2326858
-rw-r--r-- 1 vicmarto staff 81050772 Jul 18 2018 1 El habitante del huevo.mp4
-rw-r--r-- 1 vicmarto staff 88078466 Jul 18 2018 10 La tierra de los Tu-Tuts.mp4
-rw-r--r-- 1 vicmarto staff 113562985 Jul 18 2018 11 La fiesta del conejo.mp4
-rw-r--r-- 1 vicmarto staff 106768685 Jul 18 2018 12 Las ciénagas de Crom.mp4
-rw-r--r-- 1 vicmarto staff 87797468 Jul 18 2018 13 El bosque musical.mp4
-rw-r--r-- 1 vicmarto staff 84534410 Jul 18 2018 14 La torre de Mat-Mor.mp4
-rw-r--r-- 1 vicmarto staff 77658927 Jul 18 2018 15 El laberinto de los horrores.mp4
-rw-r--r-- 1 vicmarto staff 97850829 Jul 18 2018 16 El navío de los espectros.mp4
-rw-r--r-- 1 vicmarto staff 104649374 Jul 18 2018 17 El antídoto de Brich.mp4
-rw-r--r-- 1 vicmarto staff 90052253 Jul 18 2018 18 Viaje al país de los Krunis.mp4
-rw-r--r-- 1 vicmarto staff 104629388 Jul 18 2018 19 La cueva de las flores.mp4
-rw-r--r-- 1 vicmarto staff 79170697 Jul 18 2018 2 Las perlas mágicas.mp4
-rw-r--r-- 1 vicmarto staff 111549054 Jul 18 2018 20 Brug, el comesetas.mp4
-rw-r--r-- 1 vicmarto staff 103279764 Jul 18 2018 21 La fiesta de la Luna.mp4
-rw-r--r-- 1 vicmarto staff 83907134 Jul 18 2018 22 Ruadan, el cazador de guerreros.mp4
-rw-r--r-- 1 vicmarto staff 89014058 Jul 18 2018 23 El regreso de Miedo.mp4
-rw-r--r-- 1 vicmarto staff 100884376 Jul 18 2018 24 La bolsa mágica.mp4
-rw-r--r-- 1 vicmarto staff 83778207 Jul 18 2018 25 Los Iquel.mp4
-rw-r--r-- 1 vicmarto staff 87219648 Jul 18 2018 26 La fiesta de Poti-Poti.mp4
-rw-r--r-- 1 vicmarto staff 80171207 Jul 18 2018 3 Iris, la princesa del Lago de Hielo.mp4
-rw-r--r-- 1 vicmarto staff 96901309 Jul 18 2018 4 Orzek, Señor de los Pantanos.mp4
-rw-r--r-- 1 vicmarto staff 84608498 Jul 18 2018 5 El guardián del bosque triste.mp4
-rw-r--r-- 1 vicmarto staff 120853125 Jul 18 2018 6 El brujo Chiprel.mp4
-rw-r--r-- 1 vicmarto staff 88559155 Jul 18 2018 7 El desierto de Zeth.mp4
-rw-r--r-- 1 vicmarto staff 100888377 Jul 18 2018 8 El hijo de Randal.mp4
-rw-r--r-- 1 vicmarto staff 93489946 Jul 18 2018 9 La máquina de granizo.mp4




[root@host /mnt/zbig/media/Movies/Edición/@video-remux]# /home/vicmarto/scripts/avi-mp4-mpeg-remux.sh
/mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal.mp4
big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4
big/media/Movies/Edición/@video-remux/19 La cueva de las flores
/usr/local/bin/ffmpeg -loglevel warning -i big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4 -map_metadata -1 -c copy big/media/Movies/Edición/@video-remux/19 La cueva de las flores_out.mp4 && mv -f big/media/Movies/Edición/@video-remux/19 La cueva de las flores_out.mp4 big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4 && touch -t 199001010000.00 big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4
big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/15 El laberinto de los horrores.mp4
g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos.mp4
g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos
/usr/local/bin/ffmpeg -loglevel warning -i g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos.mp4 -map_metadata -1 -c copy g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos_out.mp4 && mv -f g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos_out.mp4 g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos.mp4 && touch -t 199001010000.00 g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos.mp4
g/media/Movies/Edición/@video-remux/4 Orzek, Señor de los Pantanos.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/26 La fiesta de Poti-Poti.mp4
zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth.mp4
zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth
/usr/local/bin/ffmpeg -loglevel warning -i zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth.mp4 -map_metadata -1 -c copy zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth_out.mp4 && mv -f zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth_out.mp4 zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth.mp4 && touch -t 199001010000.00 zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth.mp4
zbig/media/Movies/Edición/@video-remux/7 El desierto de Zeth.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/10 La tierra de los Tu-Tuts.mp4
big/media/Movies/Edición/@video-remux/11 La fiesta del conejo.mp4
big/media/Movies/Edición/@video-remux/11 La fiesta del conejo
/usr/local/bin/ffmpeg -loglevel warning -i big/media/Movies/Edición/@video-remux/11 La fiesta del conejo.mp4 -map_metadata -1 -c copy big/media/Movies/Edición/@video-remux/11 La fiesta del conejo_out.mp4 && mv -f big/media/Movies/Edición/@video-remux/11 La fiesta del conejo_out.mp4 big/media/Movies/Edición/@video-remux/11 La fiesta del conejo.mp4 && touch -t 199001010000.00 big/media/Movies/Edición/@video-remux/11 La fiesta del conejo.mp4
big/media/Movies/Edición/@video-remux/11 La fiesta del conejo.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/6 El brujo Chiprel.mp4
g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4
g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna
/usr/local/bin/ffmpeg -loglevel warning -i g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4 -map_metadata -1 -c copy g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna_out.mp4 && mv -f g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna_out.mp4 g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4 && touch -t 199001010000.00 g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4
g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/16 El navío de los espectros.mp4
big/media/Movies/Edición/@video-remux/17 El antídoto de Brich.mp4
big/media/Movies/Edición/@video-remux/17 El antídoto de Brich
/usr/local/bin/ffmpeg -loglevel warning -i big/media/Movies/Edición/@video-remux/17 El antídoto de Brich.mp4 -map_metadata -1 -c copy big/media/Movies/Edición/@video-remux/17 El antídoto de Brich_out.mp4 && mv -f big/media/Movies/Edición/@video-remux/17 El antídoto de Brich_out.mp4 big/media/Movies/Edición/@video-remux/17 El antídoto de Brich.mp4 && touch -t 199001010000.00 big/media/Movies/Edición/@video-remux/17 El antídoto de Brich.mp4
big/media/Movies/Edición/@video-remux/17 El antídoto de Brich.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/14 La torre de Mat-Mor.mp4
ig/media/Movies/Edición/@video-remux/13 El bosque musical.mp4
ig/media/Movies/Edición/@video-remux/13 El bosque musical
/usr/local/bin/ffmpeg -loglevel warning -i ig/media/Movies/Edición/@video-remux/13 El bosque musical.mp4 -map_metadata -1 -c copy ig/media/Movies/Edición/@video-remux/13 El bosque musical_out.mp4 && mv -f ig/media/Movies/Edición/@video-remux/13 El bosque musical_out.mp4 ig/media/Movies/Edición/@video-remux/13 El bosque musical.mp4 && touch -t 199001010000.00 ig/media/Movies/Edición/@video-remux/13 El bosque musical.mp4
ig/media/Movies/Edición/@video-remux/13 El bosque musical.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/9 La máquina de granizo.mp4
ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros.mp4
ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros
/usr/local/bin/ffmpeg -loglevel warning -i ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros.mp4 -map_metadata -1 -c copy ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros_out.mp4 && mv -f ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros_out.mp4 ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros.mp4 && touch -t 199001010000.00 ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros.mp4
ig/media/Movies/Edición/@video-remux/22 Ruadan, el cazador de guerreros.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/24 La bolsa mágica.mp4
big/media/Movies/Edición/@video-remux/23 El regreso de Miedo.mp4
big/media/Movies/Edición/@video-remux/23 El regreso de Miedo
/usr/local/bin/ffmpeg -loglevel warning -i big/media/Movies/Edición/@video-remux/23 El regreso de Miedo.mp4 -map_metadata -1 -c copy big/media/Movies/Edición/@video-remux/23 El regreso de Miedo_out.mp4 && mv -f big/media/Movies/Edición/@video-remux/23 El regreso de Miedo_out.mp4 big/media/Movies/Edición/@video-remux/23 El regreso de Miedo.mp4 && touch -t 199001010000.00 big/media/Movies/Edición/@video-remux/23 El regreso de Miedo.mp4
big/media/Movies/Edición/@video-remux/23 El regreso de Miedo.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/5 El guardián del bosque triste.mp4
ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas.mp4
ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas
/usr/local/bin/ffmpeg -loglevel warning -i ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas.mp4 -map_metadata -1 -c copy ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas_out.mp4 && mv -f ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas_out.mp4 ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas.mp4 && touch -t 199001010000.00 ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas.mp4
ig/media/Movies/Edición/@video-remux/2 Las perlas mágicas.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/12 Las ciénagas de Crom.mp4
g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo.mp4
g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo
/usr/local/bin/ffmpeg -loglevel warning -i g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo.mp4 -map_metadata -1 -c copy g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo_out.mp4 && mv -f g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo_out.mp4 g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo.mp4 && touch -t 199001010000.00 g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo.mp4
g/media/Movies/Edición/@video-remux/3 Iris, la princesa del Lago de Hielo.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/18 Viaje al país de los Krunis.mp4
g/media/Movies/Edición/@video-remux/20 Brug, el comesetas.mp4
g/media/Movies/Edición/@video-remux/20 Brug, el comesetas
/usr/local/bin/ffmpeg -loglevel warning -i g/media/Movies/Edición/@video-remux/20 Brug, el comesetas.mp4 -map_metadata -1 -c copy g/media/Movies/Edición/@video-remux/20 Brug, el comesetas_out.mp4 && mv -f g/media/Movies/Edición/@video-remux/20 Brug, el comesetas_out.mp4 g/media/Movies/Edición/@video-remux/20 Brug, el comesetas.mp4 && touch -t 199001010000.00 g/media/Movies/Edición/@video-remux/20 Brug, el comesetas.mp4
g/media/Movies/Edición/@video-remux/20 Brug, el comesetas.mp4: No such file or directory
/mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel.mp4
/mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel
/usr/local/bin/ffmpeg -loglevel warning -i /mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel.mp4 -map_metadata -1 -c copy /mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel_out.mp4 && mv -f /mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel_out.mp4 /mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel.mp4 && touch -t 199001010000.00 /mnt/zbig/media/Movies/Edición/@video-remux/25 Los Iquel.mp4
g/media/Movies/Edición/@video-remux/1 El habitante del huevo.mp4
g/media/Movies/Edición/@video-remux/1 El habitante del huevo
/usr/local/bin/ffmpeg -loglevel warning -i g/media/Movies/Edición/@video-remux/1 El habitante del huevo.mp4 -map_metadata -1 -c copy g/media/Movies/Edición/@video-remux/1 El habitante del huevo_out.mp4 && mv -f g/media/Movies/Edición/@video-remux/1 El habitante del huevo_out.mp4 g/media/Movies/Edición/@video-remux/1 El habitante del huevo.mp4 && touch -t 199001010000.00 g/media/Movies/Edición/@video-remux/1 El habitante del huevo.mp4
g/media/Movies/Edición/@video-remux/1 El habitante del huevo.mp4: No such file or directory




[root@host /mnt/zbig/media/Movies/Edición/@video-remux]# ls -l
total 2354890
-rw-r--r-- 1 vicmarto staff 81050772 Jul 18 2018 1 El habitante del huevo.mp4
-rw-r--r-- 1 root staff 88078342 Jan 1 1990 10 La tierra de los Tu-Tuts.mp4
-rw-r--r-- 1 vicmarto staff 113562985 Jul 18 2018 11 La fiesta del conejo.mp4
-rw-r--r-- 1 root staff 106768564 Jan 1 1990 12 Las ciénagas de Crom.mp4
-rw-r--r-- 1 vicmarto staff 87797468 Jul 18 2018 13 El bosque musical.mp4
-rw-r--r-- 1 root staff 84534275 Jan 1 1990 14 La torre de Mat-Mor.mp4
-rw-r--r-- 1 root staff 77658799 Jan 1 1990 15 El laberinto de los horrores.mp4
-rw-r--r-- 1 root staff 97850685 Jan 1 1990 16 El navío de los espectros.mp4
-rw-r--r-- 1 vicmarto staff 104649374 Jul 18 2018 17 El antídoto de Brich.mp4
-rw-r--r-- 1 root staff 90052127 Jan 1 1990 18 Viaje al país de los Krunis.mp4
-rw-r--r-- 1 vicmarto staff 104629388 Jul 18 2018 19 La cueva de las flores.mp4
-rw-r--r-- 1 vicmarto staff 79170697 Jul 18 2018 2 Las perlas mágicas.mp4
-rw-r--r-- 1 vicmarto staff 111549054 Jul 18 2018 20 Brug, el comesetas.mp4
-rw-r--r-- 1 vicmarto staff 103279764 Jul 18 2018 21 La fiesta de la Luna.mp4
-rw-r--r-- 1 vicmarto staff 83907134 Jul 18 2018 22 Ruadan, el cazador de guerreros.mp4
-rw-r--r-- 1 vicmarto staff 89014058 Jul 18 2018 23 El regreso de Miedo.mp4
-rw-r--r-- 1 root staff 100884244 Jan 1 1990 24 La bolsa mágica.mp4
-rw-r--r-- 1 root staff 83778081 Jan 1 1990 25 Los Iquel.mp4
-rw-r--r-- 1 root staff 87219510 Jan 1 1990 26 La fiesta de Poti-Poti.mp4
-rw-r--r-- 1 vicmarto staff 80171207 Jul 18 2018 3 Iris, la princesa del Lago de Hielo.mp4
-rw-r--r-- 1 vicmarto staff 96901309 Jul 18 2018 4 Orzek, Señor de los Pantanos.mp4
-rw-r--r-- 1 root staff 84608380 Jan 1 1990 5 El guardián del bosque triste.mp4
-rw-r--r-- 1 root staff 120852993 Jan 1 1990 6 El brujo Chiprel.mp4
-rw-r--r-- 1 vicmarto staff 88559155 Jul 18 2018 7 El desierto de Zeth.mp4
-rw-r--r-- 1 root staff 100888244 Jan 1 1990 8 El hijo de Randal.mp4
-rw-r--r-- 1 root staff 93489824 Jan 1 1990 9 La máquina de granizo.mp4
[root@host /mnt/zbig/media/Movies/Edición/@video-remux]#


Some files are remuxed, some not. Can't find a patter!



Looking at the multiples "No such file or directory"



What is wrong?







shell-script shell find






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 5 at 7:52







vicmarto

















asked Mar 4 at 16:09









vicmartovicmarto

207




207













  • To save us searching, could you add a list of which ones were missed?

    – Philip Couling
    Mar 4 at 16:36











  • @StéphaneChazelas your title edit grossly deviates from the original intent and is misleading, since the characters removed are not random, but always from the start of the path, which suggest that read had bit more than it could chew, probably confused by length in bytes vs length in characters (that ó from Edición is probably the culprit).

    – Uncle Billy
    Mar 4 at 17:17













  • @UncleBilly, 0, 4, 5, 6, 7 or 8 bytes are being removed seemingly randomly from the start of each line of the output of find (with no observable relation between that number and the number of non-ASCII characters in those lines). bash's read has no limit on the size of the line it reads (like in any Bourne-like shell). It reads one byte at a time until it finds a newline, it only needs to decode bytes as characters for the IFS processing here, but that happens after the finding of the line delimiter.

    – Stéphane Chazelas
    Mar 4 at 17:31











  • @StéphaneChazelas not from the start of each line; only from some lines -- I may be actually on the wrong path, but I don't see anything like Overwrite ? [y/N] from ffmpeg in the OP's output (which should've appeared if ffmpeg was trying to read from stdin), and I vaguely remember a similar bug with bash's read` reading too much.

    – Uncle Billy
    Mar 4 at 17:34













  • @UncleBilly, note the 0 in my list of numbers ;-)

    – Stéphane Chazelas
    Mar 4 at 17:34



















  • To save us searching, could you add a list of which ones were missed?

    – Philip Couling
    Mar 4 at 16:36











  • @StéphaneChazelas your title edit grossly deviates from the original intent and is misleading, since the characters removed are not random, but always from the start of the path, which suggest that read had bit more than it could chew, probably confused by length in bytes vs length in characters (that ó from Edición is probably the culprit).

    – Uncle Billy
    Mar 4 at 17:17













  • @UncleBilly, 0, 4, 5, 6, 7 or 8 bytes are being removed seemingly randomly from the start of each line of the output of find (with no observable relation between that number and the number of non-ASCII characters in those lines). bash's read has no limit on the size of the line it reads (like in any Bourne-like shell). It reads one byte at a time until it finds a newline, it only needs to decode bytes as characters for the IFS processing here, but that happens after the finding of the line delimiter.

    – Stéphane Chazelas
    Mar 4 at 17:31











  • @StéphaneChazelas not from the start of each line; only from some lines -- I may be actually on the wrong path, but I don't see anything like Overwrite ? [y/N] from ffmpeg in the OP's output (which should've appeared if ffmpeg was trying to read from stdin), and I vaguely remember a similar bug with bash's read` reading too much.

    – Uncle Billy
    Mar 4 at 17:34













  • @UncleBilly, note the 0 in my list of numbers ;-)

    – Stéphane Chazelas
    Mar 4 at 17:34

















To save us searching, could you add a list of which ones were missed?

– Philip Couling
Mar 4 at 16:36





To save us searching, could you add a list of which ones were missed?

– Philip Couling
Mar 4 at 16:36













@StéphaneChazelas your title edit grossly deviates from the original intent and is misleading, since the characters removed are not random, but always from the start of the path, which suggest that read had bit more than it could chew, probably confused by length in bytes vs length in characters (that ó from Edición is probably the culprit).

– Uncle Billy
Mar 4 at 17:17







@StéphaneChazelas your title edit grossly deviates from the original intent and is misleading, since the characters removed are not random, but always from the start of the path, which suggest that read had bit more than it could chew, probably confused by length in bytes vs length in characters (that ó from Edición is probably the culprit).

– Uncle Billy
Mar 4 at 17:17















@UncleBilly, 0, 4, 5, 6, 7 or 8 bytes are being removed seemingly randomly from the start of each line of the output of find (with no observable relation between that number and the number of non-ASCII characters in those lines). bash's read has no limit on the size of the line it reads (like in any Bourne-like shell). It reads one byte at a time until it finds a newline, it only needs to decode bytes as characters for the IFS processing here, but that happens after the finding of the line delimiter.

– Stéphane Chazelas
Mar 4 at 17:31





@UncleBilly, 0, 4, 5, 6, 7 or 8 bytes are being removed seemingly randomly from the start of each line of the output of find (with no observable relation between that number and the number of non-ASCII characters in those lines). bash's read has no limit on the size of the line it reads (like in any Bourne-like shell). It reads one byte at a time until it finds a newline, it only needs to decode bytes as characters for the IFS processing here, but that happens after the finding of the line delimiter.

– Stéphane Chazelas
Mar 4 at 17:31













@StéphaneChazelas not from the start of each line; only from some lines -- I may be actually on the wrong path, but I don't see anything like Overwrite ? [y/N] from ffmpeg in the OP's output (which should've appeared if ffmpeg was trying to read from stdin), and I vaguely remember a similar bug with bash's read` reading too much.

– Uncle Billy
Mar 4 at 17:34







@StéphaneChazelas not from the start of each line; only from some lines -- I may be actually on the wrong path, but I don't see anything like Overwrite ? [y/N] from ffmpeg in the OP's output (which should've appeared if ffmpeg was trying to read from stdin), and I vaguely remember a similar bug with bash's read` reading too much.

– Uncle Billy
Mar 4 at 17:34















@UncleBilly, note the 0 in my list of numbers ;-)

– Stéphane Chazelas
Mar 4 at 17:34





@UncleBilly, note the 0 in my list of numbers ;-)

– Stéphane Chazelas
Mar 4 at 17:34










3 Answers
3






active

oldest

votes


















2














One possible explanation is that one command in the loop is reading from stdin (which in this case is the same stream that read is meant to read from). As you found out, that would be ffmpeg which does allow the user to control the encoding over the keyboard (unless you pass the -nostdin option), hence the reading from stdin to get user input.



That's one of the several issues with looping over find's output that way.



Use the:



find ... -exec sh -c '
for mp4file do
...
done' sh {} +


standard syntax (where the stdin of sh and ffmpeg is left unaffected), or one of the other approaches described at Why is looping over find's output bad practice? which would also remove the problems with file names that contain newline characters (or $IFS contains 4 with your approach).






share|improve this answer


























  • Thanks, the problem was looping over find's output. Changing the script as suggested worked.

    – vicmarto
    Mar 5 at 9:08













  • @vicmarto, you're welcome. What is not explained though is why ffmpeg (or mv or another command in the loop) would be reading some random number of bytes from stdin.

    – Stéphane Chazelas
    Mar 5 at 9:43



















1














Well, finally found the reason why my original code didn't worked. Problem was ffmpeg and how it interacts with stdin. More about this can be read here:




  • Shellcheck: SC2095

  • I'm reading a file line by line and running ssh or ffmpeg, only the first line gets processed!


Found 3 posible solutions:




  1. Use the shell syntax proposed before by @StéphaneChazelas

  2. Redirect the stdin with < /dev/null

  3. Use ffmpeg with the -nostdin option






share|improve this answer

































    0














    [not really an answer; it's impossible to format anything in comments]



    Notice that the files not found have the leading 6, 7 or 8 chars from /mnt/zbig cut off:



    /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal.mp4  [ok]
    ...
    big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4 [error]
    ...
    g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4 [error]


    I strongly suspect there's some multibyte charset / locale bug in bash; try running your script with LC_ALL=C your_script.sh and see if it makes any difference. Since the bug is not related to ffmpeg or other stuff, but only to read, you probably can reduce your test case to



    find . -type f -name "*.mp4" ... | while read -r f; do
    ls "$f"
    done > /dev/null


    Please also mention (in your question) your distro and bash version.



    Of course, using find | read -r is horrible, but this is not the point of the question, right? And unless this is some simple user error, a bug is bug, whether the code exercising it is exemplary or not.






    share|improve this answer


























    • LC_ALL=C didn't change anything, same error. Nor renaming Edición to Edicion. This is bash 4.4.23 under FreeBSD 11.2, inside a iocage jail. But you were right about find | read -r, this was the problem. Thanks!

      – vicmarto
      Mar 5 at 13:17











    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f504291%2fcharacters-randomly-disappearring-from-the-output-of-find%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    One possible explanation is that one command in the loop is reading from stdin (which in this case is the same stream that read is meant to read from). As you found out, that would be ffmpeg which does allow the user to control the encoding over the keyboard (unless you pass the -nostdin option), hence the reading from stdin to get user input.



    That's one of the several issues with looping over find's output that way.



    Use the:



    find ... -exec sh -c '
    for mp4file do
    ...
    done' sh {} +


    standard syntax (where the stdin of sh and ffmpeg is left unaffected), or one of the other approaches described at Why is looping over find's output bad practice? which would also remove the problems with file names that contain newline characters (or $IFS contains 4 with your approach).






    share|improve this answer


























    • Thanks, the problem was looping over find's output. Changing the script as suggested worked.

      – vicmarto
      Mar 5 at 9:08













    • @vicmarto, you're welcome. What is not explained though is why ffmpeg (or mv or another command in the loop) would be reading some random number of bytes from stdin.

      – Stéphane Chazelas
      Mar 5 at 9:43
















    2














    One possible explanation is that one command in the loop is reading from stdin (which in this case is the same stream that read is meant to read from). As you found out, that would be ffmpeg which does allow the user to control the encoding over the keyboard (unless you pass the -nostdin option), hence the reading from stdin to get user input.



    That's one of the several issues with looping over find's output that way.



    Use the:



    find ... -exec sh -c '
    for mp4file do
    ...
    done' sh {} +


    standard syntax (where the stdin of sh and ffmpeg is left unaffected), or one of the other approaches described at Why is looping over find's output bad practice? which would also remove the problems with file names that contain newline characters (or $IFS contains 4 with your approach).






    share|improve this answer


























    • Thanks, the problem was looping over find's output. Changing the script as suggested worked.

      – vicmarto
      Mar 5 at 9:08













    • @vicmarto, you're welcome. What is not explained though is why ffmpeg (or mv or another command in the loop) would be reading some random number of bytes from stdin.

      – Stéphane Chazelas
      Mar 5 at 9:43














    2












    2








    2







    One possible explanation is that one command in the loop is reading from stdin (which in this case is the same stream that read is meant to read from). As you found out, that would be ffmpeg which does allow the user to control the encoding over the keyboard (unless you pass the -nostdin option), hence the reading from stdin to get user input.



    That's one of the several issues with looping over find's output that way.



    Use the:



    find ... -exec sh -c '
    for mp4file do
    ...
    done' sh {} +


    standard syntax (where the stdin of sh and ffmpeg is left unaffected), or one of the other approaches described at Why is looping over find's output bad practice? which would also remove the problems with file names that contain newline characters (or $IFS contains 4 with your approach).






    share|improve this answer















    One possible explanation is that one command in the loop is reading from stdin (which in this case is the same stream that read is meant to read from). As you found out, that would be ffmpeg which does allow the user to control the encoding over the keyboard (unless you pass the -nostdin option), hence the reading from stdin to get user input.



    That's one of the several issues with looping over find's output that way.



    Use the:



    find ... -exec sh -c '
    for mp4file do
    ...
    done' sh {} +


    standard syntax (where the stdin of sh and ffmpeg is left unaffected), or one of the other approaches described at Why is looping over find's output bad practice? which would also remove the problems with file names that contain newline characters (or $IFS contains 4 with your approach).







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Mar 6 at 9:54

























    answered Mar 4 at 16:37









    Stéphane ChazelasStéphane Chazelas

    311k57589946




    311k57589946













    • Thanks, the problem was looping over find's output. Changing the script as suggested worked.

      – vicmarto
      Mar 5 at 9:08













    • @vicmarto, you're welcome. What is not explained though is why ffmpeg (or mv or another command in the loop) would be reading some random number of bytes from stdin.

      – Stéphane Chazelas
      Mar 5 at 9:43



















    • Thanks, the problem was looping over find's output. Changing the script as suggested worked.

      – vicmarto
      Mar 5 at 9:08













    • @vicmarto, you're welcome. What is not explained though is why ffmpeg (or mv or another command in the loop) would be reading some random number of bytes from stdin.

      – Stéphane Chazelas
      Mar 5 at 9:43

















    Thanks, the problem was looping over find's output. Changing the script as suggested worked.

    – vicmarto
    Mar 5 at 9:08







    Thanks, the problem was looping over find's output. Changing the script as suggested worked.

    – vicmarto
    Mar 5 at 9:08















    @vicmarto, you're welcome. What is not explained though is why ffmpeg (or mv or another command in the loop) would be reading some random number of bytes from stdin.

    – Stéphane Chazelas
    Mar 5 at 9:43





    @vicmarto, you're welcome. What is not explained though is why ffmpeg (or mv or another command in the loop) would be reading some random number of bytes from stdin.

    – Stéphane Chazelas
    Mar 5 at 9:43













    1














    Well, finally found the reason why my original code didn't worked. Problem was ffmpeg and how it interacts with stdin. More about this can be read here:




    • Shellcheck: SC2095

    • I'm reading a file line by line and running ssh or ffmpeg, only the first line gets processed!


    Found 3 posible solutions:




    1. Use the shell syntax proposed before by @StéphaneChazelas

    2. Redirect the stdin with < /dev/null

    3. Use ffmpeg with the -nostdin option






    share|improve this answer






























      1














      Well, finally found the reason why my original code didn't worked. Problem was ffmpeg and how it interacts with stdin. More about this can be read here:




      • Shellcheck: SC2095

      • I'm reading a file line by line and running ssh or ffmpeg, only the first line gets processed!


      Found 3 posible solutions:




      1. Use the shell syntax proposed before by @StéphaneChazelas

      2. Redirect the stdin with < /dev/null

      3. Use ffmpeg with the -nostdin option






      share|improve this answer




























        1












        1








        1







        Well, finally found the reason why my original code didn't worked. Problem was ffmpeg and how it interacts with stdin. More about this can be read here:




        • Shellcheck: SC2095

        • I'm reading a file line by line and running ssh or ffmpeg, only the first line gets processed!


        Found 3 posible solutions:




        1. Use the shell syntax proposed before by @StéphaneChazelas

        2. Redirect the stdin with < /dev/null

        3. Use ffmpeg with the -nostdin option






        share|improve this answer















        Well, finally found the reason why my original code didn't worked. Problem was ffmpeg and how it interacts with stdin. More about this can be read here:




        • Shellcheck: SC2095

        • I'm reading a file line by line and running ssh or ffmpeg, only the first line gets processed!


        Found 3 posible solutions:




        1. Use the shell syntax proposed before by @StéphaneChazelas

        2. Redirect the stdin with < /dev/null

        3. Use ffmpeg with the -nostdin option







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 6 at 12:30

























        answered Mar 6 at 8:31









        vicmartovicmarto

        207




        207























            0














            [not really an answer; it's impossible to format anything in comments]



            Notice that the files not found have the leading 6, 7 or 8 chars from /mnt/zbig cut off:



            /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal.mp4  [ok]
            ...
            big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4 [error]
            ...
            g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4 [error]


            I strongly suspect there's some multibyte charset / locale bug in bash; try running your script with LC_ALL=C your_script.sh and see if it makes any difference. Since the bug is not related to ffmpeg or other stuff, but only to read, you probably can reduce your test case to



            find . -type f -name "*.mp4" ... | while read -r f; do
            ls "$f"
            done > /dev/null


            Please also mention (in your question) your distro and bash version.



            Of course, using find | read -r is horrible, but this is not the point of the question, right? And unless this is some simple user error, a bug is bug, whether the code exercising it is exemplary or not.






            share|improve this answer


























            • LC_ALL=C didn't change anything, same error. Nor renaming Edición to Edicion. This is bash 4.4.23 under FreeBSD 11.2, inside a iocage jail. But you were right about find | read -r, this was the problem. Thanks!

              – vicmarto
              Mar 5 at 13:17
















            0














            [not really an answer; it's impossible to format anything in comments]



            Notice that the files not found have the leading 6, 7 or 8 chars from /mnt/zbig cut off:



            /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal.mp4  [ok]
            ...
            big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4 [error]
            ...
            g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4 [error]


            I strongly suspect there's some multibyte charset / locale bug in bash; try running your script with LC_ALL=C your_script.sh and see if it makes any difference. Since the bug is not related to ffmpeg or other stuff, but only to read, you probably can reduce your test case to



            find . -type f -name "*.mp4" ... | while read -r f; do
            ls "$f"
            done > /dev/null


            Please also mention (in your question) your distro and bash version.



            Of course, using find | read -r is horrible, but this is not the point of the question, right? And unless this is some simple user error, a bug is bug, whether the code exercising it is exemplary or not.






            share|improve this answer


























            • LC_ALL=C didn't change anything, same error. Nor renaming Edición to Edicion. This is bash 4.4.23 under FreeBSD 11.2, inside a iocage jail. But you were right about find | read -r, this was the problem. Thanks!

              – vicmarto
              Mar 5 at 13:17














            0












            0








            0







            [not really an answer; it's impossible to format anything in comments]



            Notice that the files not found have the leading 6, 7 or 8 chars from /mnt/zbig cut off:



            /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal.mp4  [ok]
            ...
            big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4 [error]
            ...
            g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4 [error]


            I strongly suspect there's some multibyte charset / locale bug in bash; try running your script with LC_ALL=C your_script.sh and see if it makes any difference. Since the bug is not related to ffmpeg or other stuff, but only to read, you probably can reduce your test case to



            find . -type f -name "*.mp4" ... | while read -r f; do
            ls "$f"
            done > /dev/null


            Please also mention (in your question) your distro and bash version.



            Of course, using find | read -r is horrible, but this is not the point of the question, right? And unless this is some simple user error, a bug is bug, whether the code exercising it is exemplary or not.






            share|improve this answer















            [not really an answer; it's impossible to format anything in comments]



            Notice that the files not found have the leading 6, 7 or 8 chars from /mnt/zbig cut off:



            /mnt/zbig/media/Movies/Edición/@video-remux/8 El hijo de Randal.mp4  [ok]
            ...
            big/media/Movies/Edición/@video-remux/19 La cueva de las flores.mp4 [error]
            ...
            g/media/Movies/Edición/@video-remux/21 La fiesta de la Luna.mp4 [error]


            I strongly suspect there's some multibyte charset / locale bug in bash; try running your script with LC_ALL=C your_script.sh and see if it makes any difference. Since the bug is not related to ffmpeg or other stuff, but only to read, you probably can reduce your test case to



            find . -type f -name "*.mp4" ... | while read -r f; do
            ls "$f"
            done > /dev/null


            Please also mention (in your question) your distro and bash version.



            Of course, using find | read -r is horrible, but this is not the point of the question, right? And unless this is some simple user error, a bug is bug, whether the code exercising it is exemplary or not.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 4 at 17:13

























            answered Mar 4 at 16:53









            Uncle BillyUncle Billy

            8488




            8488













            • LC_ALL=C didn't change anything, same error. Nor renaming Edición to Edicion. This is bash 4.4.23 under FreeBSD 11.2, inside a iocage jail. But you were right about find | read -r, this was the problem. Thanks!

              – vicmarto
              Mar 5 at 13:17



















            • LC_ALL=C didn't change anything, same error. Nor renaming Edición to Edicion. This is bash 4.4.23 under FreeBSD 11.2, inside a iocage jail. But you were right about find | read -r, this was the problem. Thanks!

              – vicmarto
              Mar 5 at 13:17

















            LC_ALL=C didn't change anything, same error. Nor renaming Edición to Edicion. This is bash 4.4.23 under FreeBSD 11.2, inside a iocage jail. But you were right about find | read -r, this was the problem. Thanks!

            – vicmarto
            Mar 5 at 13:17





            LC_ALL=C didn't change anything, same error. Nor renaming Edición to Edicion. This is bash 4.4.23 under FreeBSD 11.2, inside a iocage jail. But you were right about find | read -r, this was the problem. Thanks!

            – vicmarto
            Mar 5 at 13:17


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f504291%2fcharacters-randomly-disappearring-from-the-output-of-find%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

            is 'sed' thread safe

            How to make a Squid Proxy server?