How to add metadata using probe and how to create encodebin for saving multiple video files

Hello all,
I have tried code taken from this post -

Here the pipeline is written to save image file and I have edited my sink-bin so that I can save the video file. Below I have mentioned the pipeline of sink-bin and the error I am facing while trying the code in above post.

sink-bin:
queue -> nvvidconv -> cap-filter("video/x-raw(Memory:NVMM), format = l420") -> h264encoder(nvv4l2h264enc) -> codecparse(h264parse) -> qtmux -> filesink 

Error snippet:
    0:00:07.014783994  1120 0x7f1ae4013d90 WARN                    v4l2 gstv4l2object.c:2921:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe minimum capture size for pixelformat H264
    0:00:07.014796689  1120 0x7f1ae4013d90 WARN                    v4l2 gstv4l2object.c:3035:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
    0:00:07.014809509  1120 0x7f1ae4013d90 WARN                    v4l2 gstv4l2object.c:2927:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe maximum capture size for pixelformat H264
    0:00:07.014874971  1120 0x7f1ae4013d90 WARN                    v4l2 gstv4l2object.c:3035:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:src> Unable to try format: Unknown error -1

0:00:07.131256250  1120 0x7f1aec011e30 ERROR                   v4l2 gstv4l2object.c:2074:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git
0:00:07.131315844  1120 0x7f1aec011e30 ERROR                   v4l2 gstv4l2object.c:2074:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

Thanks in advance