telemetry-injector takes a series of geotagged photos and creates a video with either CAMM or GPMD telemetry.
We needed a way to upload to videos to the Google Street View API for our Trail Maker product.
Previously we uploaded videos alongside a gpx files as described in our blog; Creating a Video File Ready to be Uploaded to the Google Street View API.
However, we wanted a way to inject telemetry into the video so that the video could be shared elsewhere, without the requirement to always share the GPX file alongside it.
Google Street View supports CAMM and GPMD telemetry standards.
Therefore this script;
- takes a series of geotagged images
- parses out the telemetry into a gpx file
- creates a camm / gpmd binary file from gpx
- creates a video file from photos
- injects the camm binary stream into the video
The specifics of how each step in this process works...
Karamvir TODO
Download
git clone https://github.com/trek-view/telemetry-injector
cd telemetry-injector
Setup virtual environment
python3 -m venv telemetry-injector_venv
source telemetry-injector_venv/bin/activate
Install required libraries
pip3 install -r requirements.txt
python3 telemetry-injector.py -c -i INPUT_IMAGE_DIRECTORY/ -o OUTPUT_VIDEO_FILE.mp4
-g
: Flag to use gpmf metadata injection.-c
: Flag to use camm metadata injection.-i
: Input image directory.-v
: Input mp4 files, should be mp4 video.-x
: Input gpx files, should be mp4 video.-o
: Output video file conataining metadata.
For camm
images metadata injection
python3 telemetry-injector.py -c -i input_image_directory -o OUTPUT_VIDEO_FILE.mp4
For gpmf
images metadata injection
python3 telemetry-injector.py -g -i input_image_directory -o OUTPUT_VIDEO_FILE.mp4
For camm
video metadata injection
python3 telemetry-injector.py -c -v input_mp4_video_file -x input_gpx_file -o output_mp4_video_file
For gpmf
video metadata injection
python telemetry-injector.py -g -v input_mp4_video_file -x input_gpx_file -o output_mp4_video_file