need help with a script written for avidemux


Recommended Posts

hi i know the avidemux isnt the forum to ask for a script and i not sure if this is the right subfolder for script

 

but i looking for help  how to read all videos    it be like avi moi flv mp4 even mkv  i have more then 200k of videos 

id like a batch program to read all of them and remux them into mkv  and delete all metatags

then if there is any errors  the script file would log it if any videos are out of sync  

id also want it to recreate it in a different folder with the same subdiectories...    i have tried  mkvtoolnix  but thats going to take me forever... but 500 at a time

 

anyone have a script or point me to the right directions  as i dont know how to write any of it

Edited by comet424
Link to comment

hi i didnt notice the one reply   and i been a way and really havent done much  but i was fiddling with your code but i cant get it to work right.. i modified it as my home videos and such have spaces   i googled   as i get -iname error so i changed it to -name   but here is my current code  

as i trying to search for everything   and then after remux  everything and log any errors  

i getting multiple errors my first error is   

 

"aa: line 7: cd: too many arguments
/mnt/user/Home Videos/test/"

 

and it doesnt like the find search pattern  about using the -iname  and the directory needs to be prior to the filename...  so what si wrong in this code i modified from ya.. 

#!/bin/bash

startpath="/mnt/user/Home Videos/test/" ### main place where to look for
searchpattern="*.*"                     ### what type of files to look for
extradelpattern=".idx2"                 ### extra delete type - sample, avidemux file

cd $startpath

echo $startpath
#find . -mindepth 2 -name $searchpattern|sed "s|^\./||"|while read fname; do
find . -name $searchpattern|sed "s"|while read fname; do
        echo "$fname"
        sourcefile=$(basename '$fname')
        extrafile='$sourcefile$extradelpattern'
        filepath=$(dirname '$fname')
echo "hello"
        cd '$startpath/$filepath'
echo $startpath
echo $filepath

        if ! [ -n "$(lsof "$sourcefile")" ]; then
                if ! [ -f "$extrafile" ]; then
                        docker exec Avidemux /usr/bin/avidemux3_cli --load '$fname' --save '/output/'$fname'.mkv'--q>
                        echo "$sourcefile Converting To MKV..."
                else
                        echo "$extrafile already there..."
                fi
        else
                echo "$sourcefile in use ..."
        fi
echo"done"
done

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.