Fixed GStreamer encoding pipeline frame drop for most cases.

For several muxers and encoders GStreamer still drops the last frame.
Fixed compatibility with GStreamer 1.x.
More accurate selection of color space conversion element for GStreamer 1.x
Merge pull request #3253 from asmorkalov:ocv_gstreamer2