class_docstr: WriteGear handles various powerful Video-Writer Tools that provide us the freedom to do almost anything imaginable with multimedia data.
  
  WriteGear API provides a complete, flexible, and robust wrapper around FFmpeg, a leading multimedia framework. WriteGear can process real-time frames into a lossless
  compressed video-file with any suitable specification (such as bitrate, codec, framerate, resolution, subtitles, etc.). It is powerful enough to perform complex tasks such as
  Live-Streaming (such as for Twitch) and Multiplexing Video-Audio with real-time frames in way fewer lines of code.
  
  Best of all, WriteGear grants users the complete freedom to play with any FFmpeg parameter with its exclusive Custom Commands function without relying on any
  third-party API.
  
  In addition to this, WriteGear also provides flexible access to OpenCV's VideoWriter API tools for video-frames encoding without compression.
  
  ??? tip "Modes of Operation"
  
      WriteGear primarily operates in following modes:
  
      * **Compression Mode**: In this mode, WriteGear utilizes powerful **FFmpeg** inbuilt encoders to encode lossless multimedia files.
                              This mode provides us the ability to exploit almost any parameter available within FFmpeg, effortlessly and flexibly,
                              and while doing that it robustly handles all errors/warnings quietly.
  
      * **Non-Compression Mode**: In this mode, WriteGear utilizes basic **OpenCV's inbuilt VideoWriter API** tools. This mode also supports all
                                  parameters manipulation available within VideoWriter API, but it lacks the ability to manipulate encoding parameters
                                  and other important features like video compression, audio encoding, etc.
class_docstr_tok: ["WriteGear","handles","various","powerful","Video-Writer","Tools","that","provide","us","the","freedom","to","do","almost","anything","imaginable","with","multimedia","data",".","WriteGear","API","provides","a","complete",",","flexible",",","and","robust","wrapper","around","FFmpeg",",","a","leading","multimedia","framework",".","WriteGear","can","process","real-time","frames","into","a","lossless","compressed","video-file","with","any","suitable","specification","(","such","as","bitrate",",","codec",",","framerate",",","resolution",",","subtitles",",","etc.",")",".","It","is","powerful","enough","to","perform","complex","tasks","such","as","Live-Streaming","(","such","as","for","Twitch",")","and","Multiplexing","Video-Audio","with","real-time","frames","in","way","fewer","lines","of","code",".","Best","of","all",",","WriteGear","grants","users","the","complete","freedom","to","play","with","any","FFmpeg","parameter","with","its","exclusive","Custom","Commands","function","without","relying","on","any","third-party","API",".","In","addition","to","this",",","WriteGear","also","provides","flexible","access","to","OpenCV","'s","VideoWriter","API","tools","for","video-frames","encoding","without","compression",".","?","?","?","tip","``","Modes","of","Operation","''","WriteGear","primarily","operates","in","following","modes",":","*","*","*","Compression","Mode","*","*",":","In","this","mode",",","WriteGear","utilizes","powerful","*","*","FFmpeg","*","*","inbuilt","encoders","to","encode","lossless","multimedia","files",".","This","mode","provides","us","the","ability","to","exploit","almost","any","parameter","available","within","FFmpeg",",","effortlessly","and","flexibly",",","and","while","doing","that","it","robustly","handles","all","errors\/warnings","quietly",".","*","*","*","Non-Compression","Mode","*","*",":","In","this","mode",",","WriteGear","utilizes","basic","*","*","OpenCV","'s","inbuilt","VideoWriter","API","*","*","tools",".","This","mode","also","supports","all","parameters","manipulation","available","within","VideoWriter","API",",","but","it","lacks","the","ability","to","manipulate","encoding","parameters","and","other","important","features","like","video","compression",",","audio","encoding",",","etc","."]
docstr: Handles entry with the `with` statement. See [PEP343 -- The 'with' statement'](https://peps.python.org/pep-0343/).
  
  **Returns:** Returns a reference to the WriteGear Class
docstr_tok: ["Handles","entry","with","the","`","with","`","statement",".","See","[","PEP343","--","The","'with","'","statement","'","]","(","https",":","\/\/peps.python.org\/pep-0343\/",")",".","*","*","Returns",":","*","*","Returns","a","reference","to","the","WriteGear","Class"]
code: def __enter__(self):
      """
      Handles entry with the `with` statement. See [PEP343 -- The 'with' statement'](https://peps.python.org/pep-0343/).
  
      **Returns:** Returns a reference to the WriteGear Class
      """
      return self
  
file_path: vidgear/vidgear/gears/writegear.py
imports: import os
  import cv2
  import time
  import platform
  import pathlib
  import logging
  import subprocess
  from .helper import capPropId, dict2Args, is_valid_url, logger_handler, check_WriteAccess, get_valid_ffmpeg_path, get_supported_pixfmts, get_supported_vencoders, check_gstreamer_support, logcurr_vidgear_ver
label_desc: Use image node_id 5 for calling the WriteGear obj's underlying member method code with example usage: obj.__enter__() and returns: self