Wrong video length reported for NVENC encoded video

I’m using the SDK samples to encode some videos(x264) and I having a slight issue. While all the frames are encoded properly after the video is done, both my file system(ubuntu 15.04) and opencv are reporting the wrong video length(Ubuntu reports 0 seconds and opencv report -9.2233x10^18 frames). The header appears to report the frame rate correctly but not the length.

Any help with this issue would be appreciated.

I have continued testing this issue with ffprobe/ffmpeg to see if it could retrieve the proper information after encoding but it also failed to get the proper info. Here is the output from ffprobe:

ffprobe version N-76529-gddbad15 Copyright © 2007-2015 the FFmpeg developers
built with gcc 4.9.2 (Ubuntu 4.9.2-10ubuntu13)
configuration: --enable-nonfree --enable-nvenc
libavutil 55. 5.100 / 55. 5.100
libavcodec 57. 15.100 / 57. 15.100
libavformat 57. 14.100 / 57. 14.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 15.100 / 6. 15.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
Input #0, h264, from ‘20151112_132929_799-GP001.mp4’:
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (High), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 60 fps, 60 tbr, 1200k tbn, 120 tbc
[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1/120
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=1280
height=720
coded_width=1280
coded_height=720
has_b_frames=1
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuv420p
level=32
color_range=N/A
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=left
timecode=N/A
refs=2
is_avc=false
nal_length_size=0
id=N/A
r_frame_rate=120/2
avg_frame_rate=60/1
time_base=1/1200000
start_pts=N/A
start_time=N/A
duration_ts=N/A
duration=N/A
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
[/STREAM]
[FORMAT]
filename=20151112_132929_799-GP001.mp4
nb_streams=1
nb_programs=0
format_name=h264
format_long_name=raw H.264 video
start_time=N/A
duration=N/A
size=634186
bit_rate=N/A
probe_score=51
[/FORMAT]

Some information appears to be encoded properly but the duration and bitrate are not. I’m wondering if there is a setting for the encoder that I am missing that needs to be set to ensure that the container information is properly written after encoding is complete.