code: def fixture_video_capture():
      """fixture_video_capture
      # Note: on Linux v4l2loopback is used, and the following is needed:
      #   gst-launch-1.0 videotestsrc ! v4l2sink device=/dev/video0
      # otherwise fmt will not work with
      #   $ v4l2-ctl -d /dev/video0 -V
      #   VIDIOC_G_FMT: failed: Invalid argument
      # Note: the following is a validation
      # YUV image could be converted to JPEG with:
      # macOS: ffmpeg -s 1280x720 -pix_fmt nv12 -i frame_{i}.yuv frame_{i}.jpg
      # Linux: ffmpeg -s 320x240 -pix_fmt yuyv422 -i frame_{i}.yuv frame_{i}.jpg
      dataset = tfio.experimental.IODataset.stream().from_video_capture(
          "/dev/video0").take(5)
      i = 0
      for frame in dataset:
        print("Frame {}: shape({}) dtype({}) length({})".format(
            i, frame.shape, frame.dtype, tf.strings.length(frame)))
        tf.io.write_file("frame_{}.yuv".format(i), frame)
        i += 1
      """
  
      args = "/dev/video0"
  
      def func(q):
          dataset = (
              tfio.experimental.IODataset.stream().from_video_capture(q)
          )
          dataset = dataset.map(tf.strings.length)
          dataset = dataset.take(10)
          return dataset
  
      # macOS (NV12): 1382400 = (1280 + 1280 / 2) * 720
      # Linux (YUYV): 153600 = 320 * 240 * 2
      value = 1382400 if sys.platform == "darwin" else 153600
      expected = [value for _ in range(10)]
  
      return args, func, expected
  
imports: import os
  import sys
  import time
  import shutil
  import tempfile
  import numpy
  import pytest
  import tensorflow
  import tensorflow_io
label_desc: Use image node_id 32 for calling a global function with example usage: fixture_video_capture() and returns: args,  func,  expected, dataset