Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RaspiStill: Apply gpsd info as EXIF tags #286

Merged
merged 6 commits into from
Aug 23, 2018
Merged

Conversation

jasaw
Copy link
Contributor

@jasaw jasaw commented Feb 2, 2016

Applies GPS information from gpsd as EXIF tags.
Enable via "-gps" command line argument and requires libgps.so.22 when
enabled.
Only these GPS info are added as EXIF tags: GPSDateStamp, GPSTimeStamp,
GPSMeasureMode, GPSSatellites, GPSLatitude, GPSLatitudeRef,
GPSLongitude, GPSLongitudeRef, GPSAltitude, GPSAltitudeRef, GPSSpeed,
GPSSpeedRef, GPSTrack, GPSTrackRef.

@jasaw
Copy link
Contributor Author

jasaw commented Feb 3, 2016

Good catch on both the errors. I've pushed a fix for both of them.

@jasaw
Copy link
Contributor Author

jasaw commented Feb 3, 2016

Here's a binary I've prepared earlier:
raspistill.gps.tar.gz

@6by9
Copy link
Contributor

6by9 commented Feb 12, 2016

Sorry, I hadn't seen the email saying this had been updated.
That looks OK on a moderately quick glance.

@popcornmix - are you happy with the licence header on the 2 new files? Looks OK to me as they are the same as those on the main RaspiStill files, but there's the subtle difference of Broadcom/James' code vs 3rd party.

I suspect @popcornmix will ask you to squash the commits if he and @JamesH65 are happy with the changes.

@Ruffio
Copy link

Ruffio commented Jul 30, 2016

@popcornmix are you happy with this PR?

@JamesH65
Copy link
Collaborator

@6by9 @jasaw this appears to have fallen through the cracks. Any thoughts on how to proceed?

@6by9
Copy link
Contributor

6by9 commented Jan 18, 2018

Still the open question to @popcornmix on licence of the two new files, other than that (and needing to rebase and resolve conflicts) I'm happy.

@JamesH65
Copy link
Collaborator

JamesH65 commented Jul 2, 2018

@jasaw Sorry about the delay, can you rebase this please to remove conflicts, then we can try and get it merged.

@popcornmix Any objections?

jasaw added 3 commits July 3, 2018 13:43
Applies GPS information from gpsd as EXIF tags.
Enable via "-gps" command line argument and requires libgps.so.21 when
enabled.
Only these GPS info are added as EXIF tags: GPSDateStamp, GPSTimeStamp,
GPSMeasureMode, GPSSatellites, GPSLatitude, GPSLatitudeRef,
GPSLongitude, GPSLongitudeRef, GPSAltitude, GPSAltitudeRef, GPSSpeed,
GPSSpeedRef, GPSTrack, GPSTrackRef.
@popcornmix
Copy link
Contributor

The new files appear to have the same 3 clause BSD licence we use for our code (with a different copyright author). That should be fine for us.

No objections here if you are happy.

@moose4621
Copy link

How do I call the gps data in raspistill. ie: -x GPS.GPSLatitude = ?

I would like to use this feature of raspistill. Any chance it can be merged anytime soon?

@jasaw
Copy link
Contributor Author

jasaw commented Aug 22, 2018

@moose4621 This PR reads GPS data from gpsd and records them as GPS EXIF tags. The purpose is to have GPS EXIF tags automatically update when raspistill is running in continuous mode. There's no need to specify GPSLatitude etc from command line.

@moose4621
Copy link

Great. Thank you.@jasaw.
Works a treat!
Awesome work.
Need to get this great function merged.

@moose4621
Copy link

@jasaw is there any way to make this feature available when taking single images instead of continuous mode?

Copy link
Collaborator

@JamesH65 JamesH65 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@6by9 seems ok to me but obviously cannot check it right now!

@6by9
Copy link
Contributor

6by9 commented Aug 22, 2018

@JamesH65 you had said you had a GPS receiver at home and were going to bring it in to test.

I'll try to find 5 minutes to give it a whirl. As long as it doesn't mess up existing installs where there is no GPS device, then I'm happy.

@kukabu
Copy link

kukabu commented Aug 22, 2018

@6by9 You can uses gpsfake for tests.
http://catb.org/gpsd/gpsfake.html

@6by9
Copy link
Contributor

6by9 commented Aug 22, 2018

Ooh, useful. Thank you.

@6by9
Copy link
Contributor

6by9 commented Aug 23, 2018

