class_docstr: Helper class for writing whole videos.
class_docstr_tok: ["Helper","class","for","writing","whole","videos","."]
docstr: Finishes transconding and returns the video.
  
  Returns:
    bytes
  
  Raises:
    IOError: in case of transcoding error.
code: def finish(self):
      """Finishes transconding and returns the video.
  
      Returns:
        bytes
  
      Raises:
        IOError: in case of transcoding error.
      """
      if self.proc is None:
          return None
      self.proc.stdin.close()
      for thread in (self._out_thread, self._err_thread):
          thread.join()
      (out, err) = [
          b"".join(chunks)
          for chunks in (self._out_chunks, self._err_chunks)
      ]
      self.proc.stdout.close()
      self.proc.stderr.close()
      if self.proc.returncode:
          err = "\n".join([" ".join(self.cmd), err.decode("utf8")])
          raise IOError(err)
      del self.proc
      self.proc = None
      return out
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from tensor2tensor.layers import common_layers
  from tensor2tensor.utils import contrib
  import tensorflow.compat.v1
  from tensorflow.python.ops import summary_op_util
label_desc: Use image node_id 5 for calling the WholeVideoWriter obj's underlying member method code with example usage: obj.finish() and returns: out, None