VideoHelp Forum



+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Member
    Join Date
    Apr 2017
    Location
    England
    Search Comp PM
    Now I can batch process clips, thanks again, it gives me one more problem, namely a muddled folder full of original and processed clips. Mkdir produces a new folder, but how do I get ffmpeg to place its output in there please?
    Quote Quote  
  2. Add the desired path 'in front of' the output filename i.e.: C:\mypath\clip.mkv (windows) or /whatever/path/clip.mkv (linux)
    Quote Quote  
  3. Side to babiulep answer it will be good to add two additional steps - detection if required folder / directory exist and if not exist then create desired folder
    Quote Quote  
  4. creation of a new directory was used in that "scary" python script
    bash script with simple relative directory path:
    Code:
    #!/bin/bash
    DIR_NAME="new_709_files"
    mkdir -p ${DIR_NAME} #create that directory on disk if it does not exist
    for filename in *.mp4
    do
      NAME=$(basename "${filename}" .mp4)
      OUTPUT_FILENAME="${DIR_NAME}/${NAME}.mp4"
      ffmpeg -y -i "${filename}" -c copy "${OUTPUT_FILENAME}" # example, it does nothing just copies mp4 to that new folder
    done
    sometimes it is better to use absolute path, to work with absolute paths, if working directory is not the same as script etc. (not your case perhaps), then to get absolute path for you ffmpeg cmd:
    Code:
    #!/bin/bash
    DIR_NAME="new_709_files"
    mkdir -p ${DIR_NAME} #create that directory on disk
    ABSOLUTE_OUTPUT_DIR_NAME=$(cd ${DIR_NAME}; pwd)  #creates absolute path for that new directory
    for filename in *.mp4
    do
      NAME=$(basename "${filename}" .mp4)
      OUTPUT_FILENAME="${ABSOLUTE_OUTPUT_DIR_NAME}/${NAME}.mp4"
      ffmpeg -y -i "${filename}" -c copy "${OUTPUT_FILENAME}"
    done
    Quote Quote  
  5. Member
    Join Date
    Apr 2017
    Location
    England
    Search Comp PM
    Thank you all. Once again, with a bit of patience and some tinkering, it works a treat.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!