xamgore / camera-pipeline-scripts

Automatic video uploader from SD card to YouTube
MIT License
1 stars 0 forks source link

Split *.MTS files into groups #1

Open xamgore opened 6 years ago

xamgore commented 6 years ago

We need to be able to divide MTS files into groups, depending on the recording time and the time of lectures. This problem arises from the fact that we have a 128GB SD card, and we record lectures throughout the weeks. As a consequence, at the end of each week we have a bunch of files of this kind:

00000.MTS
00001.MTS
00002.MTS
00003.MTS
...
00027.MTS

For each, you can get the date of creation and group it with the help of the lecture schedule.

# OS X has "%SB" flag
$ stat -f%SB -t '%Y-%m-%d_%H.%M.mp4' ./00001.MTS

But I prefer a python (platform independent) implementation. it is highly recommended to write tests (we will connect them to TravisCI soon).

ottergottaott commented 6 years ago

Look at that nice wrapper https://pymediainfo.readthedocs.io/en/latest/

xamgore commented 6 years ago

Well, now we need some intelligent grouping algorithm, based on schedule.json and (start, duration) info.