I am a noob and trying to build a post processing type script for Plex. With help from some co workers and google I have put together the following script to convert mkv files to mp4 files.
The script is to "find" any and all files in the media directory and convert them to mp4 files.
It finds the first one, processes correctly and quits - why?? I need help getting this scrip to loop. I have have the quirky find command written this way so the "find" command will will capture the file name with spaces and the dirname command will work.
Script ---
find -L "/media/4tbdisk/test/" -type f -name '*.mkv' -print0 | while IFS= read -r -d $'\0' FILE; do
echo "filename is ---" "$FILE";
DIR=$(dirname "${FILE}");
echo "directory is --" $DIR;
transcode-video --mp4 --quick "$FILE" --output "$DIR";
done
What happens is that the script will find an mkv file and process it but will not continue looping through to process the rest. If the first file it finds already has been processed the "transcode" script will say "out put file exists..." and will continue on to the next, but after it creates the first mp4 file it stops
thanks in advance haeffnkr