code: def create_video_db(self, list_file, output_file, use_list=False):
      # Write to lmdb database...
      LMDB_MAP_SIZE = 1 << 40  # MODIFY
      env = lmdb.open(output_file, map_size=LMDB_MAP_SIZE)
      total_size = 0
  
      file_name = []
      start_frame = []
      label = []
      index = 0
  
      with env.begin(write=True) as txn:
          with open(list_file, "r") as data:
              for line in data:
                  p = line.split()
                  file_name = p[0]
                  start_frame = int(p[1])
                  label = int(p[2])
  
                  if not use_list:
                      with open(file_name, mode="rb") as file:
                          video_data = file.read()
                  else:
                      video_data = file_name
  
                  tensor_protos = caffe2_pb2.TensorProtos()
                  video_tensor = tensor_protos.protos.add()
                  video_tensor.data_type = 4  # string data
                  video_tensor.string_data.append(video_data)
  
                  label_tensor = tensor_protos.protos.add()
                  label_tensor.data_type = 2
                  label_tensor.int32_data.append(label)
  
                  start_frame_tensor = tensor_protos.protos.add()
                  start_frame_tensor.data_type = 2
                  start_frame_tensor.int32_data.append(start_frame)
  
                  txn.put(
                      "{}".format(index).encode("ascii"),
                      tensor_protos.SerializeToString(),
                  )
                  index = index + 1
                  total_size = (
                      total_size + len(video_data) + sys.getsizeof(int)
                  )
      return total_size
  
file_path: pytorch/caffe2/python/operator_test/video_input_op_test.py
imports: import os
  import shutil
  import sys
  import tempfile
  import unittest
  import numpy
  from caffe2.proto import caffe2_pb2
  from caffe2.python import model_helper, workspace
label_desc: Use image node_id 2 for calling the VideoInputOpTest obj's underlying member method code with example usage: obj.create_video_db(list_file, output_file, use_list) and returns: total_size