VideoHelp Forum




+ Reply to Thread
Results 1 to 4 of 4
  1. Member
    Join Date
    Apr 2023
    Location
    Alicante, Spain
    Search Comp PM
    Hi all,

    New here and hoping to get some help in the right direction!

    I have a collection of over 60 MiniDV tapes which I've successfully copied through firewire on my MacBook Pro 2012 following this guide:
    https://leolabs.org/blog/capture-minidv-on-macos

    I've now got a collection of 4000+ individual clips that's have been converted to h264 .mp4 so I can store them on my Google Photos account for easy access. However due to the nature of how we used the camera, many of the clips are only a few seconds long and have many clips filmed the same time in succession. I gave ChatGPT a go and asked it to write me script where it would go through all the clips, find ones that were recorded within 5 minutes of each other and then use ffmpeg to merge them into one large file chronologically with the filename of the first clip in the order. It would then take the original clips and move them into a another folder.

    After much troubleshooting I couldn't get it to parse the dates correctly, it refused to understand them no matter how it was laid out. I then decided I'd manually move the clips I wanted merging into separate folders. I then asked ChatGPT to write a script for this and it seemed to work great.... Until I watched the merged clips back. Some would be missing clips entirely while others would have them in the wrong order. I've come to realise out AI overlords are not quite smart enough yet so have taken to posting here.

    Does anyone have any experience with this and knows a better way?
    The files are saved like this: 2000-12-31_235959_NameOfTape.mp4
    Quote Quote  
  2. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    If I was doing it I would simply sort all of the video clips in time order, I use Directory Opus. Then add a leading 4 char leading number for each clip, 0001 to 4000. Then eyeball, identify a series of clips that fit your criteria of several clips with very similar starting date. Then select and move them to a separate folder and use ffmpeg to concatenate that bunch of 10 clips to a single file. If say there were 10 of these clips starting at 0051 to 0060 then name the concatenated output file 0051a and copy it back into the main folder of previously 4000 clips, but is now 3991 clips. So the numbering is now 0050, 0051a, 0061 …

    I would name the folder with the 10 clips 0051a. Then do the same for any more sets.

    If required, when finished, renumber all thats left in the main folder and remove the old numbers.
    Last edited by JN-; 30th Apr 2023 at 07:42.
    Quote Quote  
  3. Member
    Join Date
    Apr 2023
    Location
    Alicante, Spain
    Search Comp PM
    Originally Posted by JN- View Post
    If I was doing it I would simply sort all of the video clips in time order, I use Directory Opus. Then add a leading 4 char leading number for each clip, 0001 to 4000. Then eyeball, identify a series of clips that fit your criteria of several clips with very similar starting date. Then select and copy or move? them to a separate folder and use ffmpeg to concatenate that bunch of 10 clips to a single file. If say there were 10 of these clips starting at 0051 to 0060 then name the concatenated output file 0051a and copy it back into the main folder of previously 4000 clips.

    I would name the folder with the 10 clips 0051a.
    Thanks for the response, I was able to figure out a way last night that is pretty much that.

    In case it helps anyone, as the clips were already in order from timestamp being at the start of the filenames I eyeballed the clips, selected them, used the CMD+CTRL+N shortcut on Mac to put them into a new folder and did this for each group I needed to stitch. Then ran this in the head directory to stitch each folder into one video:

    path_to_folders="/path/to/folders"

    for folder in "$path_to_folders"/*; do
    if [ -d "$folder" ]; then
    cd "$folder" || continue

    folder_name=$(basename "$folder")
    output_path="/output/path"

    first_file=$(ls *.mp4 | head -n 1)
    output_dir="output"
    output_name="${first_file%.*}-stitched.mp4"

    for f in *.mp4 ; do
    echo "file '$f'" >> list.txt
    done

    ffmpeg -f concat -safe 0 -i list.txt -c copy "$output_path/$output_name"

    rm list.txt
    cd ..
    fi
    done
    Quote Quote  
  4. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    Excellent.
    Quote Quote  



Similar Threads

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