Tested with gpsfake and I'm happy.
Bombing out should -gps be set but gpsd/gpsfake not running may be a tad extreme, but not the end of the world.

@6by9 6by9 merged commit 4228b6c into raspberrypi:master Aug 23, 2018
@jasaw jasaw deleted the gps branch August 24, 2018 01:51
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Aug 24, 2018
kernel: bcm2835: interpolate audio delay
See: #1026

kernel: dtoverlays: Add support for ADV7280-M and ADV7281-M chips
See: raspberrypi/linux#2656

kernel: First batch of fixes for V4L2 camera driver
See: raspberrypi/linux#2609

kernel: Revert mm: alloc_contig: re-allow CMA to compact FS pages
See: raspberrypi/linux#2647

firmware: rawcam: Fix double buffer return issue
firmware: rawcam: Code cleanup

firmware: host_apps: Fixup partially merged commit from userland
See: #1027

firmware: mmal: Add KEEP_PORT_FORMATS flag to mmal connection
See: raspberrypi/userland#483

firmware: RaspiStill: Apply gpsd info as EXIF tags
See: raspberrypi/userland#286
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this pull request Aug 24, 2018
kernel: bcm2835: interpolate audio delay
See: raspberrypi/firmware#1026

kernel: dtoverlays: Add support for ADV7280-M and ADV7281-M chips
See: raspberrypi/linux#2656

kernel: First batch of fixes for V4L2 camera driver
See: raspberrypi/linux#2609

kernel: Revert mm: alloc_contig: re-allow CMA to compact FS pages
See: raspberrypi/linux#2647

firmware: rawcam: Fix double buffer return issue
firmware: rawcam: Code cleanup

firmware: host_apps: Fixup partially merged commit from userland
See: raspberrypi/firmware#1027

firmware: mmal: Add KEEP_PORT_FORMATS flag to mmal connection
See: raspberrypi/userland#483

firmware: RaspiStill: Apply gpsd info as EXIF tags
See: raspberrypi/userland#286
mkreisl added a commit to xbianonpi/xbian-package-firmware that referenced this pull request Feb 4, 2019
- bootcode: Re-enable the pull down on SD CLK pin immediately.

- firmware: Rawcam: Fixup buffering issues on fast fps

- firmware: MMAL alignment changes, plus a couple of minor fixes

- firmware: MMAL/IL: Fix for reducing alignment patch
  See: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=62364

- firmware: Added a dpi_timings config item

- firmware: Add DPI Driver default settings

- firmware: HVS channel should come from the DISPLAY_INFO

- firmware: Add POE HAT support

- firmware: video_encode: Drop back to software conversion if stride is not mod32
  See: Hexxeh/rpi-firmware#182

- firmware: arm_dt: Break out GPIO save/restore from HAT code as needed for PoE

- firmware: rawcam: Fix double buffer return issue
  firmware: rawcam: Code cleanup

- firmware: host_apps: Fixup partially merged commit from userland
  See: #1027

- firmware: mmal: Add KEEP_PORT_FORMATS flag to mmal connection
  See: raspberrypi/userland#483

- firmware: RaspiStill: Apply gpsd info as EXIF tags
  See: raspberrypi/userland#286

- firmware: arm_dt: Work around an absent cache-line-size
  See: raspberrypi/linux#2643

- firmware: Camplus: annotate: Check lines_available >= lines_required
  See: raspberrypi/userland#485

- firmware: video_decode: Fix memory leak on passing in codec config multiple times

- firmware: mmal: Correct encoding 4CC for SBGGR16

- firmware: 2ndstage: Report IP address in ARP response in network order

- firmware: video_decode: Fix error in previous memory leak patch

- firmware: video_encode: Add ISP conversion support for RGBX32

- firmware: platform: Also report soft temperature limit in get_throttled bits

- firmware: IL isp: minor code cleanups
- firmware: image_encode: Support Video domain on input port

- firmware: video_encode: Use default values on invalid nStride or nSliceHeight
  See: #1051

- firmware: gpioman/FXL6408: Handle open failing sensibly
  See: #1053

- firmware: Delay backlight coming on
  See: #1052

- firmware: LCD driver close fixes

- firmware: jpeg/mjpeg: MJPEG doesn't insert JFIF APP0 header
  See: raspberrypi/userland#345

- firmware: Add IL HVS component

- firmware: mmal: Acquire zero copy buffers on being passed to the VPU

