enable-exif property on nvcamerasrc

Hi,

I noticed that nvcamerasrc has a property called enable-exif, do you know if this property actually works? what kind of data should I expect when I set the property to true? is the ISP providing this data?

enable-exif : Return Exif data with captured frame
flags: readable, writable
Boolean. Default: false
enable-meta : Return Sensor meta data with captured frame
flags: readable, writable
Boolean. Default: false

Thanks
-David

I couldn’t answer what you’re asking, but you might find the program “exif” (which can dump exif data) useful if you want to see what is in an image before and after it is processed.

hello DavidSoto,

EXIF would provide more details of your captured frame, for example, exposure time, aperture, focal length…etc.
you could check the EXIF data by 3rdparty tools, for example, exiv2.

  1. please enable it by below command,
$ nvgstcapture-1.0 --enable-exif
  1. doing a jpeg capture by input ‘J’ key
  2. check the exif
exiv2 test.jpg

Hi JerryChang and linuxdev,

Thanks for your answers! I will give them a try,

-David

Hi,

We were able to test as you suggested by now the main question is from where is nvgstcapture is getting the information that is adding as metadata? For instance, values as Aperture, Exposure Time and ISO speed?

-David

ubuntu@tegra-ubuntu:~$ exiv2 nvcamtest_23473_s00_00000.jpg 
File name       : nvcamtest_23473_s00_00000.jpg
File size       : 60651 Bytes
MIME type       : image/jpeg
Image size      : 640 x 480
Camera make     : NVIDIA
Camera model    : Tegra
Image timestamp : 2017:04:12 15:07:44
Image number    : 
Exposure time   : 1/30 s
Aperture        : F2.4
Exposure bias   : 0 EV
Flash           : No, compulsory
Flash bias      : 
Focal length    : 2.7 mm
Subject distance: Unknown
ISO speed       : 1459
Exposure mode   : Auto
Metering mode   : Center weighted average
Macro mode      : 
Image quality   : 
Exif Resolution : 640 x 480
White balance   : Auto
Thumbnail       : None
Copyright       : 
Exif comment    : NVIDIA

hello DavidSoto,

all these metadata were filled by the NVIDIA private library, libscf.so
thanks

Hi JerryChang,

   Thanks for the answer, I can see that the library controls several parameters to improve the image quality (AWB, flicker related stuff, conversion matrix, etc), actually you have a libnvexif.so file. What I am not still sure is if your library queries for those values to the camera driver to finally put it into the exif metadata or if this is set according to the ISP configuration (ISO Speed, exposure time)

-David

hello DavidSoto,

both of your suggestions are correct.
there’s metadata that won’t change by the 3A algorithm, which query from sensor driver. i.e. Focal length.
the others would depends on ISP configuration and report the frame settings to the exif.
thanks

Thanks JerryChang

Hello Jerry and David,

I have a follow-up question on this matter.

Does the Image Timestamp include mili-seconds? Currently I only see seconds.

If yes, how can we read it?

Thanks a lot.

hello MichaelLLL,

actually, it is the current system time for image saved.

  1. may I have more details about your use-case to get the mili-seconds from the exif info?
  2. if you’re looking for details, you may also check below function for the v4l2 buffer timestamp.
<top>/kernel/kernel-4.4/drivers/media/platform/tegra/camera/vi/channel.c
 
void tegra_channel_ring_buffer(...)

Jerry,
Thanks a lot for the reply.

We have a very simple pipeline, which is to save frames from nvcamerasrc into a buffer/queue, either jpegs or raw data. For each frame, we want to save the capture time (not the encoding time nor saved time) in milliseconds. So that after a while we could query and find the frame with a given timestamp.

Appreciate any input.

Best,
Michael

hello MichaelLLL,

then you should check the kernel sources about the sensor timestamp for each frame.
please refer to below, thanks
/kernel/kernel-4.4/drivers/media/platform/tegra/camera/vi/vi2_fops.c

static int tegra_channel_capture_frame(...)
{
...
                 err = nvhost_syncpt_wait_timeout_ext(chan->vi->ndev,
                         chan->syncpt[index][0], thresh[index],
                         chan->timeout, NULL, &ts);
...

Thanks again, Jerry.

We just checked. There is a new function set_timestamp() in L4T 28.2 (not in 28.1).
Is that we should looking at?

Would you please guide us on how to read that meta data on the application/user side? Thank you so much.

Hi MichaelLLL

Have you tried reading the GStreamer buffer timestamp? Normally, this timestamp is set by the V4L2 driver and is accessible in user space. This time represents the capture time in nanoseconds since the pipeline started. You can access the buffer timestamp by doing:

GstClockTime timestamp = GST_BUFFER_PTS_OR_DTS(buffer);

Here, GstClockTime is an unsigned 64 bit integer.