diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c
index c43749e..bec05e1 100644
--- a/sys/v4l2/gstv4l2bufferpool.c
+++ b/sys/v4l2/gstv4l2bufferpool.c
@@ -204,8 +204,11 @@ gst_v4l2_buffer_pool_alloc_buffer (GstBufferPool * bpool, GstBuffer ** buffer,
         offs = 0;
         for (i = 0; i < n_planes; i++) {
           offset[i] = offs;
-          stride[i] =
-              GST_VIDEO_FORMAT_INFO_SCALE_WIDTH (finfo, i, obj->bytesperline);
+	  if (info->finfo->format == GST_VIDEO_FORMAT_NV12 || info->finfo->format == GST_VIDEO_FORMAT_NV21) {
+		stride[i] = (i == 0) ? GST_VIDEO_FORMAT_INFO_SCALE_WIDTH (finfo, i, obj->bytesperline) : stride[0];
+	  } else {
+		stride[i] = GST_VIDEO_FORMAT_INFO_SCALE_WIDTH (finfo, i, obj->bytesperline);
+	  }
 
           offs +=
               stride[i] * GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT (finfo, i, height);
