Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

so, it seems you're stalling the underlying ffmpeg library, resulting in invalid frames. things to try:

  • choose a smaller / faster network (e.g. tiny-yolo or squeezedet)
  • since it seems to be a detection network, try a smaller input, than 300x300 (the 1st few layers are the most expensive !)
  • profile your network
  • don't process every frame, but maybe only every 20'th
  • if you have several cores, offload the cnn processing to a different thread (but careful ! needs locks / safe queues and whatnot ! and both capture and gui have to stay on the main thread.)
  • don't break out of the loop in case of a missing frame, rather continue and try again..

so, it seems you're stalling the underlying ffmpeg library, resulting in invalid frames. things to try:

  • choose a smaller / faster network (e.g. tiny-yolo or squeezedet)
  • since it seems to be a detection network, try a smaller input, than 300x300 (the 1st few layers are the most expensive !)
  • profile your network
  • don't process every frame, but maybe only every 20'th
  • if you have several cores, maybe try to offload the cnn processing to a different thread (but careful ! needs locks / safe queues and whatnot ! and both capture and gui have to stay on the main thread.)
  • don't break out of the loop in case of a missing frame, rather continue and try again..