docstr: Verify that viedo out is correct with/without color space conversion
docstr_tok: ["Verify","that","viedo","out","is","correct","with\/without","color","space","conversion"]
code: def test_video_raw_out(self, formats):
      """Verify that viedo out is correct with/without color space conversion"""
      filename = "test.rawvideo"
      frame_rate = 30000 / 1001
  
      width, height = 720, 576
      src_fmt, encoder_fmt = formats
      frames = int(frame_rate * 2)
      channels = 1 if src_fmt == "gray8" else 3
  
      # Generate data
      src_size = (frames, channels, height, width)
      chunk = torch.randint(
          low=0, high=255, size=src_size, dtype=torch.uint8
      )
  
      # Write data
      dst = self.get_temp_path(filename)
      s = StreamWriter(dst, format="rawvideo")
      s.add_video_stream(
          frame_rate,
          width,
          height,
          format=src_fmt,
          encoder_format=encoder_fmt,
      )
      with s.open():
          s.write_video_chunk(0, chunk)
  
      # Fetch the written data
      with open(dst, "rb") as fileobj:
          buf = fileobj.read()
  
      result = torch.frombuffer(buf, dtype=torch.uint8)
      if encoder_fmt.endswith("p"):
          result = result.reshape(src_size)
      else:
          result = result.reshape(
              frames, height, width, channels
          ).permute(0, 3, 1, 2)
  
      # check that they are same
      if src_fmt == encoder_fmt:
          expected = chunk
      else:
          if src_fmt == "bgr24":
              chunk = chunk[:, [2, 1, 0], :, :]
          expected = rgb_to_yuv_ccir(chunk)
      self.assertEqual(expected, result, atol=1, rtol=0)
  
imports: import io
  import math
  import torch
  import torchaudio
  from parameterized import parameterized, parameterized_class
  from torchaudio.io import CodecConfig, StreamReader, StreamWriter
  from torchaudio_unittest.common_utils import get_asset_path, get_sinusoid, nested_params, rgb_to_yuv_ccir, skipIfNoFFmpeg, skipIfNoModule, TempDirMixin, TorchaudioTestCase
  from .common import lt42
label_desc: Use image node_id 3 for calling the StreamWriterCorrectnessTest obj's underlying member method code with example usage: obj.test_video_raw_out(formats) without return types