Copied in MjpegStream class form Insight commit 4086a48f23c05be1fa4ba93806d4e387f7a90275; replaced sf::Thread with std::thread