- firmware: video_render: Use per pixel alpha on RGBA and BGRA

- firmware: video_render: Add support for alpha options (MIX and PREMULT)

- firmware: Move to driver based backlight
  See: #1063

- bootcode: Extend TEST_UNIT_READY timeout to 20 seconds, some hard drives take a really long time
  See: #898

- firmware: video_render: Treat an empty buffer with ENDOFFRAME set as a flush

- firmware: dispmanx: Add option to ignore all layers lower than the current layer

- firmware: arm_dt: Accept "csi" as a special DT node that masks IRQs

- firmware: MMAL: Include OPAQUE in the list of supported encodings where appropriate
  See: https://www.raspberrypi.org/forums/viewtopic.php?f=67&t=226416

- firmware: video_render: asserting on the buffer being unlocked is invalid

- firmware: video_render: Further fix to a vcos_verify

- firmware: IL hvs: Fail component create if the HVS or TXP interrupts are masked

- firmware: Clean up masked interrupt handling - moves it to intctrl

- firmware: vcinclude: Clean up INTERRUPT_xxx defines to use one place

- firmware: vcfw: camera_subsystem: Stop cameras being detected if ARM has Unicam instance

- firmware: vc_image: Fix up vc_image_bits_per_pixel for YUYV variants and BGR888

- firmware: vc_image: Make the alternate path in yuv420 to rgb888 support bgr888

- firmware: vc_image: Add an rgb_stripe_swap_ext which takes pitches

- firmware: vc_image_convert: yuv420 to bgr888 failed on (width&31) != 0

- firmware: IL isp: Use gamma block to shift 10bpp YUV to the correct pipe depth

- firmware: video_encode: Always set the input port nBufferSize to match the image

- firmware: Camera/ISP: Allow option to disable demosaicing

- firmware: dispmanx: Also apply overscan_scale when clamping to screen
  See: https://forum.kodi.tv/showthread.php?tid=338052

- firmware: Added a mailbox function for setting gamma

- firmware: bootcode: Support parsing of gpio filters from config.txt
  See: #1076

- firmware: video_encode: Allow Inline Headers to be changed whilst active

- firmware: IL: Add XRGB8888 and XBGR8888, and support on video_render, isp, and hvs

- firmware: image_encode: Allow arbitrary buffer strides matching the appropriate multiples

- firmware: platform: Use 3aplus dt-blob section and bcm2710-rpi-3-a-plus.dtb

- firmware: Added ability to have an third transpose buffer
  See: #837

- firmware: isp: Correct the conversion tables changed in adding the gamma block
  See: #1084

- firmware: raspberrypi_full variant: Drop unused Camplus sw stages

- bootcode: Reset WiFi and BT devices before resetting the expander
  See: #1088

- bootcode: Fix Ethernet boot on a different subnet
  See: #1078

- firmware: interface: Drop vcfiled
  See: raspberrypi/userland#525

- firmware: Add reference counting to the local audio players
  See: #547

- firmware: arm_loader: Add reporting the firmware git hash via the mailbox

- firmware: vcos: Add reporting of which variant was built
  See: raspberrypi/linux#2806

- firmware: Update vcdbg help
  See: #594
@sscheidt77
Copy link

When attempted to run the raspistill.gps, I get:

libgps.so.21: cannot open shared object file: No such file or directory

I have gpsd running and working.

@JamesH65
Copy link
Collaborator

JamesH65 commented Apr 7, 2022

looks like we are up to libgps28 now.

libgps_loader.h needs changing to reflect the move from 22 to 28....

@sscheidt77
Copy link

My apologies if I'm in the wrong place to be asking for how-to.
I verified that I have libgps28 installed.
If I use the binary in the thread above: libgps.so.21: cannot open shared object file: No such file or directory
If I use raspistill -gps (up to date raspbian lite installation on a raspberry pi zero w) I get:
libgps.so.23: cannot open shared object file: No such file or directory

Suggestion on how to proceed with raspistill?

@JamesH65
Copy link
Collaborator

JamesH65 commented Apr 7, 2022

Looks like you need different versions of libgps for various installs, which is a PITA. And raspistill has the version hardcoded, which is also a PITA. Not sure why we did it that way. Anyway....with libcamera we are moving away from setting the exif tags directly, and suggest using exiftool to add whatever you want to the files after the capture has completed. That's probably a better bet. Just another line in a script.

@sscheidt77
Copy link

Fair suggestion on exiftool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants