Applying RBpi patch as proposed in its forums
The complete explanation is in this thread https://www.raspberrypi.org/forums/viewtopic.php?t=200306
The fix proposed here https://www.raspberrypi.org/forums/viewtopic.php?t=200306&start=25#p1260138 fixes a problem with raspberry using omxh264enc plugin which tries to forward partial buffers into the pipeline.
This patch was proposed a year ago in 1.10 I've just adapted to the latest version
I guess raspbian maintainers might have their fork somewhere but I haven't found it.