Combine m4v files into one for each day

Is there any way to combine the m4v files into one file ?


We recently had a car vandalised and i want to be able to search previous days videos for a particular bicycle (rider rode up and stabbed tyres).

I normally use the browser window, but it's too slow at times, a combined video would be far better (then use quicktime to browse it).

I've tried Quicktime/iMovie to convert (failed as there were too many files), a terminal command would be preferable if possible.


I'm currently trying out "Any MP4 Mac Video Converter", but it takes up a lot of resources (there could be 1,000 files per day and six cameras)


Any help appreciated, thank you

Comments

  • I don't know of a way to easily concatenate m4v files, however I can suggest a way to find this event.

    If you have enabled the option in SecuritySpy under Preferences > Cameras > Triggers > Save AI data for future search, you will be able to use the Browser feature to easily find these events in the recorded footage for these cameras. In the menu at the top of the Browser window, select "Advanced Search", draw on the video image the area of interest, and select the "Humans" option. This will return a list of all detected humans in the specified area.

    This will only work if you have enabled this option already; it won't be able to re-analyse the files if the option was not enabled.

  • Thank you Ben,

    I've added the options you advise, will see how it goes.


    I did manage to acccomplish what I wanted, for the benefit of anyone else who may want to do this, please read.

    I installed ffmpeg through "brew", i already had brew installed.

    I then created a folder to store the combined file and copied over the directory i wanted to combine (no real need for this, i just wanted to play it safe during testing).

    Using terminal, i changed into this directory and isssued this command :- find . -name "* *" -type f | rename 's/ /_/g'

    This replaces all whitespace in the filename with an underscore.

    Next I issued thiis command :- printf "file '%s'\n" *.m4v > files.txt

    This creates a file named "files.txt" and places the word "file " (with a space) and the filename on a line in the text file, it is recursive so does every m4v (might have to change this to mov) in the directory.

    There should be multiple lines that look similar to this line :- file '04-10-2023_00-04-10_M_Front.mov'


    Next i issue this command :- ffmpeg -f concat -i files.txt -c copy output.mov , change the output filename to anything you like, and if the files you're converting have a different extension (eg m4v) then just change the command to reflect this.


    A little long winded, but once you've figured out the details it only takes a minute or so to do 1,000 files.


    Hope this helps someone.

  • MKVTools is a great Mac app you can use to join mkv files. There is a free version with an annoying pop up window suggesting you register but it only costs $6 USD to do so if you want.

    You can choose to join the files by fully reencoding them or it has passthrough mode which is quick as and simply joins them together. You can choose separate options for the audio and video tracks.

    The registration code is tied to your macos username so you can use it on any Mac with the same user name.

    https://emmgunn.com/wp/mkvtools-home/

  • Thank you,

    However, some files from a different camera are mov files and they took a lot longer to process, but the reult was the same, multiple files successfully joined,


    Thaank you dmg15, I downloaded and used MKVTools but it was not able to jon the files together "The application can only edit MKV files."

    I suspect i would have to convert them first (it can open mov files for that), but I dont see the point of creating another 1,000 files to join them together.

    It's a pity as it would have been a nice solution.

    (Please correct me if I'm wrong)

  • My bad.. i linked you to the wrong one. There’s an MP4Tools too..

    https://emmgunn.com/wp/mp4tools-home/