{"id":17058772,"url":"https://github.com/smkent/helmet-camera","last_synced_at":"2025-03-23T07:23:32.563Z","repository":{"id":150156530,"uuid":"59450372","full_name":"smkent/helmet-camera","owner":"smkent","description":"Bicycle helmet camera file management tools","archived":false,"fork":false,"pushed_at":"2018-09-19T04:37:24.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-28T14:15:09.838Z","etag":null,"topics":["file-management","udev"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smkent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-23T03:47:15.000Z","updated_at":"2023-09-08T17:10:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"a4833a2e-f03d-4efe-b383-f5c264fd7580","html_url":"https://github.com/smkent/helmet-camera","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smkent%2Fhelmet-camera","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smkent%2Fhelmet-camera/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smkent%2Fhelmet-camera/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smkent%2Fhelmet-camera/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smkent","download_url":"https://codeload.github.com/smkent/helmet-camera/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245068259,"owners_count":20555714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["file-management","udev"],"created_at":"2024-10-14T10:30:51.116Z","updated_at":"2025-03-23T07:23:32.540Z","avatar_url":"https://github.com/smkent.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Helmet camera video tools\n\nThese are file management tools for videos recorded by my bicycle helmet\ncamera.\n\n## Quick setup\n\n### Determine your camera's USB vendor and product ID\n\nPlug your camera into your computer and run `lsusb` to retrieve information\nabout connected USB devices. Locate your camera in the device list and note the\nUSB vendor and product ID for your device. For example, `lsusb` prints the\nfollowing for my camera (an original ContourROAM):\n\n```\nBus 003 Device 045: ID 0d64:5566 DXG Technology Corp.\n```\n\nIn this example, `0d64` and `5566` are the USB vendor and product ID,\nrespectively.\n\n### setup-udev\n\nTo automatically copy video files from your camera to your hard drive when your\ncamera is plugged in via USB, run `setup-udev` to install a udev rule for your\ndevice. Specify your camera's USB vendor and product ID, as well as a\ndestination directory to copy videos to:\n\n```shell\n./setup-udev -d path/to/videos/directory -v 0d64 -p 5566\n```\n\nThe udev rule will be placed in `/etc/udev/rules.d/81-helmet-camera.rules`.\n`setup-udev` will automatically reload the udev rules. Unplug and replug your\ncamera to test video import.\n\n`setup-udev` accepts additional arguments that can be passed along to\n`import-videos` via the installed udev rule. Run `setup-udev --help` for more\ninformation.\n\n### Email notification\n\nProvide an email address to `setup-udev` using `-e/--email-address` to receive\nan email notification when video import is complete. This feature requires your\nsystem to have a working sendmail in /usr/sbin/sendmail.\n\n## import-videos\n\n`import-videos` is meant to run automatically via udev. It mounts the camera\ndevice, copies video files to a directory specified by the user, and unmounts\nthe camera.\n\nI wrote this script to handle my specific camera (an original ContourROAM), but\nit may be useful for video import from any camera that presents videos to the\nhost via USB mass storage.\n\n### Manual udev rule installation\n\nAn appropriate udev rule can be automatically installed using `setup-udev`. See\nthe \"Quick setup\" section above for more information. These instructions\ndescribe how to configure udev manually.\n\nTo configure `import-videos` to run automatically, create a udev rule such as\nthe following (the entire rule must be placed on a single line):\n\n``` KERNEL==\"sd?1\", ATTRS{idVendor}==\"0d64\", ATTRS{idProduct}==\"5566\", ACTION==\"add\", MODE=\"664\", RUN+=\"/path/to/helmet-camera/import-videos -e 'email@example.com' -d '/path/to/videos/directory'\" ```\n\nNote that the `import-videos` executable name and the target videos directory\nargument must be absolute paths.\n\nThe email argument is optional, but recommended. If specified, a summary is\nemailed from and to the specified address when video import is complete. This\nfeature requires a working sendmail in /usr/sbin/sendmail.\n\nIf you have a camera other than the original ContourROAM, you will likely want\nto change the `idVendor` and `idProduct` values in the above example rule. You\ncan determine the correct values for your hardware by examining the output of\n`lsusb`.\n\nPlace your udev rule in `/etc/udev/rules.d`, for example in a file named\n`/etc/udev/rules.d/81-helmet-camera.rules`.\n\nAfter creating your udev rule, you may need to reload your udev configuration\nby running:\n\n```shell\n$ sudo udevadm control --reload\n```\n\nPlease note this udev rule has been tested on Gentoo Linux. I am not sure if\nthese instructions are portable to other Linux distributions.\n\n## organize-videos\n\nThis is a utility meant to be run manually for organizing already-imported\nvideo files. `import-videos` places all video files directly into the\nspecified destination directory. `organize-videos` can be used to organize\nvideo files into subdirectories based on the recording count.\n\n`organize-videos` uses a hardcoded organization method based on how the\nContourROAM names its video files. Please see the top of\n[video\\_utils/\\_\\_init\\_\\_.py](/video_utils/__init__.py) for an explanation.\n\nVideo file  organization can also happen automatically in `import-videos` with\nthe `-o`/`--organize` option.\n\n## cleanup-videos\n\nThis utility removes video files to free disk space, in order by video number\nfrom lowest to highest. `cleanup-videos` removes videos until the amount of\ndisk space specified by `-f`/`--free-space` (in GiB) is available.\n\nVideo file  organization can also happen automatically in `import-videos` by\nspecifying the desired amount of free disk space (in GiB) with the\n`-c`/`--clean-up-free-space` option.\n\n----\n\n## License\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n\nSee [`LICENSE`](/LICENSE) for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmkent%2Fhelmet-camera","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmkent%2Fhelmet-camera","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmkent%2Fhelmet-camera/lists"}