I met some problems when I run sample_camera_multiple_gmsl, I use std::cout to see member of dwImageNvMedia.
But the timestamp_us is about 3009312140752363, system real time is about Wed Sep 6 11:27:23 CST 2017.
Though the timestamp is in us, I can not convert 3009312140752363 to real time.
Anyone can help me?
please be sure you are not referring to any CUDA structure which is meant to be read on the GPU only. Other than that you better use the handle and the appropriate [FOO]_getTimestamp() function to get your timestamp as e.g.
dwTime_t ts; dwImage_getTimestamp(&ts, m_imageRGBA); std::cout << "TIMESTAMP: " << ts << std::endl;
std::string file = "video=" + getArgument("video") + ",timestamp=" + getArgument("video-time");
you are also able to directly print the according timestamp.
Please review your code and if you are still struggling with it, feel free to share a snippet with us.
Thank you for your attention.
Where can I find the definition of dwImage_getTimestamp? I only modified the code of sample_camera_multiple_gmsl, which head file shoule include if I use the function?
I searched in doc/nvdwx_html/index.html, But I did not find it.
What does m_imageRGBA mean?
Thanks a lot.
sorry, I was a few steps ahead and thought just to post the necessary LOC.
For the sake of simplicity, let us have a look at the camera_replay sample. There you will find a function named onProcess().
In order to have a more realistic use case I have recorded a video with a camera in h246 format. So that is why I do check the if-case of whether there is some raw data available or now (compare “if (!m_isRaw)”).
The sample acquires an image by providing the image handle to the dwSensorCamera_getImage() function. Since you asked, the definition of m_imageRGBA in line 85 is the following:
dwImageHandle_t m_imageRGBA = DW_NULL_HANDLE;
Just afterwards, you can use my code snippet from above using dwImage_getTimestamp().
Moreover, by wrapping up, you can also add another argument to the sample like
to input e.g. a video file like I did. Besides one should also adapt the defined std::string file with e.g. the second code snipped provided in my first post accordingly.
Last but not least dwImage_getTimestamp() returns a status, so it is recommended to check it in terms of a safer and thus better way of coding.
Please, be aware that the implemented search function in the .html files does not always work and that I will push its enhancement.
Hope that helps.