dwSensor_createSeekTable() fails for certain videos

Running

./sample_camera_seek --video=/usr/local/driveworks/data/samples/sfm/triangulation/video_0.h264

works, but

./sample_camera_seek --video=/usr/local/driveworks/data/samples/freespace/video_freespace.h264

fails with:

[07-06-2020 21:18:45] Platform: Detected DDPX - Tegra A
[07-06-2020 21:18:45] TimeSource: monotonic epoch time offset is 1591534559854071
[07-06-2020 21:18:45] PTP Time is available from NVPPS Driver
[07-06-2020 21:18:45] Platform: number of GPU devices detected 1
[07-06-2020 21:18:45] Platform: currently selected GPU device integrated ID 0
[07-06-2020 21:18:45] SDK: Resources mounted from .././data/
[07-06-2020 21:18:45] SDK: Create NvMediaDevice
[07-06-2020 21:18:45] SDK: use EGL display as provided
[07-06-2020 21:18:46] TimeSource: monotonic epoch time offset is 1591534559854071
[07-06-2020 21:18:46] PTP Time is available from NVPPS Driver
[07-06-2020 21:18:46] Initialize DriveWorks SDK v2.2.3136
[07-06-2020 21:18:46] Release build with GNU 7.3.1 from heads/buildbrain-branch-0-gca7b4b26e65 against Drive PDK v5.1.6.1
[07-06-2020 21:18:46] Initialize DriveWorks VisualizationSDK v2.2.3136
[07-06-2020 21:18:46] Initialize DriveWorksGL SDK v2.2.3136
[07-06-2020 21:18:46] SensorFactory::createSensor() -> camera.virtual, offscreen=0,profiling=1,video=/usr/local/driveworks/data/samples/freespace/video_freespace.h264
[07-06-2020 21:18:46] CameraVirtualNvMedia: no seek table found at /usr/local/driveworks/data/samples/freespace/video_freespace.h264.seek, seeking is not available.
SimpleCamera: Camera image: 960x604
[07-06-2020 21:18:46] StreamConsumerGL: successfully initialized
[07-06-2020 21:18:47] IDRLookup: Stream doesn't contain valid AUD units
SimpleCamera: Error creating index table: DW_NOT_SUPPORTED. Seeking is not available.
terminate called after throwing an instance of 'std::runtime_error'
  what():  Could not enable seeking for camera.
Aborted (core dumped)

What are the requirements for creating a seek table for camera.virtual?

Hi raul.tambre,

Please refer to “Sensor Indexer Tool” in DriveWorks SDK Reference Documentation. Thanks!

I appreciate the answer!
I tried the following on my DRIVE:

# ./sensor_indexer --sensor=camera.virtual --input=/usr/local/driveworks/data/samples/freespace/video_freespace.h264
Program Arguments:
--input=/usr/local/driveworks/data/samples/freespace/video_freespace.h264
--offscreen=0
--output=
--profiling=1
--sensor=camera.virtual
--timestamp=

[30-01-2020 07:54:08] TimeSource: monotonic epoch time offset is 1580363110468030
[30-01-2020 07:54:08] PTP Time is available from NVPPS Driver
[30-01-2020 07:54:09] SDK: Resources mounted from /usr/local/driveworks-2.2/data/
[30-01-2020 07:54:09] SDK: Create NvMediaDevice
[30-01-2020 07:54:09] egl::Display: found 1 EGL devices
[30-01-2020 07:54:09] egl::Display: use drm device: drm-nvdc
[30-01-2020 07:54:09] TimeSource: monotonic epoch time offset is 1580363110468030
[30-01-2020 07:54:09] PTP Time is available from NVPPS Driver
[30-01-2020 07:54:09] Initialize DriveWorks SDK v2.2.3136
[30-01-2020 07:54:09] SensorFactory::createSensor() -> camera.virtual, file=/usr/local/driveworks/data/samples/freespace/video_freespace.h264,create_seek=true
[30-01-2020 07:54:09] IDRLookup: Stream doesn't contain valid AUD units
[30-01-2020 07:54:09] CameraVirtual: Index table is not created. Seeking is not available for this stream.
[30-01-2020 07:54:09] Driveworks exception thrown: DW_NOT_SUPPORTED: CameraVirtualNvMedia: requested seek table could not be created

Cannot create virtual sensor: camera.virtual with params: file=/usr/local/driveworks/data/samples/freespace/video_freespace.h264,create_seek=true
Error: DW_NOT_SUPPORTED
[30-01-2020 07:54:09] Releasing Driveworks SDK Context
[30-01-2020 07:54:09] SDK: Release NvMediaDevice
[30-01-2020 07:54:10] SDK: Release NvMedia2D

Could you give an example of how I should use the tool to index /usr/local/driveworks/data/samples/freespace/video_freespace.h264?

With “video_freespace.h264”, tt says “IDRLookup: Stream doesn’t contain valid AUD units”. Please try with another file as below. Thanks!

$ /usr/local/driveworks/tools/sensors/sensor_indexer --sensor=camera.virtual --input=/usr/local/driveworks/data/samples/sfm/triangulation/video_1.h264 --output=$HOME/Downloads/camera.bin.seek

That isn’t too helpful, because I want the seek file for “video_freespace.h264” not some other video.
However, turns out that ffmpeg can easily add the missing AUD units:

ffmpeg -i video_freespace.h264 -x264opts aud=1 aud.h264

After that creating a seek file works.

Thank you for sharing the information here!