I have begun (finally) a project to combine and catalog family video files from multiple sources - camcorder, cell phones, digital cameras, etc. My problem arises from that many of these are short but sequential clips, sometimes of different resolutions, and of different formats. My goal is files that are assembled into watchable lengths or uniform resolution with tags so we can tell what is what. I am working with literally 1000s of little files with the goal of several dozen or so - maybe a hundred - at the end.
So far, my process is (and it works):
The rub is step 3. MP4Box uses this format:
MP4BOX -cat file_one.mp4 -cat file_two.mp4 -cat file_three.mp4... ad nausium ... -new new_file.mp4
This is fine except I'm combining DOZENS of files at a time with names like 100_20130704.mp4. The typing is killing me. The upshot is MP4Box is great and reliably combines the files and does so very quickly. I've tried other ways to combine video files and none are as stable in operation as MP4Box has been. Point is - I'm not looking for a new process, I just want to automate the list of filenames into the MP4Box command.
At one point I started using this to rename the files after segregating them into folders that contain a single group that I want to merge:
a=1; for i in *.jpg; do new=$(printf "%02d.jpg" "$a"); mv -i -- "$i" "$new" let a=a+1; done
This at least gave me a list of files as 01.mp4, 02.mp4, 03.mp4, etc. so I could re-use the previous MP4BOX command after editing it so a little bit.
What I'd REALLY like is a way to run the command on the directory listing without manually listing the files and ultimately have a service menu that would let you select a group of files to combine. I'm willing to allow the files to be combined in alphabetical order since I'm manually reviewing them anyway, but file date ordering as a option would be nice too.
I'd have to be able to create a list, then insert it into the MP4Box command with "-cat" in front of each filename and have the new file name at the end.
My thought currently is to dump the file list to a text file, use sed to insert " -cat " before each file name and remove the carriage returns so it's a single line, insert "MP4Box" at the front of the line and " -new " and a prompted file name at the end and then execute it.
Any better ideas or amazing suggests to do this well?
So far, my process is (and it works):
- Manually review, sort, and order clips into groups for combining.
- Use Handbrake to covert all the clips to mp4 while simultaneously re-sizing clips I want grouped together to they can be combined.
- Use the command-line utility MP4Box to string the clips together.
- Use puddletag to tag the files with content info (event, people, and places).
- Move them onto my media server for family viewing and sharing.
The rub is step 3. MP4Box uses this format:
MP4BOX -cat file_one.mp4 -cat file_two.mp4 -cat file_three.mp4... ad nausium ... -new new_file.mp4
This is fine except I'm combining DOZENS of files at a time with names like 100_20130704.mp4. The typing is killing me. The upshot is MP4Box is great and reliably combines the files and does so very quickly. I've tried other ways to combine video files and none are as stable in operation as MP4Box has been. Point is - I'm not looking for a new process, I just want to automate the list of filenames into the MP4Box command.
At one point I started using this to rename the files after segregating them into folders that contain a single group that I want to merge:
a=1; for i in *.jpg; do new=$(printf "%02d.jpg" "$a"); mv -i -- "$i" "$new" let a=a+1; done
This at least gave me a list of files as 01.mp4, 02.mp4, 03.mp4, etc. so I could re-use the previous MP4BOX command after editing it so a little bit.
What I'd REALLY like is a way to run the command on the directory listing without manually listing the files and ultimately have a service menu that would let you select a group of files to combine. I'm willing to allow the files to be combined in alphabetical order since I'm manually reviewing them anyway, but file date ordering as a option would be nice too.
I'd have to be able to create a list, then insert it into the MP4Box command with "-cat" in front of each filename and have the new file name at the end.
My thought currently is to dump the file list to a text file, use sed to insert " -cat " before each file name and remove the carriage returns so it's a single line, insert "MP4Box" at the front of the line and " -new " and a prompted file name at the end and then execute it.
Any better ideas or amazing suggests to do this well?
Comment