NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I have some OpenStreetCam mp4 sequences that I would like to use for some local editing without first unloading them to OpenStreetCam.

Is there a way to get these into JOSM without sending them all the way up to a remote server and bringing them back down again?

Ripping the images from the mp4s shouldn't be too difficult, but while NMEA-like, JOSM thinks the metadata files aren't valid NMEA files. There seem to be some scripts here but they're a little light on documentation for someone who lives in GUI land and while they'll generate exif, it's not clear if they will extract images first.

asked 11 Dec '19, 19:20

InsertUser's gravatar image

InsertUser
11.0k1369185
accept rate: 19%

1

I'm not clear what you are trying to achieve and what issue you have. Do you want to show the images with the street cam plugin? Do you want to show the locations where the images have been taken? Did you try to open an image file with the standard open command and failed?

(12 Dec '19, 08:09) TZorn

I'm after any method of getting them into JOSM without upload.

I don't really mind whether that is:

  • a hidden setting in the OSC plugin that lets you use local files or
  • a way of ripping images from the videos and a track from the metadata file to manually synchronize them in JOSM, or
  • some way of extracting images and writing coordinates to the exif data (thought osc_tools.py might do this, but it just seems to say it's "finished" without changing any files).

I realize that uploading would be easier, but with no apparent way to trim sequences I'm not really comfortable uploading this set of images.

(12 Dec '19, 14:58) InsertUser

I am not aware of a plug-in for JOSM that can deal with mp4 files. You can extract the images from a "normal" MP4 file using ffmpeg but those images will not be geo-referenced. There are some tools that allow you to add gps exif data to photos but you'll need to get that somehow from the MP4 file. But, again, I don't think there is a standard for how GPX data can be encoded in a MP4 file. And it is not clear to me that OpenStreetCam's MP4 file adheres to standards.

For what its worth, I was dealing with a similar issue when setting up my "dash cam mapping" methodology. Fortunately for me I found some code on the Internet that was able to extract the proprietary format GPX information from my dash cam's video. I used that along with ffmpeg and exiftool to create my dashcam2josm script.

In my case, I happen to use the scripts your link points to up upload the still georeferenced images from my dashcam2josm script to OpenStreetCam. I do that because I figure there are things that I am not worried about mapping (fire hydrants, bus stops, etc.) that others might want to have imagery for.

Getting back to your issue, it looks like the generate_exif script in the https://github.com/openstreetcam/upload-scripts repository may be what you need. But it has been so long since I gave up trying to use the OpenStreetCam app that I am not sure what files it generates and don't really know what the script help message means about "Folder PATH with OSC metadata file and images". Can you extract the images from the file using ffmpeg? If so then maybe the generate_exif script would then add the GPS data to them. . . Just a guess though.

upload-scripts$ python osc_tools.py generate_exif -h
usage: python osc_tools.py generate_exif [-h] -p PATH [-l {d,i,w}]

optional arguments:
  -h, --help            show this help message and exit
  -p PATH, --path PATH  Folder PATH with OSC metadata file and images
  -l {d,i,w}, --log_level {d,i,w}
                        Level of logging to console:
                          d level (debug) will log every event to the console
                          i level (info) will log every event more severe than debug level to the console
                          w level (warning) will log every event more severe than info level to the console
permanent link

answered 12 Dec '19, 16:17

n76's gravatar image

n76
10.8k1082172
accept rate: 17%

I think the PATH is just the folder location. The script seems to do nothing except claim to be 'finished'.

From the app I get a 'track.txt.gz' file and several videos '0.mp4', '1.mp4' etc. I assume the compressed text file is what is called the 'metadata file' in the documentation. It seems to be a semicolon delimited file with each line starting with a unix time stamp and one or more columns that contain what appear to be coordinates and other data. Column 15 and 16 look like video file and (overall) picture number?

Oddly, the script fails to recognize the metadata unless I manually uncompressed it first. I think the script is silently failing to run gzip when run from powershell. (WSL-bash has it but I'm having trouble with other dependancies.) I wonder if there are other things failing that aren't making it to the console.

(12 Dec '19, 18:33) InsertUser

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×622
×8
×4

question asked: 11 Dec '19, 19:20

question was seen: 1,640 times

last updated: 12 Dec '19, 18:35

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum