I am debugging framerate issues the team and I recently noticed in our application. Part of the issue is that the reported framerate does not match in different places and the actual number of frames does not correspond with either of them. Our application uses a high speed Alvium CSI-2 camera attached to a jetson nano and is accessed using python gstreamer bindings. Normally the camera runs at 153.917 fps @1408x1088.
Encoded video shows a framerate of 153.917 fps as reported by vlc in the media information → coded tab and using an online tool such as https://www.metadata2go.com/. 1) The actual number of frames does not correspond with that. 2) Opening the video in matlab or windows explorer properties shows 76.96 fps, ie. exactly half.
To make debugging easier and I went back to cli gstreamer using gst-launch-1.0. Using the pipeline below the fpsdisplay sink displays about 135fps. This number also corresponds with the number of frames that is acutally in the encoded output if a proper filesink is used. Full output attached for reference.
Note the reported 135fps is actually double (270), I am not sure if this a completely separate issue or not but I did start a thread for it here
gst-launch-1.0 v4l2src ! 'video/x-raw, format=(string)GRAY8' ! nvvidconv ! 'video/x-raw(memory:NVMM)' ! nvv4l2vp8enc ! webmmux ! fpsdisplaysink video-sink=fakesink --verbose
nvbuf_utils: Could not get EGL display connection
Setting pipeline to PAUSED ...
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Pipeline is live and does not need PREROLL ...
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstFakeSink:fakesink0: sync = true
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, format=(string)GRAY8, width=(int)1408, height=(int)1088, framerate=(fraction)153/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)1:4:7:1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)GRAY8, width=(int)1408, height=(int)1088, framerate=(fraction)153/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)1:4:7:1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/Gstnvvconv:nvvconv0.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)1408, height=(int)1088, framerate=(fraction)153/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)I420
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)1408, height=(int)1088, framerate=(fraction)153/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)I420
/GstPipeline:pipeline0/nvv4l2vp8enc:nvv4l2vp8enc0.GstPad:src: caps = video/x-vp8, profile=(string)0, width=(int)1408, height=(int)1088, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)153/1, interlace-mode=(string)progressive, colorimetry=(string)bt709, chroma-site=(string)mpeg2
/GstPipeline:pipeline0/GstWebMMux:webmmux0.GstMatroskamuxPad:video_0: caps = video/x-vp8, profile=(string)0, width=(int)1408, height=(int)1088, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)153/1, interlace-mode=(string)progressive, colorimetry=(string)bt709, chroma-site=(string)mpeg2
NvMMLiteOpen : Block : BlockType = 7
Redistribute latency...
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 7
/GstPipeline:pipeline0/nvv4l2vp8enc:nvv4l2vp8enc0.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)1408, height=(int)1088, framerate=(fraction)153/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)I420
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)1408, height=(int)1088, framerate=(fraction)153/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)I420
/GstPipeline:pipeline0/Gstnvvconv:nvvconv0.GstPad:sink: caps = video/x-raw, format=(string)GRAY8, width=(int)1408, height=(int)1088, framerate=(fraction)153/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)1:4:7:1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)GRAY8, width=(int)1408, height=(int)1088, framerate=(fraction)153/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)1:4:7:1, interlace-mode=(string)progressive
NVMEDIA_ENC: bBlitMode is set to TRUE
/GstPipeline:pipeline0/GstWebMMux:webmmux0: streamable = true
/GstPipeline:pipeline0/GstWebMMux:webmmux0.GstPad:src: caps = video/webm
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0.GstGhostPad:sink.GstProxyPad:proxypad0: caps = video/webm
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay.GstPad:src: caps = video/webm(memory:SystemMemory, meta:GstVideoOverlayComposition)
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstFakeSink:fakesink0.GstPad:sink: caps = video/webm(memory:SystemMemory, meta:GstVideoOverlayComposition)
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay.GstPad:video_sink: caps = video/webm
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0.GstGhostPad:sink: caps = video/webm
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstFakeSink:fakesink0: sync = true
/GstPipeline:pipeline0/GstWebMMux:webmmux0.GstPad:src: caps = video/webm, streamheader=(buffer)< 1a45dfa301000000000000104282857765626d0042878102428581021853806701ffffffffffffff1549a96601000000000000562ad7b1830f42404d80a54753747265616d6572206d6174726f736b616d75782076657273696f6e20312e31342e35005741994753747265616d6572204d6174726f736b61206d75786572004461880928b9a498da5c001654ae6b0100000000000046ae010000000000003dd7810183810173c588ac36674daf8901a123e3838363bb0b536e86566964656f00e0010000000000000bb0820580ba8204409a81028686565f56503800 >
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0.GstGhostPad:sink.GstProxyPad:proxypad0: caps = video/webm, streamheader=(buffer)< 1a45dfa301000000000000104282857765626d0042878102428581021853806701ffffffffffffff1549a96601000000000000562ad7b1830f42404d80a54753747265616d6572206d6174726f736b616d75782076657273696f6e20312e31342e35005741994753747265616d6572204d6174726f736b61206d75786572004461880928b9a498da5c001654ae6b0100000000000046ae010000000000003dd7810183810173c588ac36674daf8901a123e3838363bb0b536e86566964656f00e0010000000000000bb0820580ba8204409a81028686565f56503800 >
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay.GstPad:src: caps = video/webm(memory:SystemMemory, meta:GstVideoOverlayComposition), streamheader=(buffer)< 1a45dfa301000000000000104282857765626d0042878102428581021853806701ffffffffffffff1549a96601000000000000562ad7b1830f42404d80a54753747265616d6572206d6174726f736b616d75782076657273696f6e20312e31342e35005741994753747265616d6572204d6174726f736b61206d75786572004461880928b9a498da5c001654ae6b0100000000000046ae010000000000003dd7810183810173c588ac36674daf8901a123e3838363bb0b536e86566964656f00e0010000000000000bb0820580ba8204409a81028686565f56503800 >
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstFakeSink:fakesink0.GstPad:sink: caps = video/webm(memory:SystemMemory, meta:GstVideoOverlayComposition), streamheader=(buffer)< 1a45dfa301000000000000104282857765626d0042878102428581021853806701ffffffffffffff1549a96601000000000000562ad7b1830f42404d80a54753747265616d6572206d6174726f736b616d75782076657273696f6e20312e31342e35005741994753747265616d6572204d6174726f736b61206d75786572004461880928b9a498da5c001654ae6b0100000000000046ae010000000000003dd7810183810173c588ac36674daf8901a123e3838363bb0b536e86566964656f00e0010000000000000bb0820580ba8204409a81028686565f56503800 >
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay.GstPad:video_sink: caps = video/webm, streamheader=(buffer)< 1a45dfa301000000000000104282857765626d0042878102428581021853806701ffffffffffffff1549a96601000000000000562ad7b1830f42404d80a54753747265616d6572206d6174726f736b616d75782076657273696f6e20312e31342e35005741994753747265616d6572204d6174726f736b61206d75786572004461880928b9a498da5c001654ae6b0100000000000046ae010000000000003dd7810183810173c588ac36674daf8901a123e3838363bb0b536e86566964656f00e0010000000000000bb0820580ba8204409a81028686565f56503800 >
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0.GstGhostPad:sink: caps = video/webm, streamheader=(buffer)< 1a45dfa301000000000000104282857765626d0042878102428581021853806701ffffffffffffff1549a96601000000000000562ad7b1830f42404d80a54753747265616d6572206d6174726f736b616d75782076657273696f6e20312e31342e35005741994753747265616d6572204d6174726f736b61206d75786572004461880928b9a498da5c001654ae6b0100000000000046ae010000000000003dd7810183810173c588ac36674daf8901a123e3838363bb0b536e86566964656f00e0010000000000000bb0820580ba8204409a81028686565f56503800 >
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 144, dropped: 0, current: 284,18, average: 284,18
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 144, dropped: 0, current: 284,18, average: 284,18
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 272, dropped: 0, current: 255,90, average: 270,13
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 272, dropped: 0, current: 255,90, average: 270,13
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 408, dropped: 0, current: 269,04, average: 269,77
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 408, dropped: 0, current: 269,04, average: 269,77
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 544, dropped: 0, current: 271,60, average: 270,22
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 544, dropped: 0, current: 271,60, average: 270,22
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 680, dropped: 0, current: 270,87, average: 270,35
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 680, dropped: 0, current: 270,87, average: 270,35
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 816, dropped: 0, current: 270,37, average: 270,35
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 816, dropped: 0, current: 270,37, average: 270,35
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 952, dropped: 0, current: 271,39, average: 270,50
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 952, dropped: 0, current: 271,39, average: 270,50
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 1088, dropped: 0, current: 269,86, average: 270,42
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 1088, dropped: 0, current: 269,86, average: 270,42
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 1224, dropped: 0, current: 270,52, average: 270,43
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 1224, dropped: 0, current: 270,52, average: 270,43
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 1360, dropped: 0, current: 269,84, average: 270,37
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 1360, dropped: 0, current: 269,84, average: 270,37
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 1496, dropped: 0, current: 270,10, average: 270,35
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 1496, dropped: 0, current: 270,10, average: 270,35
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 1632, dropped: 0, current: 269,80, average: 270,30
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 1632, dropped: 0, current: 269,80, average: 270,30
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 1768, dropped: 0, current: 270,61, average: 270,33
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 1768, dropped: 0, current: 270,61, average: 270,33
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 1904, dropped: 0, current: 271,82, average: 270,43
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 1904, dropped: 0, current: 271,82, average: 270,43
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 2040, dropped: 0, current: 269,50, average: 270,37
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 2040, dropped: 0, current: 269,50, average: 270,37
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 2176, dropped: 0, current: 270,17, average: 270,36
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 2176, dropped: 0, current: 270,17, average: 270,36
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 2312, dropped: 0, current: 269,69, average: 270,32
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 2312, dropped: 0, current: 269,69, average: 270,32
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 2448, dropped: 0, current: 270,65, average: 270,34
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 2448, dropped: 0, current: 270,65, average: 270,34
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 2584, dropped: 0, current: 271,81, average: 270,41
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 2584, dropped: 0, current: 271,81, average: 270,41