I've submitted a newer version implementing manually autoplug. It is much much more simpler than the previous version. Also, the code amount is nearly identical to the my local version using encodebin. The difference between this version and encodebin version is the function muxer_find_muxer(), encodebin doesn't need to find muxer, but it requires creating a encode profile. So the code amount here is nearly the same.