From 7cd49af368588aabb3492db981ef6c0de6f6e948 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Fri, 11 Feb 2022 20:35:51 +0530 Subject: [PATCH 01/49] =?UTF-8?q?=F0=9F=94=96=20Setup:=20Bumped=20version?= =?UTF-8?q?=20to=200.2.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vidgear/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vidgear/version.py b/vidgear/version.py index 845be4539..d1eb74284 100644 --- a/vidgear/version.py +++ b/vidgear/version.py @@ -1 +1 @@ -__version__ = "0.2.5" \ No newline at end of file +__version__ = "0.2.6" \ No newline at end of file From b59b0901107c76342a75d23db86ae295fd1c8065 Mon Sep 17 00:00:00 2001 From: enarche-ahn Date: Wed, 16 Feb 2022 23:30:49 +0900 Subject: [PATCH 02/49] StreamGear : Fixed hls_segment_type not work bug --- vidgear/gears/streamgear.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vidgear/gears/streamgear.py b/vidgear/gears/streamgear.py index 4a63d6d17..e596e8d00 100644 --- a/vidgear/gears/streamgear.py +++ b/vidgear/gears/streamgear.py @@ -770,7 +770,7 @@ def __generate_hls_stream(self, input_params, output_params): # validate `hls_segment_type` default_hls_segment_type = self.__params.pop("-hls_segment_type", "mpegts") if isinstance( - default_hls_segment_type, int + default_hls_segment_type, str ) and default_hls_segment_type.strip() in ["fmp4", "mpegts"]: output_params["-hls_segment_type"] = default_hls_segment_type.strip() else: From 4c78e1826b96f4af2cf98cf0c71671490913806a Mon Sep 17 00:00:00 2001 From: enarche-ahn Date: Wed, 16 Feb 2022 23:31:28 +0900 Subject: [PATCH 03/49] StreamGear : Fix logging option bug --- vidgear/gears/streamgear.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vidgear/gears/streamgear.py b/vidgear/gears/streamgear.py index e596e8d00..ba16b204a 100644 --- a/vidgear/gears/streamgear.py +++ b/vidgear/gears/streamgear.py @@ -949,7 +949,7 @@ def __Build_n_Execute(self, input_params, output_params): stdout=sp.DEVNULL if (not self.__video_source and not self.__logging) else sp.PIPE, - stderr=sp.STDOUT if (self.__video_source and not self.__logging) else None, + stderr=sp.STDOUT if (not self.__video_source and not self.__logging) else None, ) # post handle progress bar and runtime errors in case of video_source if self.__video_source: From 1adfcd9608d9ba8a714f00fb6189b0ef3e1482de Mon Sep 17 00:00:00 2001 From: enarche-ahn Date: Thu, 17 Feb 2022 10:27:00 +0900 Subject: [PATCH 04/49] Revert "StreamGear : Fix logging option bug" This reverts commit 4c78e1826b96f4af2cf98cf0c71671490913806a. --- vidgear/gears/streamgear.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vidgear/gears/streamgear.py b/vidgear/gears/streamgear.py index ba16b204a..e596e8d00 100644 --- a/vidgear/gears/streamgear.py +++ b/vidgear/gears/streamgear.py @@ -949,7 +949,7 @@ def __Build_n_Execute(self, input_params, output_params): stdout=sp.DEVNULL if (not self.__video_source and not self.__logging) else sp.PIPE, - stderr=sp.STDOUT if (not self.__video_source and not self.__logging) else None, + stderr=sp.STDOUT if (self.__video_source and not self.__logging) else None, ) # post handle progress bar and runtime errors in case of video_source if self.__video_source: From b56cc777c2b8e6f536ccaf708f3a5dd0dcbe3004 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Thu, 17 Feb 2022 12:05:54 +0530 Subject: [PATCH 05/49] =?UTF-8?q?=F0=9F=90=9B=20StreamGear=20:=20Fixed=20c?= =?UTF-8?q?ritical=20`logging`=20parameter=20bug.=20(Fixes=20#289)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 🐛 Fixed debug logs even when `logging=False` in StreamGear's Real-time Mode. (patch suggested by @enarche-ahn) - 🎨 Added length check to `"-video_source"` attribute to correctly infers it as empty(or invalid). - 💡 Updated code comments. ✏️ Docs: Fixed typos in formatting. --- docs/gears/netgear/advanced/bidirectional_mode.md | 2 +- docs/gears/netgear/advanced/compression.md | 2 +- docs/gears/netgear/advanced/multi_client.md | 2 +- vidgear/gears/streamgear.py | 8 +++++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/gears/netgear/advanced/bidirectional_mode.md b/docs/gears/netgear/advanced/bidirectional_mode.md index e206be16a..e6b2a1ef0 100644 --- a/docs/gears/netgear/advanced/bidirectional_mode.md +++ b/docs/gears/netgear/advanced/bidirectional_mode.md @@ -516,7 +516,7 @@ client.close()   -## Using Bidirectional Mode for Video-Frames Transfer with Frame Compression :fire: +### Using Bidirectional Mode for Video-Frames Transfer with Frame Compression :fire: !!! example "This usage examples can be found [here ➶](../../advanced/compression/#using-bidirectional-mode-for-video-frames-transfer-with-frame-compression)" diff --git a/docs/gears/netgear/advanced/compression.md b/docs/gears/netgear/advanced/compression.md index 76d83fb47..41ffbf8b7 100644 --- a/docs/gears/netgear/advanced/compression.md +++ b/docs/gears/netgear/advanced/compression.md @@ -453,7 +453,7 @@ server.close()   -## Using Bidirectional Mode for Video-Frames Transfer with Frame Compression :fire: +### Using Bidirectional Mode for Video-Frames Transfer with Frame Compression :fire: NetGear now supports ==Dual Frame Compression== for transferring video-frames with its exclusive Bidirectional Mode for achieving unmatchable performance bidirectionally. You can easily enable Frame Compression with its performance attributes at both ends to boost performance bidirectionally. diff --git a/docs/gears/netgear/advanced/multi_client.md b/docs/gears/netgear/advanced/multi_client.md index 51b4df7c9..d25b50d71 100644 --- a/docs/gears/netgear/advanced/multi_client.md +++ b/docs/gears/netgear/advanced/multi_client.md @@ -32,7 +32,7 @@ In Multi-Clients Mode, NetGear robustly handles Multiple Clients at once thereby The supported patterns for this mode are Publish/Subscribe (`zmq.PUB/zmq.SUB`) and Request/Reply(`zmq.REQ/zmq.REP`) and can be easily activated in NetGear API through `multiclient_mode` attribute of its [`options`](../../params/#options) dictionary parameter during initialization. -!!! tip "Multi-Clients Mode is best for broadcasting **Meta-Data with Video-frames** to specific limited number of clients in real time. But if you're looking to scale broadcast to a very large pool of clients, then see our [WebGear](../../../webgear/overview/) or [WebGear_RTC](../../../webgear_rtc/overview/) APIs." +!!! alert "Multi-Clients Mode is best for broadcasting **Meta-Data with Video-frames** to specific limited number of clients in real time. But if you're looking to scale broadcast to a very large pool of clients, then see our [WebGear](../../../webgear/overview/) or [WebGear_RTC](../../../webgear_rtc/overview/) APIs."   diff --git a/vidgear/gears/streamgear.py b/vidgear/gears/streamgear.py index e596e8d00..ceaa261b2 100644 --- a/vidgear/gears/streamgear.py +++ b/vidgear/gears/streamgear.py @@ -151,14 +151,15 @@ def __init__( # handle Video-Source input source = self.__params.pop("-video_source", "") - # Check if input is valid - if source and isinstance(source, str): + # Check if input is valid string + if source and isinstance(source, str) and len(source) > 1: # Differentiate input if os.path.isfile(source): self.__video_source = os.path.abspath(source) elif is_valid_url(self.__ffmpeg, url=source, logging=self.__logging): self.__video_source = source else: + # discard the value otherwise self.__video_source = "" # Validate input if self.__video_source: @@ -183,6 +184,7 @@ def __init__( else: logger.warning("No valid video_source provided.") else: + # discard the value otherwise self.__video_source = "" # handle user-defined framerate @@ -949,7 +951,7 @@ def __Build_n_Execute(self, input_params, output_params): stdout=sp.DEVNULL if (not self.__video_source and not self.__logging) else sp.PIPE, - stderr=sp.STDOUT if (self.__video_source and not self.__logging) else None, + stderr=None if self.__logging else sp.STDOUT, ) # post handle progress bar and runtime errors in case of video_source if self.__video_source: From 62fa6b65fedf3e37812100e81a30618d7d8efa8c Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Thu, 17 Feb 2022 12:11:35 +0530 Subject: [PATCH 06/49] =?UTF-8?q?=F0=9F=99=88=20Maintenance:=20Updated=20`?= =?UTF-8?q?.gitignore`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 🎨 Added new patterns to `.gitignore` to ignore pypi's `build` directory and `egg-info` files. --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index e3ec40143..f08fe54d7 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,9 @@ env coverage.xml .netlify .idea +build/* +*.egg-info/ +*.egg # vim temporary files *~ From 58edc31a35addaa2fb644db99985964d4eefd222 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Thu, 17 Feb 2022 12:16:59 +0530 Subject: [PATCH 07/49] =?UTF-8?q?=F0=9F=93=9D=20Docs:=20Updated=20Zenodo?= =?UTF-8?q?=20badge=20and=20bibtex=20entry.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 14 +++++++------- docs/index.md | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 1c14481b6..d64d28069 100644 --- a/README.md +++ b/README.md @@ -680,7 +680,7 @@ It is something I am doing with my own free time. If you would like to say thank Here is a Bibtex entry you can use to cite this project in a publication: -[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5759524.svg)](https://doi.org/10.5281/zenodo.5759524) +[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.6046843.svg)](https://doi.org/10.5281/zenodo.6046843) ```BibTeX @software{vidgear, @@ -692,13 +692,13 @@ Here is a Bibtex entry you can use to cite this project in a publication: Benjamin Lowe and Mickaël Schoentgen and Renaud Bouckenooghe}, - title = {abhiTronix/vidgear: VidGear v0.2.4}, - month = dec, - year = 2021, + title = {abhiTronix/vidgear: VidGear v0.2.5}, + month = feb, + year = 2022, publisher = {Zenodo}, - version = {vidgear-0.2.4}, - doi = {10.5281/zenodo.5759524}, - url = {https://doi.org/10.5281/zenodo.5759524} + version = {vidgear-0.2.5}, + doi = {10.5281/zenodo.6046843}, + url = {https://doi.org/10.5281/zenodo.6046843} } ``` diff --git a/docs/index.md b/docs/index.md index ce4c95471..3957c632a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -126,7 +126,7 @@ It is something I am doing with my own free time. If you would like to say thank Here is a Bibtex entry you can use to cite this project in a publication: -[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5759524.svg)](https://doi.org/10.5281/zenodo.5759524) +[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.6046843.svg)](https://doi.org/10.5281/zenodo.6046843) ```BibTeX @software{vidgear, @@ -138,13 +138,13 @@ Here is a Bibtex entry you can use to cite this project in a publication: Benjamin Lowe and Mickaël Schoentgen and Renaud Bouckenooghe}, - title = {abhiTronix/vidgear: VidGear v0.2.4}, - month = dec, - year = 2021, + title = {abhiTronix/vidgear: VidGear v0.2.5}, + month = feb, + year = 2022, publisher = {Zenodo}, - version = {vidgear-0.2.4}, - doi = {10.5281/zenodo.5759524}, - url = {https://doi.org/10.5281/zenodo.5759524} + version = {vidgear-0.2.5}, + doi = {10.5281/zenodo.6046843}, + url = {https://doi.org/10.5281/zenodo.6046843} } ``` From e53d94f5ce1b152e1584d4649779b05ebbaf47f8 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Thu, 17 Feb 2022 16:51:05 +0530 Subject: [PATCH 08/49] =?UTF-8?q?=F0=9F=8F=97=EF=B8=8F=20Maintenance:=20Up?= =?UTF-8?q?dated=20depreciated=20`tostring()`=20to=20`tobytes()`.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 🎨 `tostring` was renamed to `tobytes` for the purposes for clarity in Python 3.2. https://docs.python.org/3/library/array.html#array.array.tobytes --- vidgear/gears/streamgear.py | 2 +- vidgear/gears/writegear.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vidgear/gears/streamgear.py b/vidgear/gears/streamgear.py index ceaa261b2..f5692ad27 100644 --- a/vidgear/gears/streamgear.py +++ b/vidgear/gears/streamgear.py @@ -368,7 +368,7 @@ def stream(self, frame, rgb_mode=False): # write the frame to pipeline try: - self.__process.stdin.write(frame.tostring()) + self.__process.stdin.write(frame.tobytes()) except (OSError, IOError): # log something is wrong! logger.error( diff --git a/vidgear/gears/writegear.py b/vidgear/gears/writegear.py index 522fe68ca..549483569 100644 --- a/vidgear/gears/writegear.py +++ b/vidgear/gears/writegear.py @@ -351,7 +351,7 @@ def write(self, frame, rgb_mode=False): # write the frame try: - self.__process.stdin.write(frame.tostring()) + self.__process.stdin.write(frame.tobytes()) except (OSError, IOError): # log something is wrong! logger.error( From d2e884e5b70e760efbb85c9eb82b9129f356fdf8 Mon Sep 17 00:00:00 2001 From: Ian Max Andolina Date: Wed, 23 Feb 2022 23:16:53 +0800 Subject: [PATCH 09/49] Add "How to solve zmq.error.ZMQError" to FAQ Added a section to the FAQ detailing a possible error if a user uses the server IP in the example code. --- docs/help/netgear_faqs.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/help/netgear_faqs.md b/docs/help/netgear_faqs.md index 6554a709d..33c6952a9 100644 --- a/docs/help/netgear_faqs.md +++ b/docs/help/netgear_faqs.md @@ -130,4 +130,10 @@ Here's the compatibility chart for NetGear's [Exclusive Modes](../../gears/netge **Answer:** First, carefully go through [NetGear doc ➶](../../gears/netgear/overview/) that contains detailed information. Also, checkout [PyZmq Docs ➶](https://pyzmq.readthedocs.io/en/latest/) for its various settings/parameters. If still it doesn't work for you, then let us know on [Gitter ➶](https://gitter.im/vidgear/community) -  \ No newline at end of file +  + +## How to solve `zmq.error.ZMQError` errors? + +**Answer:** For those used to the idea that a "server" provides their address to a client, then you should *recheck your preconceptions*! Please read the [Netgear instructions](https://abhitronix.github.io/vidgear/latest/gears/netgear/usage/#using-netgear-with-variable-parameters) carefully, and you will note that it is the client device that defines the IP that is provided to the server config. If you get this the wrong way (using the server IP on the client), then you will get a `zmq.error.ZMQError` error. Make sure it is the **client's IP** shared across the two systems. + +  From d281539837b07a1023b801b8485c77afff297c26 Mon Sep 17 00:00:00 2001 From: Ian Max Andolina Date: Wed, 23 Feb 2022 23:28:47 +0800 Subject: [PATCH 10/49] Fix some sample code issues I made 3 changes: (1) added a missing import (2) removed `self.` typo (3) removed the return value in the async as it triggers an error . --- docs/help/netgear_ex.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/help/netgear_ex.md b/docs/help/netgear_ex.md index 3c4dc3330..456167b99 100644 --- a/docs/help/netgear_ex.md +++ b/docs/help/netgear_ex.md @@ -44,6 +44,7 @@ Open a terminal on Client System where you want to display the input frames _(an ```python # import necessary libs import uvicorn, asyncio, cv2 +from vidgear.gears import NetGear from vidgear.gears.asyncio import WebGear from vidgear.gears.asyncio.helper import reducer @@ -77,11 +78,11 @@ async def my_frame_producer(): # loop over frames while True: # receive frames from network - frame = self.client.recv() + frame = client.recv() # if NoneType if frame is None: - return None + return # do something with your OpenCV frame here @@ -370,4 +371,4 @@ stream.stop() server.close() ``` -  \ No newline at end of file +  From 408b8bd81f707ecef5feb331870cc5026965bae0 Mon Sep 17 00:00:00 2001 From: Ian Max Andolina Date: Fri, 25 Feb 2022 06:12:57 +0800 Subject: [PATCH 11/49] Replace return with break Use break instead of return. Also correct a small typo (missing space) between word and bracket. --- docs/help/netgear_ex.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/help/netgear_ex.md b/docs/help/netgear_ex.md index 456167b99..67cff187a 100644 --- a/docs/help/netgear_ex.md +++ b/docs/help/netgear_ex.md @@ -39,7 +39,7 @@ Open a terminal on Client System where you want to display the input frames _(an !!! alert "High CPU utilization may occur on Client's end. User discretion is advised." -!!! info "Note down the local IP-address of this system(required at Server's end) and also replace it in the following code. You can follow [this FAQ](../netgear_faqs/#how-to-find-local-ip-address-on-different-os-platforms) for this purpose." +!!! info "Note down the local IP-address of this system (required at Server's end) and also replace it in the following code. You can follow [this FAQ](../netgear_faqs/#how-to-find-local-ip-address-on-different-os-platforms) for this purpose." ```python # import necessary libs @@ -82,7 +82,7 @@ async def my_frame_producer(): # if NoneType if frame is None: - return + break # do something with your OpenCV frame here From e67a0ed9de17a5db49b2b1ec023efd9d5532f14a Mon Sep 17 00:00:00 2001 From: Fredrik Olsson Date: Thu, 12 May 2022 12:10:55 +0200 Subject: [PATCH 12/49] Removing 5 second threshold in WriteGear and StreamGear --- vidgear/gears/streamgear.py | 4 ++-- vidgear/gears/writegear.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vidgear/gears/streamgear.py b/vidgear/gears/streamgear.py index f5692ad27..823f2397c 100644 --- a/vidgear/gears/streamgear.py +++ b/vidgear/gears/streamgear.py @@ -484,8 +484,8 @@ def __PreProcess(self, channels=0, rgb=False): output_parameters["-movflags"] = "+faststart" # set input framerate - if self.__sourceframerate > 5.0 and not (self.__video_source): - # minimum threshold is 5.0 + if self.__sourceframerate > 0 and not (self.__video_source): + # set input framerate self.__logging and logger.debug( "Setting Input framerate: {}".format(self.__sourceframerate) ) diff --git a/vidgear/gears/writegear.py b/vidgear/gears/writegear.py index 549483569..1d2310512 100644 --- a/vidgear/gears/writegear.py +++ b/vidgear/gears/writegear.py @@ -411,8 +411,8 @@ def __Preprocess(self, channels, rgb=False): "[WriteGear:ERROR] :: Frames with channels outside range 1-to-4 are not supported!" ) - if self.__inputframerate > 5: - # set input framerate - minimum threshold is 5.0 + if self.__inputframerate > 0: + # set input framerate self.__logging and logger.debug( "Setting Input framerate: {}".format(self.__inputframerate) ) From a60944978ae2e10e6f617caff4e394592b2328fc Mon Sep 17 00:00:00 2001 From: Fredrik Olsson Date: Fri, 13 May 2022 06:50:13 +0200 Subject: [PATCH 13/49] xfailing rtsp CamGear test --- vidgear/tests/videocapture_tests/test_camgear.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vidgear/tests/videocapture_tests/test_camgear.py b/vidgear/tests/videocapture_tests/test_camgear.py index c8f3f3830..2535c2d12 100644 --- a/vidgear/tests/videocapture_tests/test_camgear.py +++ b/vidgear/tests/videocapture_tests/test_camgear.py @@ -229,4 +229,4 @@ def test_network_playback(): pytest.fail(str(e)) if index == len(Publictest_rstp_urls): - pytest.fail("Test failed to play any URL!") + pytest.xfail("Test failed to play any URL!") From ca7538f110f0bec78299cb58bef1904211ef8105 Mon Sep 17 00:00:00 2001 From: SS Date: Thu, 16 Jun 2022 12:03:41 +0000 Subject: [PATCH 14/49] SS: Dash Segments Videos are not supported by OpenCV VideoCapture. --- vidgear/gears/camgear.py | 1090 +++++++++++++++++++------------------- 1 file changed, 546 insertions(+), 544 deletions(-) diff --git a/vidgear/gears/camgear.py b/vidgear/gears/camgear.py index feebd1d8c..9439a418d 100644 --- a/vidgear/gears/camgear.py +++ b/vidgear/gears/camgear.py @@ -1,544 +1,546 @@ -""" -=============================================== -vidgear library source-code is deployed under the Apache 2.0 License: - -Copyright (c) 2019 Abhishek Thakur(@abhiTronix) - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -=============================================== -""" - -# import the necessary packages -import cv2 -import time -import queue -import logging as log -from threading import Thread, Event - -# import helper packages -from .helper import ( - capPropId, - logger_handler, - check_CV_version, - get_supported_resolution, - check_gstreamer_support, - import_dependency_safe, -) - -# define logger -logger = log.getLogger("CamGear") -logger.propagate = False -logger.addHandler(logger_handler()) -logger.setLevel(log.DEBUG) - -yt_dlp = import_dependency_safe("yt_dlp", error="silent") -if not (yt_dlp is None): - # import YouTubeDL Parser - from yt_dlp import YoutubeDL - - class YT_backend: - """ - CamGear's Internal YT-DLP Backend Class for extracting metadata from Streaming URLs. - - Parameters: - source_url (string): defines the URL of source stream - logging (bool): enables/disables logging. - options (dict): provides ability to alter yt-dlp backend params. - """ - - def __init__(self, source_url, logging=False, **stream_params): - # initialize global params - self.__logging = logging - self.is_livestream = False - self.streams_metadata = {} - self.streams = {} - - # define supported resolution values - self.supported_resolutions = { - "256x144": "144p", - "426x240": "240p", - "640x360": "360p", - "854x480": "480p", - "1280x720": "720p", - "1920x1080": "1080p", - "2560x1440": "1440p", - "3840x2160": "2160p", - "7680x4320": "4320p", - } - - # assign source_url - self.source_url = source_url - - # define default options for yt-dlp backend - self.ydl_opts = { - "format": "best*[vcodec!=none]", - "quiet": True, - "prefer_insecure": False, - "no_warnings": True if logging else False, - "dump_single_json": True, - "extract_flat": True, - "skip_download": True, - } - # remove any attribute from user dict - # that can cause API to fail - stream_params.pop("format", None) - stream_params.pop("dump_single_json", None) - stream_params.pop("extract_flat", None) - - # extract exclusive params - std_hdrs = stream_params.pop("std_headers", None) - if not (std_hdrs is None) and isinstance(std_hdrs, dict): - yt_dlp.utils.std_headers.update(std_hdrs) - - # update with user defined options - self.ydl_opts.update(stream_params) - - # extract metadata - self.meta_data = self.__extract_meta() - - # check if source url is supported - if ( - not (self.meta_data is None) # meta-data is valid - and not ("entries" in self.meta_data) # playlists are not supported - and len(self.meta_data.get("formats", {})) - > 0 # video formats must exist - ): - self.is_livestream = self.meta_data.get("is_live", False) - self.streams_metadata = self.meta_data.get("formats", {}) - self.streams = self.__extract_streams() - if self.streams: - logger.info( - "[Backend] :: Streaming URL is fully supported. Available Streams are: [{}]".format( - ", ".join(list(self.streams.keys())) - ) - ) - else: - raise ValueError( - "[Backend] :: Streaming URL isn't supported. No usable video streams found!" - ) - else: - # otherwise notify user - raise ValueError( - "[Backend] :: Streaming URL isn't valid{}".format( - ". Playlists aren't supported yet!" - if not (self.meta_data is None) and "entries" in self.meta_data - else "!" - ) - ) - - def __extract_meta(self): - extracted_data = None - # run parser - with YoutubeDL(self.ydl_opts) as ydl: - try: - # parse data - extracted_data = ydl.extract_info(self.source_url, download=False) - except yt_dlp.utils.DownloadError as e: - # raise errors - raise RuntimeError(" [Backend] : " + str(e)) - # return data - return extracted_data - - def __extract_streams(self): - # extract streams - streams = {} - streams_copy = {} - for stream in self.streams_metadata: - # extract useable metadata - stream_dim = stream.get("resolution", "") - stream_url = stream.get("url", "") - stream_protocol = stream.get("protocol", "") - stream_with_video = ( - False if stream.get("vcodec", "none") == "none" else True - ) - stream_with_audio = ( - False if stream.get("acodec", "none") == "none" else True - ) - # streams must contain video - if stream_with_video and stream_dim and stream_url: - # check if stream resolution is supported - if stream_dim in self.supported_resolutions: - stream_res = self.supported_resolutions[stream_dim] - if ( - not stream_with_audio # prefer audioless - or stream_protocol in ["https", "http"] # prefer http/https - or not ( - stream_res in streams - ) # check if already not in dict - ): - streams[stream_res] = stream_url - # otherwise make a copy - if ( - not stream_with_audio # prefer audioless - or stream_protocol in ["https", "http"] # prefer http/https - or not ( - stream_dim in streams_copy - ) # check if already not in dict - ): - streams_copy[stream_dim] = stream_url - # use copy to decide best or worst - streams["best"] = streams_copy[list(streams_copy.keys())[-1]] - streams["worst"] = streams_copy[list(streams_copy.keys())[0]] - return streams - - -class CamGear: - """ - CamGear supports a diverse range of video streams which can handle/control video stream almost any IP/USB Cameras, multimedia video file format (upto 4k tested), - any network stream URL such as http(s), rtp, rstp, rtmp, mms, etc. It also supports Gstreamer's RAW pipelines. - - CamGear API provides a flexible, high-level multi-threaded wrapper around OpenCV's VideoCapture API with direct access to almost all of its available parameters. - It relies on Threaded Queue mode for threaded, error-free and synchronized frame handling. - - CamGear internally implements `yt_dlp` backend class for seamlessly pipelining live video-frames and metadata from various streaming services like YouTube, Dailymotion, - Twitch, and [many more ➶](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md#supported-sites) - """ - - def __init__( - self, - source=0, - stream_mode=False, - backend=0, - colorspace=None, - logging=False, - time_delay=0, - **options - ): - - """ - This constructor method initializes the object state and attributes of the CamGear class. - - Parameters: - source (based on input): defines the source for the input stream. - stream_mode (bool): controls the exclusive **Stream Mode** for handling streaming URLs. - backend (int): selects the backend for OpenCV's VideoCapture class. - colorspace (str): selects the colorspace of the input stream. - logging (bool): enables/disables logging. - time_delay (int): time delay (in sec) before start reading the frames. - options (dict): provides ability to alter Source Tweak Parameters. - """ - - # enable logging if specified - self.__logging = False - if logging: - self.__logging = logging - # initialize global - self.ytv_metadata = {} - - # check if Stream-Mode is ON (True) - if stream_mode: - # check GStreamer backend support - gst_support = check_gstreamer_support(logging=logging) - # handle special Stream Mode parameters - stream_resolution = get_supported_resolution( - options.pop("STREAM_RESOLUTION", "best"), logging=logging - ) - # handle Stream-Mode - if not (yt_dlp is None): - # extract user-defined params - yt_stream_params = options.pop("STREAM_PARAMS", {}) - if isinstance(yt_stream_params, dict): - yt_stream_params = { - str(k).strip(): v for k, v in yt_stream_params.items() - } - else: - yt_stream_params = {} - try: - # Validate source for Yt_dlp backend - logger.info( - "Verifying Streaming URL using yt-dlp backend. Please wait..." - ) - # initialize YT_backend - ytbackend = YT_backend( - source_url=source, logging=logging, **yt_stream_params - ) - if ytbackend: - # save video metadata - self.ytv_metadata = ytbackend.meta_data - # handle live-streams - if ytbackend.is_livestream: - # Throw warning for livestreams - logger.warning( - "Livestream URL detected. It is advised to use GStreamer backend(`cv2.CAP_GSTREAMER`) with it." - ) - # check whether stream-resolution was specified and available - if not (stream_resolution in ytbackend.streams.keys()): - logger.warning( - "Specified stream-resolution `{}` is not available. Reverting to `best`!".format( - stream_resolution - ) - ) - # revert to best - stream_resolution = "best" - else: - if self.__logging: - logger.debug( - "Using `{}` resolution for streaming.".format( - stream_resolution - ) - ) - # extract stream URL as source using stream-resolution - source = ytbackend.streams[stream_resolution] - # log progress - self.__logging and logger.debug( - "YouTube source ID: `{}`, Title: `{}`, Quality: `{}`".format( - self.ytv_metadata["id"], - self.ytv_metadata["title"], - stream_resolution, - ) - ) - except Exception as e: - # raise error if something went wrong - raise ValueError( - "[CamGear:ERROR] :: Stream Mode is enabled but Input URL is invalid!" - ) - else: - # raise import errors - import_dependency_safe("yt_dlp") - - # youtube mode variable initialization - self.__youtube_mode = stream_mode - - # assigns special parameter to global variable and clear - # Threaded Queue Mode - self.__threaded_queue_mode = options.pop("THREADED_QUEUE_MODE", True) - if not isinstance(self.__threaded_queue_mode, bool): - # reset improper values - self.__threaded_queue_mode = True - # Thread Timeout - self.__thread_timeout = options.pop("THREAD_TIMEOUT", None) - if self.__thread_timeout and isinstance(self.__thread_timeout, (int, float)): - # set values - self.__thread_timeout = float(self.__thread_timeout) - else: - # defaults to 5mins timeout - self.__thread_timeout = None - - self.__queue = None - # initialize queue for video files only - if self.__threaded_queue_mode and isinstance(source, str): - # define queue and assign it to global var - self.__queue = queue.Queue(maxsize=96) # max bufferlen 96 to check overflow - # log it - self.__logging and logger.debug( - "Enabling Threaded Queue Mode for the current video source!" - ) - else: - # otherwise disable it - self.__threaded_queue_mode = False - # log it - self.__logging and logger.warning( - "Threaded Queue Mode is disabled for the current video source!" - ) - - if self.__thread_timeout: - logger.debug( - "Setting Video-Thread Timeout to {}s.".format(self.__thread_timeout) - ) - - # stream variable initialization - self.stream = None - - if backend and isinstance(backend, int): - # add backend if specified and initialize the camera stream - if check_CV_version() == 3: - # Different OpenCV 3.4.x statement - self.stream = cv2.VideoCapture(source + backend) - else: - # Two parameters are available since OpenCV 4+ (master branch) - self.stream = cv2.VideoCapture(source, backend) - logger.debug("Setting backend `{}` for this source.".format(backend)) - else: - # initialize the camera stream - self.stream = cv2.VideoCapture(source) - - # initializing colorspace variable - self.color_space = None - - # apply attributes to source if specified - options = {str(k).strip(): v for k, v in options.items()} - for key, value in options.items(): - property = capPropId(key) - if not (property is None): - self.stream.set(property, value) - - # handle colorspace value - if not (colorspace is None): - self.color_space = capPropId(colorspace.strip()) - if self.__logging and not (self.color_space is None): - logger.debug( - "Enabling `{}` colorspace for this video stream!".format( - colorspace.strip() - ) - ) - - # initialize and assign frame-rate variable - self.framerate = 0.0 - _fps = self.stream.get(cv2.CAP_PROP_FPS) - if _fps > 1.0: - self.framerate = _fps - - # applying time delay to warm-up webcam only if specified - if time_delay and isinstance(time_delay, (int, float)): - time.sleep(time_delay) - - # frame variable initialization - (grabbed, self.frame) = self.stream.read() - - # check if valid stream - if grabbed: - # render colorspace if defined - if not (self.color_space is None): - self.frame = cv2.cvtColor(self.frame, self.color_space) - - if self.__threaded_queue_mode: - # initialize and append to queue - self.__queue.put(self.frame) - else: - raise RuntimeError( - "[CamGear:ERROR] :: Source is invalid, CamGear failed to initialize stream on this source!" - ) - - # thread initialization - self.__thread = None - - # initialize termination flag event - self.__terminate = Event() - - # initialize stream read flag event - self.__stream_read = Event() - - def start(self): - """ - Launches the internal *Threaded Frames Extractor* daemon. - - **Returns:** A reference to the CamGear class object. - """ - - self.__thread = Thread(target=self.__update, name="CamGear", args=()) - self.__thread.daemon = True - self.__thread.start() - return self - - def __update(self): - """ - A **Threaded Frames Extractor**, that keep iterating frames from OpenCV's VideoCapture API to a internal monitored queue, - until the thread is terminated, or frames runs out. - """ - - # keep iterating infinitely - # until the thread is terminated - # or frames runs out - while True: - # if the thread indicator variable is set, stop the thread - if self.__terminate.is_set(): - break - - # stream not read yet - self.__stream_read.clear() - - # otherwise, read the next frame from the stream - (grabbed, frame) = self.stream.read() - - # stream read completed - self.__stream_read.set() - - # check for valid frame if received - if not grabbed: - # no frames received, then safely exit - if self.__threaded_queue_mode: - if self.__queue.empty(): - break - else: - continue - else: - break - - # apply colorspace to frames if valid - if not (self.color_space is None): - color_frame = None - try: - if isinstance(self.color_space, int): - color_frame = cv2.cvtColor(frame, self.color_space) - else: - raise ValueError( - "Global color_space parameter value `{}` is not a valid!".format( - self.color_space - ) - ) - except Exception as e: - # Catch if any error occurred - self.color_space = None - if self.__logging: - logger.exception(str(e)) - logger.warning("Input colorspace is not a valid colorspace!") - if not (color_frame is None): - self.frame = color_frame - else: - self.frame = frame - else: - self.frame = frame - - # append to queue - if self.__threaded_queue_mode: - self.__queue.put(self.frame) - - # indicate immediate termination - self.__threaded_queue_mode = False - self.__terminate.set() - self.__stream_read.set() - # release resources - self.stream.release() - - def read(self): - """ - Extracts frames synchronously from monitored queue, while maintaining a fixed-length frame buffer in the memory, - and blocks the thread if the queue is full. - - **Returns:** A n-dimensional numpy array. - """ - while self.__threaded_queue_mode: - return self.__queue.get(timeout=self.__thread_timeout) - # return current frame - # only after stream is read - return ( - self.frame - if not self.__terminate.is_set() # check if already terminated - and self.__stream_read.wait(timeout=self.__thread_timeout) # wait for it - else None - ) - - def stop(self): - """ - Safely terminates the thread, and release the VideoStream resources. - """ - self.__logging and logger.debug("Terminating processes.") - # terminate Threaded queue mode separately - if self.__threaded_queue_mode: - self.__threaded_queue_mode = False - - # indicate that the thread - # should be terminated immediately - self.__terminate.set() - self.__stream_read.set() - - # wait until stream resources are released (producer thread might be still grabbing frame) - if self.__thread is not None: - if not (self.__queue is None): - while not self.__queue.empty(): - try: - self.__queue.get_nowait() - except queue.Empty: - continue - self.__queue.task_done() - self.__thread.join() +""" +=============================================== +vidgear library source-code is deployed under the Apache 2.0 License: + +Copyright (c) 2019 Abhishek Thakur(@abhiTronix) + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=============================================== +""" + +# import the necessary packages +import cv2 +import time +import queue +import logging as log +from threading import Thread, Event + +# import helper packages +from .helper import ( + capPropId, + logger_handler, + check_CV_version, + get_supported_resolution, + check_gstreamer_support, + import_dependency_safe, +) + +# define logger +logger = log.getLogger("CamGear") +logger.propagate = False +logger.addHandler(logger_handler()) +logger.setLevel(log.DEBUG) + +yt_dlp = import_dependency_safe("yt_dlp", error="silent") +if not (yt_dlp is None): + # import YouTubeDL Parser + from yt_dlp import YoutubeDL + + class YT_backend: + """ + CamGear's Internal YT-DLP Backend Class for extracting metadata from Streaming URLs. + + Parameters: + source_url (string): defines the URL of source stream + logging (bool): enables/disables logging. + options (dict): provides ability to alter yt-dlp backend params. + """ + + def __init__(self, source_url, logging=False, **stream_params): + # initialize global params + self.__logging = logging + self.is_livestream = False + self.streams_metadata = {} + self.streams = {} + + # define supported resolution values + self.supported_resolutions = { + "256x144": "144p", + "426x240": "240p", + "640x360": "360p", + "854x480": "480p", + "1280x720": "720p", + "1920x1080": "1080p", + "2560x1440": "1440p", + "3840x2160": "2160p", + "7680x4320": "4320p", + } + + # assign source_url + self.source_url = source_url + + # define default options for yt-dlp backend + self.ydl_opts = { + "format": "best*[vcodec!=none]", + "quiet": True, + "prefer_insecure": False, + "no_warnings": True if logging else False, + "dump_single_json": True, + "extract_flat": True, + "skip_download": True, + } + # remove any attribute from user dict + # that can cause API to fail + stream_params.pop("format", None) + stream_params.pop("dump_single_json", None) + stream_params.pop("extract_flat", None) + + # extract exclusive params + std_hdrs = stream_params.pop("std_headers", None) + if not (std_hdrs is None) and isinstance(std_hdrs, dict): + yt_dlp.utils.std_headers.update(std_hdrs) + + # update with user defined options + self.ydl_opts.update(stream_params) + + # extract metadata + self.meta_data = self.__extract_meta() + + # check if source url is supported + if ( + not (self.meta_data is None) # meta-data is valid + and not ("entries" in self.meta_data) # playlists are not supported + and len(self.meta_data.get("formats", {})) + > 0 # video formats must exist + ): + self.is_livestream = self.meta_data.get("is_live", False) + self.streams_metadata = self.meta_data.get("formats", {}) + self.streams = self.__extract_streams() + if self.streams: + logger.info( + "[Backend] :: Streaming URL is fully supported. Available Streams are: [{}]".format( + ", ".join(list(self.streams.keys())) + ) + ) + else: + raise ValueError( + "[Backend] :: Streaming URL isn't supported. No usable video streams found!" + ) + else: + # otherwise notify user + raise ValueError( + "[Backend] :: Streaming URL isn't valid{}".format( + ". Playlists aren't supported yet!" + if not (self.meta_data is None) and "entries" in self.meta_data + else "!" + ) + ) + + def __extract_meta(self): + extracted_data = None + # run parser + with YoutubeDL(self.ydl_opts) as ydl: + try: + # parse data + extracted_data = ydl.extract_info(self.source_url, download=False) + except yt_dlp.utils.DownloadError as e: + # raise errors + raise RuntimeError(" [Backend] : " + str(e)) + # return data + return extracted_data + + def __extract_streams(self): + # extract streams + streams = {} + streams_copy = {} + for stream in self.streams_metadata: + # extract useable metadata + stream_dim = stream.get("resolution", "") + stream_url = stream.get("url", "") + stream_protocol = stream.get("protocol", "") + if stream_protocol == 'http_dash_segments': + continue + stream_with_video = ( + False if stream.get("vcodec", "none") == "none" else True + ) + stream_with_audio = ( + False if stream.get("acodec", "none") == "none" else True + ) + # streams must contain video + if stream_with_video and stream_dim and stream_url: + # check if stream resolution is supported + if stream_dim in self.supported_resolutions: + stream_res = self.supported_resolutions[stream_dim] + if ( + not stream_with_audio # prefer audioless + or stream_protocol in ["https", "http"] # prefer http/https + or not ( + stream_res in streams + ) # check if already not in dict + ): + streams[stream_res] = stream_url + # otherwise make a copy + if ( + not stream_with_audio # prefer audioless + or stream_protocol in ["https", "http"] # prefer http/https + or not ( + stream_dim in streams_copy + ) # check if already not in dict + ): + streams_copy[stream_dim] = stream_url + # use copy to decide best or worst + streams["best"] = streams_copy[list(streams_copy.keys())[-1]] + streams["worst"] = streams_copy[list(streams_copy.keys())[0]] + return streams + + +class CamGear: + """ + CamGear supports a diverse range of video streams which can handle/control video stream almost any IP/USB Cameras, multimedia video file format (upto 4k tested), + any network stream URL such as http(s), rtp, rstp, rtmp, mms, etc. It also supports Gstreamer's RAW pipelines. + + CamGear API provides a flexible, high-level multi-threaded wrapper around OpenCV's VideoCapture API with direct access to almost all of its available parameters. + It relies on Threaded Queue mode for threaded, error-free and synchronized frame handling. + + CamGear internally implements `yt_dlp` backend class for seamlessly pipelining live video-frames and metadata from various streaming services like YouTube, Dailymotion, + Twitch, and [many more ➶](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md#supported-sites) + """ + + def __init__( + self, + source=0, + stream_mode=False, + backend=0, + colorspace=None, + logging=False, + time_delay=0, + **options + ): + + """ + This constructor method initializes the object state and attributes of the CamGear class. + + Parameters: + source (based on input): defines the source for the input stream. + stream_mode (bool): controls the exclusive **Stream Mode** for handling streaming URLs. + backend (int): selects the backend for OpenCV's VideoCapture class. + colorspace (str): selects the colorspace of the input stream. + logging (bool): enables/disables logging. + time_delay (int): time delay (in sec) before start reading the frames. + options (dict): provides ability to alter Source Tweak Parameters. + """ + + # enable logging if specified + self.__logging = False + if logging: + self.__logging = logging + # initialize global + self.ytv_metadata = {} + + # check if Stream-Mode is ON (True) + if stream_mode: + # check GStreamer backend support + gst_support = check_gstreamer_support(logging=logging) + # handle special Stream Mode parameters + stream_resolution = get_supported_resolution( + options.pop("STREAM_RESOLUTION", "best"), logging=logging + ) + # handle Stream-Mode + if not (yt_dlp is None): + # extract user-defined params + yt_stream_params = options.pop("STREAM_PARAMS", {}) + if isinstance(yt_stream_params, dict): + yt_stream_params = { + str(k).strip(): v for k, v in yt_stream_params.items() + } + else: + yt_stream_params = {} + try: + # Validate source for Yt_dlp backend + logger.info( + "Verifying Streaming URL using yt-dlp backend. Please wait..." + ) + # initialize YT_backend + ytbackend = YT_backend( + source_url=source, logging=logging, **yt_stream_params + ) + if ytbackend: + # save video metadata + self.ytv_metadata = ytbackend.meta_data + # handle live-streams + if ytbackend.is_livestream: + # Throw warning for livestreams + logger.warning( + "Livestream URL detected. It is advised to use GStreamer backend(`cv2.CAP_GSTREAMER`) with it." + ) + # check whether stream-resolution was specified and available + if not (stream_resolution in ytbackend.streams.keys()): + logger.warning( + "Specified stream-resolution `{}` is not available. Reverting to `best`!".format( + stream_resolution + ) + ) + # revert to best + stream_resolution = "best" + else: + if self.__logging: + logger.debug( + "Using `{}` resolution for streaming.".format( + stream_resolution + ) + ) + # extract stream URL as source using stream-resolution + source = ytbackend.streams[stream_resolution] + # log progress + self.__logging and logger.debug( + "YouTube source ID: `{}`, Title: `{}`, Quality: `{}`".format( + self.ytv_metadata["id"], + self.ytv_metadata["title"], + stream_resolution, + ) + ) + except Exception as e: + # raise error if something went wrong + raise ValueError( + "[CamGear:ERROR] :: Stream Mode is enabled but Input URL is invalid!" + ) + else: + # raise import errors + import_dependency_safe("yt_dlp") + + # youtube mode variable initialization + self.__youtube_mode = stream_mode + + # assigns special parameter to global variable and clear + # Threaded Queue Mode + self.__threaded_queue_mode = options.pop("THREADED_QUEUE_MODE", True) + if not isinstance(self.__threaded_queue_mode, bool): + # reset improper values + self.__threaded_queue_mode = True + # Thread Timeout + self.__thread_timeout = options.pop("THREAD_TIMEOUT", None) + if self.__thread_timeout and isinstance(self.__thread_timeout, (int, float)): + # set values + self.__thread_timeout = float(self.__thread_timeout) + else: + # defaults to 5mins timeout + self.__thread_timeout = None + + self.__queue = None + # initialize queue for video files only + if self.__threaded_queue_mode and isinstance(source, str): + # define queue and assign it to global var + self.__queue = queue.Queue(maxsize=96) # max bufferlen 96 to check overflow + # log it + self.__logging and logger.debug( + "Enabling Threaded Queue Mode for the current video source!" + ) + else: + # otherwise disable it + self.__threaded_queue_mode = False + # log it + self.__logging and logger.warning( + "Threaded Queue Mode is disabled for the current video source!" + ) + + if self.__thread_timeout: + logger.debug( + "Setting Video-Thread Timeout to {}s.".format(self.__thread_timeout) + ) + + # stream variable initialization + self.stream = None + + if backend and isinstance(backend, int): + # add backend if specified and initialize the camera stream + if check_CV_version() == 3: + # Different OpenCV 3.4.x statement + self.stream = cv2.VideoCapture(source + backend) + else: + # Two parameters are available since OpenCV 4+ (master branch) + self.stream = cv2.VideoCapture(source, backend) + logger.debug("Setting backend `{}` for this source.".format(backend)) + else: + # initialize the camera stream + self.stream = cv2.VideoCapture(source) + + # initializing colorspace variable + self.color_space = None + + # apply attributes to source if specified + options = {str(k).strip(): v for k, v in options.items()} + for key, value in options.items(): + property = capPropId(key) + if not (property is None): + self.stream.set(property, value) + + # handle colorspace value + if not (colorspace is None): + self.color_space = capPropId(colorspace.strip()) + if self.__logging and not (self.color_space is None): + logger.debug( + "Enabling `{}` colorspace for this video stream!".format( + colorspace.strip() + ) + ) + + # initialize and assign frame-rate variable + self.framerate = 0.0 + _fps = self.stream.get(cv2.CAP_PROP_FPS) + if _fps > 1.0: + self.framerate = _fps + + # applying time delay to warm-up webcam only if specified + if time_delay and isinstance(time_delay, (int, float)): + time.sleep(time_delay) + + # frame variable initialization + (grabbed, self.frame) = self.stream.read() + + # check if valid stream + if grabbed: + # render colorspace if defined + if not (self.color_space is None): + self.frame = cv2.cvtColor(self.frame, self.color_space) + + if self.__threaded_queue_mode: + # initialize and append to queue + self.__queue.put(self.frame) + else: + raise RuntimeError( + "[CamGear:ERROR] :: Source is invalid, CamGear failed to initialize stream on this source!" + ) + + # thread initialization + self.__thread = None + + # initialize termination flag event + self.__terminate = Event() + + # initialize stream read flag event + self.__stream_read = Event() + + def start(self): + """ + Launches the internal *Threaded Frames Extractor* daemon. + + **Returns:** A reference to the CamGear class object. + """ + + self.__thread = Thread(target=self.__update, name="CamGear", args=()) + self.__thread.daemon = True + self.__thread.start() + return self + + def __update(self): + """ + A **Threaded Frames Extractor**, that keep iterating frames from OpenCV's VideoCapture API to a internal monitored queue, + until the thread is terminated, or frames runs out. + """ + + # keep iterating infinitely + # until the thread is terminated + # or frames runs out + while True: + # if the thread indicator variable is set, stop the thread + if self.__terminate.is_set(): + break + + # stream not read yet + self.__stream_read.clear() + + # otherwise, read the next frame from the stream + (grabbed, frame) = self.stream.read() + + # stream read completed + self.__stream_read.set() + + # check for valid frame if received + if not grabbed: + # no frames received, then safely exit + if self.__threaded_queue_mode: + if self.__queue.empty(): + break + else: + continue + else: + break + + # apply colorspace to frames if valid + if not (self.color_space is None): + color_frame = None + try: + if isinstance(self.color_space, int): + color_frame = cv2.cvtColor(frame, self.color_space) + else: + raise ValueError( + "Global color_space parameter value `{}` is not a valid!".format( + self.color_space + ) + ) + except Exception as e: + # Catch if any error occurred + self.color_space = None + if self.__logging: + logger.exception(str(e)) + logger.warning("Input colorspace is not a valid colorspace!") + if not (color_frame is None): + self.frame = color_frame + else: + self.frame = frame + else: + self.frame = frame + + # append to queue + if self.__threaded_queue_mode: + self.__queue.put(self.frame) + + # indicate immediate termination + self.__threaded_queue_mode = False + self.__terminate.set() + self.__stream_read.set() + # release resources + self.stream.release() + + def read(self): + """ + Extracts frames synchronously from monitored queue, while maintaining a fixed-length frame buffer in the memory, + and blocks the thread if the queue is full. + + **Returns:** A n-dimensional numpy array. + """ + while self.__threaded_queue_mode: + return self.__queue.get(timeout=self.__thread_timeout) + # return current frame + # only after stream is read + return ( + self.frame + if not self.__terminate.is_set() # check if already terminated + and self.__stream_read.wait(timeout=self.__thread_timeout) # wait for it + else None + ) + + def stop(self): + """ + Safely terminates the thread, and release the VideoStream resources. + """ + self.__logging and logger.debug("Terminating processes.") + # terminate Threaded queue mode separately + if self.__threaded_queue_mode: + self.__threaded_queue_mode = False + + # indicate that the thread + # should be terminated immediately + self.__terminate.set() + self.__stream_read.set() + + # wait until stream resources are released (producer thread might be still grabbing frame) + if self.__thread is not None: + if not (self.__queue is None): + while not self.__queue.empty(): + try: + self.__queue.get_nowait() + except queue.Empty: + continue + self.__queue.task_done() + self.__thread.join() From b822df69c9186e39fe800aedaa467a34a04f9351 Mon Sep 17 00:00:00 2001 From: SS Date: Thu, 16 Jun 2022 13:15:57 +0000 Subject: [PATCH 15/49] SS: Reformatted to LF from CRLF --- vidgear/gears/camgear.py | 43 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/vidgear/gears/camgear.py b/vidgear/gears/camgear.py index 9439a418d..e598267cc 100644 --- a/vidgear/gears/camgear.py +++ b/vidgear/gears/camgear.py @@ -46,6 +46,7 @@ # import YouTubeDL Parser from yt_dlp import YoutubeDL + class YT_backend: """ CamGear's Internal YT-DLP Backend Class for extracting metadata from Streaming URLs. @@ -108,10 +109,10 @@ def __init__(self, source_url, logging=False, **stream_params): # check if source url is supported if ( - not (self.meta_data is None) # meta-data is valid - and not ("entries" in self.meta_data) # playlists are not supported - and len(self.meta_data.get("formats", {})) - > 0 # video formats must exist + not (self.meta_data is None) # meta-data is valid + and not ("entries" in self.meta_data) # playlists are not supported + and len(self.meta_data.get("formats", {})) + > 0 # video formats must exist ): self.is_livestream = self.meta_data.get("is_live", False) self.streams_metadata = self.meta_data.get("formats", {}) @@ -172,20 +173,20 @@ def __extract_streams(self): if stream_dim in self.supported_resolutions: stream_res = self.supported_resolutions[stream_dim] if ( - not stream_with_audio # prefer audioless - or stream_protocol in ["https", "http"] # prefer http/https - or not ( + not stream_with_audio # prefer audioless + or stream_protocol in ["https", "http"] # prefer http/https + or not ( stream_res in streams - ) # check if already not in dict + ) # check if already not in dict ): streams[stream_res] = stream_url # otherwise make a copy if ( - not stream_with_audio # prefer audioless - or stream_protocol in ["https", "http"] # prefer http/https - or not ( + not stream_with_audio # prefer audioless + or stream_protocol in ["https", "http"] # prefer http/https + or not ( stream_dim in streams_copy - ) # check if already not in dict + ) # check if already not in dict ): streams_copy[stream_dim] = stream_url # use copy to decide best or worst @@ -207,14 +208,14 @@ class CamGear: """ def __init__( - self, - source=0, - stream_mode=False, - backend=0, - colorspace=None, - logging=False, - time_delay=0, - **options + self, + source=0, + stream_mode=False, + backend=0, + colorspace=None, + logging=False, + time_delay=0, + **options ): """ @@ -516,7 +517,7 @@ def read(self): return ( self.frame if not self.__terminate.is_set() # check if already terminated - and self.__stream_read.wait(timeout=self.__thread_timeout) # wait for it + and self.__stream_read.wait(timeout=self.__thread_timeout) # wait for it else None ) From 5328ab46d50c0f638e327e4933c52fad115ff975 Mon Sep 17 00:00:00 2001 From: SS Date: Thu, 16 Jun 2022 13:19:52 +0000 Subject: [PATCH 16/49] SS: Reformatted to LF from CRLF --- vidgear/gears/camgear.py | 43 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/vidgear/gears/camgear.py b/vidgear/gears/camgear.py index e598267cc..9439a418d 100644 --- a/vidgear/gears/camgear.py +++ b/vidgear/gears/camgear.py @@ -46,7 +46,6 @@ # import YouTubeDL Parser from yt_dlp import YoutubeDL - class YT_backend: """ CamGear's Internal YT-DLP Backend Class for extracting metadata from Streaming URLs. @@ -109,10 +108,10 @@ def __init__(self, source_url, logging=False, **stream_params): # check if source url is supported if ( - not (self.meta_data is None) # meta-data is valid - and not ("entries" in self.meta_data) # playlists are not supported - and len(self.meta_data.get("formats", {})) - > 0 # video formats must exist + not (self.meta_data is None) # meta-data is valid + and not ("entries" in self.meta_data) # playlists are not supported + and len(self.meta_data.get("formats", {})) + > 0 # video formats must exist ): self.is_livestream = self.meta_data.get("is_live", False) self.streams_metadata = self.meta_data.get("formats", {}) @@ -173,20 +172,20 @@ def __extract_streams(self): if stream_dim in self.supported_resolutions: stream_res = self.supported_resolutions[stream_dim] if ( - not stream_with_audio # prefer audioless - or stream_protocol in ["https", "http"] # prefer http/https - or not ( + not stream_with_audio # prefer audioless + or stream_protocol in ["https", "http"] # prefer http/https + or not ( stream_res in streams - ) # check if already not in dict + ) # check if already not in dict ): streams[stream_res] = stream_url # otherwise make a copy if ( - not stream_with_audio # prefer audioless - or stream_protocol in ["https", "http"] # prefer http/https - or not ( + not stream_with_audio # prefer audioless + or stream_protocol in ["https", "http"] # prefer http/https + or not ( stream_dim in streams_copy - ) # check if already not in dict + ) # check if already not in dict ): streams_copy[stream_dim] = stream_url # use copy to decide best or worst @@ -208,14 +207,14 @@ class CamGear: """ def __init__( - self, - source=0, - stream_mode=False, - backend=0, - colorspace=None, - logging=False, - time_delay=0, - **options + self, + source=0, + stream_mode=False, + backend=0, + colorspace=None, + logging=False, + time_delay=0, + **options ): """ @@ -517,7 +516,7 @@ def read(self): return ( self.frame if not self.__terminate.is_set() # check if already terminated - and self.__stream_read.wait(timeout=self.__thread_timeout) # wait for it + and self.__stream_read.wait(timeout=self.__thread_timeout) # wait for it else None ) From 569605998964ebac76a50a959d2b63a54e9876c2 Mon Sep 17 00:00:00 2001 From: SS Date: Fri, 17 Jun 2022 01:08:35 +0000 Subject: [PATCH 17/49] SS: Review changes done, added condition with other parameters --- vidgear/gears/camgear.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vidgear/gears/camgear.py b/vidgear/gears/camgear.py index 9439a418d..8402d33fb 100644 --- a/vidgear/gears/camgear.py +++ b/vidgear/gears/camgear.py @@ -158,8 +158,6 @@ def __extract_streams(self): stream_dim = stream.get("resolution", "") stream_url = stream.get("url", "") stream_protocol = stream.get("protocol", "") - if stream_protocol == 'http_dash_segments': - continue stream_with_video = ( False if stream.get("vcodec", "none") == "none" else True ) @@ -167,7 +165,7 @@ def __extract_streams(self): False if stream.get("acodec", "none") == "none" else True ) # streams must contain video - if stream_with_video and stream_dim and stream_url: + if stream_with_video and stream_dim and stream_url and stream_protocol != 'http_dash_segments': # check if stream resolution is supported if stream_dim in self.supported_resolutions: stream_res = self.supported_resolutions[stream_dim] From 2eb1617ff6e465451fece8f87896329268c993ca Mon Sep 17 00:00:00 2001 From: SS Date: Fri, 17 Jun 2022 01:13:24 +0000 Subject: [PATCH 18/49] SS: Review changes done, added condition with other parameters --- vidgear/gears/camgear.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vidgear/gears/camgear.py b/vidgear/gears/camgear.py index 8402d33fb..e8a137362 100644 --- a/vidgear/gears/camgear.py +++ b/vidgear/gears/camgear.py @@ -165,7 +165,7 @@ def __extract_streams(self): False if stream.get("acodec", "none") == "none" else True ) # streams must contain video - if stream_with_video and stream_dim and stream_url and stream_protocol != 'http_dash_segments': + if stream_with_video and stream_dim and stream_url and stream_protocol != "http_dash_segments": # check if stream resolution is supported if stream_dim in self.supported_resolutions: stream_res = self.supported_resolutions[stream_dim] From 79a5c8488d12080bda88cb3d29f91cbe7e026eb6 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Fri, 17 Jun 2022 10:36:33 +0530 Subject: [PATCH 19/49] =?UTF-8?q?=F0=9F=9A=A7=20Maintenance:=20Fixed=20ind?= =?UTF-8?q?entation=20and=20reformatted=20code.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vidgear/gears/camgear.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vidgear/gears/camgear.py b/vidgear/gears/camgear.py index e8a137362..7093b32d0 100644 --- a/vidgear/gears/camgear.py +++ b/vidgear/gears/camgear.py @@ -165,7 +165,12 @@ def __extract_streams(self): False if stream.get("acodec", "none") == "none" else True ) # streams must contain video - if stream_with_video and stream_dim and stream_url and stream_protocol != "http_dash_segments": + if ( + stream_with_video + and stream_dim + and stream_url + and stream_protocol != "http_dash_segments" + ): # check if stream resolution is supported if stream_dim in self.supported_resolutions: stream_res = self.supported_resolutions[stream_dim] From 34f60a2c42d4e8c2d85550cf37d2a0b6cc2bc8c0 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Mon, 27 Jun 2022 07:46:03 +0530 Subject: [PATCH 20/49] =?UTF-8?q?=F0=9F=90=9B=20Docs:=20Fixed=20jinja2=20`?= =?UTF-8?q?3.1.0`=20or=20above=20breaks=20mkdocs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit jinja2 >=3.1.0 breaks mkdocs (mkdocs/mkdocs#2799), therefore fixing jinja2 version to <3.1.0. --- .github/workflows/deploy_docs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 3cfee5aee..ec94f3976 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -49,6 +49,7 @@ jobs: run: | pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike pip install mkdocstrings==0.17.0 + pip install jinja2<3.1.0 if: success() - name: git configure run: | @@ -90,6 +91,7 @@ jobs: run: | pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike pip install mkdocstrings==0.17.0 + pip install jinja2<3.1.0 if: success() - name: git configure run: | @@ -134,6 +136,7 @@ jobs: run: | pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike pip install mkdocstrings==0.17.0 + pip install jinja2<3.1.0 if: success() - name: git configure run: | From 6f661c906c93048fa10269d36f1164acc2e17863 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Mon, 27 Jun 2022 08:22:59 +0530 Subject: [PATCH 21/49] =?UTF-8?q?=F0=9F=90=9B=20Docs:=20Fixed=20support=20?= =?UTF-8?q?for=20new=20mkdocstring=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 📝 Replaced rendering sub-value with options. - ♻️ Removed pinned `mkdocstrings==0.17.0` version. - ✨ Added `deduplicate-toc` plugin. --- .github/workflows/deploy_docs.yml | 9 +++------ mkdocs.yml | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index ec94f3976..acd6b1736 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -47,8 +47,7 @@ jobs: if: success() - name: install_dependencies run: | - pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike - pip install mkdocstrings==0.17.0 + pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike mkdocstrings pip install jinja2<3.1.0 if: success() - name: git configure @@ -89,8 +88,7 @@ jobs: if: success() - name: install_dependencies run: | - pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike - pip install mkdocstrings==0.17.0 + pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike mkdocstrings pip install jinja2<3.1.0 if: success() - name: git configure @@ -134,8 +132,7 @@ jobs: if: success() - name: install_dependencies run: | - pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike - pip install mkdocstrings==0.17.0 + pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike mkdocstrings pip install jinja2<3.1.0 if: success() - name: git configure diff --git a/mkdocs.yml b/mkdocs.yml index 4c3ac2469..068011ec1 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -74,10 +74,9 @@ plugins: - minify: minify_html: true - mkdocstrings: - default_handler: python handlers: python: - rendering: + options: show_root_heading: false show_root_toc_entry: false show_source: true @@ -118,6 +117,7 @@ markdown_extensions: - footnotes - md_in_html - meta + - deduplicate-toc - toc: permalink: ⚓ permalink_title: Anchor link to this section for reference From fe8c081554f6edff9d079bc58c402b2237f4769c Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Mon, 27 Jun 2022 12:30:48 +0530 Subject: [PATCH 22/49] =?UTF-8?q?=F0=9F=93=9D=20Docs:=20Updated=20Site=20N?= =?UTF-8?q?avigation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 🚸 Added new notices to inform users more effectively about bonus examples. - ✨ Added new `Bonus` section to navigation and moved suitable pages under it. - 📝 Updated headings and URLs. - ✏️ Fixed typos and updated contexts. - 🔥 Removed unused docs. --- README.md | 2 +- docs/gears/camgear/overview.md | 2 + docs/gears/camgear/usage.md | 7 +- docs/gears/netgear/overview.md | 2 + docs/gears/netgear/usage.md | 11 ++- docs/gears/netgear_async/overview.md | 1 + docs/gears/netgear_async/usage.md | 8 +-- docs/gears/pigear/overview.md | 3 + docs/gears/pigear/usage.md | 11 ++- docs/gears/screengear/overview.md | 3 + docs/gears/screengear/usage.md | 10 +-- docs/gears/stabilizer/overview.md | 2 + docs/gears/stabilizer/usage.md | 9 +-- docs/gears/streamgear/introduction.md | 10 +-- docs/gears/streamgear/rtfm/overview.md | 3 + docs/gears/streamgear/rtfm/usage.md | 2 + docs/gears/streamgear/ssm/overview.md | 3 + docs/gears/streamgear/ssm/usage.md | 3 + docs/gears/videogear/overview.md | 3 + docs/gears/videogear/usage.md | 1 + docs/gears/webgear/advanced.md | 2 + docs/gears/webgear/overview.md | 3 + docs/gears/webgear_rtc/advanced.md | 2 + docs/gears/webgear_rtc/overview.md | 2 + docs/gears/writegear/compression/overview.md | 2 + docs/gears/writegear/compression/usage.md | 9 +-- docs/gears/writegear/introduction.md | 10 +-- .../writegear/non_compression/overview.md | 1 + docs/gears/writegear/non_compression/usage.md | 3 + docs/overrides/assets/stylesheets/custom.css | 2 +- mkdocs.yml | 72 ++++++++++++------- 31 files changed, 118 insertions(+), 86 deletions(-) diff --git a/README.md b/README.md index d64d28069..a7faf527c 100644 --- a/README.md +++ b/README.md @@ -756,7 +756,7 @@ Internal URLs [faq]:https://abhitronix.github.io/vidgear/latest/help/get_help/#frequently-asked-questions [doc-vidgear-purpose]:https://abhitronix.github.io/vidgear/latest/help/motivation/#why-is-vidgear-a-thing -[live-stream]:https://abhitronix.github.io/vidgear/latest/gears/writegear/compression/usage/#using-compression-mode-for-streaming-urls +[live-stream]:https://abhitronix.github.io/vidgear/latest/gears/writegear/compression/usage/#using-compression-mode-for-live-streaming [live-audio-doc]:https://abhitronix.github.io/vidgear/latest/gears/writegear/compression/usage/#using-compression-mode-with-live-audio-input [piping-live-videos]:https://abhitronix.github.io/vidgear/latest/gears/camgear/usage/#using-camgear-with-streaming-websites [ffmpeg-doc]:https://abhitronix.github.io/vidgear/latest/gears/writegear/compression/advanced/ffmpeg_install/ diff --git a/docs/gears/camgear/overview.md b/docs/gears/camgear/overview.md index e10371683..9beec3efd 100644 --- a/docs/gears/camgear/overview.md +++ b/docs/gears/camgear/overview.md @@ -62,6 +62,8 @@ from vidgear.gears import CamGear See here 🚀 +!!! experiment "After going through CamGear Usage Examples, Checkout more of its advanced configurations [here ➶](../../../help/camgear_ex/)" + ## Parameters
diff --git a/docs/gears/camgear/usage.md b/docs/gears/camgear/usage.md index 0780c21ee..3320eb4b3 100644 --- a/docs/gears/camgear/usage.md +++ b/docs/gears/camgear/usage.md @@ -20,6 +20,8 @@ limitations under the License. # CamGear API Usage Examples: +!!! experiment "After going through following Usage Examples, Checkout more of its advanced configurations [here ➶](../../../help/camgear_ex/)" +   ## Bare-Minimum Usage @@ -434,8 +436,3 @@ stream.stop()   -## Bonus Examples - -!!! example "Checkout more advanced CamGear examples with unusual configuration [here ➶](../../../help/camgear_ex/)" - -  \ No newline at end of file diff --git a/docs/gears/netgear/overview.md b/docs/gears/netgear/overview.md index 9c64f5961..68001bc95 100644 --- a/docs/gears/netgear/overview.md +++ b/docs/gears/netgear/overview.md @@ -141,6 +141,8 @@ from vidgear.gears import NetGear See here 🚀
+!!! examples "After going through NetGear Usage Examples, Checkout more bonus examples [here ➶](../../../help/netgear_ex/)" + ## Parameters diff --git a/docs/gears/netgear/usage.md b/docs/gears/netgear/usage.md index 1756208cf..eb05afc1b 100644 --- a/docs/gears/netgear/usage.md +++ b/docs/gears/netgear/usage.md @@ -29,6 +29,9 @@ limitations under the License. * Only either of two functions (i.e. `send()` and `recv()`) can be accessed at any given instance based on activated [primary mode](../overview/#primary-modes) selected during NetGear API initialization. Trying to access wrong function in incorrect mode (_for e.g using `send()` function in Receive Mode_), will result in `ValueError`. +!!! examples "After going through following Usage Examples, Checkout more bonus examples [here ➶](../../../help/netgear_ex/)" + +   @@ -471,10 +474,4 @@ stream.stop() server.close() ``` -  - -## Bonus Examples - -!!! example "Checkout more advanced NetGear examples with unusual configuration [here ➶](../../../help/netgear_ex/)" - -  \ No newline at end of file +  \ No newline at end of file diff --git a/docs/gears/netgear_async/overview.md b/docs/gears/netgear_async/overview.md index fc2e505cf..804e5e59f 100644 --- a/docs/gears/netgear_async/overview.md +++ b/docs/gears/netgear_async/overview.md @@ -73,6 +73,7 @@ from vidgear.gears.asyncio import NetGear_Async See here 🚀 +!!! examples "After going through NetGear_Async Usage Examples, Checkout more bonus examples [here ➶](../../../help/netgear_async_ex/)" ## Parameters diff --git a/docs/gears/netgear_async/usage.md b/docs/gears/netgear_async/usage.md index fba5ce319..4a3c571d4 100644 --- a/docs/gears/netgear_async/usage.md +++ b/docs/gears/netgear_async/usage.md @@ -27,6 +27,8 @@ limitations under the License. * It is advised to comprehend [NetGear API](../../netgear/overview/) before using this API. +!!! examples "After going through following Usage Examples, Checkout more bonus examples [here ➶](../../../help/netgear_async_ex/)" + ## Requirement @@ -430,9 +432,3 @@ if __name__ == "__main__": ```   - -## Bonus Examples - -!!! example "Checkout more advanced NetGear_Async examples with unusual configuration [here ➶](../../../help/netgear_async_ex/)" - -  \ No newline at end of file diff --git a/docs/gears/pigear/overview.md b/docs/gears/pigear/overview.md index 3d91a083e..0c40f979a 100644 --- a/docs/gears/pigear/overview.md +++ b/docs/gears/pigear/overview.md @@ -60,6 +60,9 @@ from vidgear.gears import PiGear See here 🚀 +!!! experiment "After going through PiGear Usage Examples, Checkout more of its advanced configurations [here ➶](../../../help/pigear_ex/)" + + ## Parameters diff --git a/docs/gears/pigear/usage.md b/docs/gears/pigear/usage.md index 9b0d7731a..2eb67e987 100644 --- a/docs/gears/pigear/usage.md +++ b/docs/gears/pigear/usage.md @@ -23,6 +23,9 @@ limitations under the License. !!! warning "Make sure to [enable Raspberry Pi hardware-specific settings](https://picamera.readthedocs.io/en/release-1.13/quickstart.html) prior using this API, otherwise nothing will work." +!!! experiment "After going through following Usage Examples, Checkout more of its advanced configurations [here ➶](../../../help/pigear_ex/)" + +   @@ -270,10 +273,4 @@ stream.stop() writer.close() ``` -  - -## Bonus Examples - -!!! example "Checkout more advanced PiGear examples with unusual configuration [here ➶](../../../help/pigear_ex/)" - -  \ No newline at end of file +  \ No newline at end of file diff --git a/docs/gears/screengear/overview.md b/docs/gears/screengear/overview.md index d2d37ef35..05ac26f5f 100644 --- a/docs/gears/screengear/overview.md +++ b/docs/gears/screengear/overview.md @@ -59,6 +59,9 @@ from vidgear.gears import ScreenGear See here 🚀 +!!! experiment "After going through ScreenGear Usage Examples, Checkout more of its advanced configurations [here ➶](../../../help/screengear_ex/)" + + ## Parameters diff --git a/docs/gears/screengear/usage.md b/docs/gears/screengear/usage.md index 71375d6b7..e52dc1ad9 100644 --- a/docs/gears/screengear/usage.md +++ b/docs/gears/screengear/usage.md @@ -20,6 +20,8 @@ limitations under the License. # ScreenGear API Usage Examples: +!!! experiment "After going through ScreenGear Usage Examples, Checkout more of its advanced configurations [here ➶](../../../help/screengear_ex/)" +   ## Bare-Minimum Usage @@ -334,10 +336,4 @@ stream.stop() writer.close() ``` -  - -## Bonus Examples - -!!! example "Checkout more advanced NetGear examples with unusual configuration [here ➶](../../../help/screengear_ex/)" - -  \ No newline at end of file +  \ No newline at end of file diff --git a/docs/gears/stabilizer/overview.md b/docs/gears/stabilizer/overview.md index 7d6af0d99..e90cf060a 100644 --- a/docs/gears/stabilizer/overview.md +++ b/docs/gears/stabilizer/overview.md @@ -83,6 +83,8 @@ from vidgear.gears.stabilizer import Stabilizer See here 🚀 +!!! experiment "After going through Stabilizer Class Usage Examples, Checkout more of its advanced configurations [here ➶](../../../help/stabilizer_ex/)" + ## Parameters diff --git a/docs/gears/stabilizer/usage.md b/docs/gears/stabilizer/usage.md index 3862ffb34..00e7b7389 100644 --- a/docs/gears/stabilizer/usage.md +++ b/docs/gears/stabilizer/usage.md @@ -28,6 +28,9 @@ limitations under the License. !!! tip "It is advised to enable logging on the first run for easily identifying any runtime errors." +!!! experiment "After going through Stabilizer Class Usage Examples, Checkout more of its advanced configurations [here ➶](../../../help/stabilizer_ex/)" + +     @@ -273,10 +276,4 @@ writer.close() !!! example "The complete usage example can be found [here ➶](../../videogear/usage/#using-videogear-with-video-stabilizer-backend)" -  - -## Bonus Examples - -!!! example "Checkout more advanced Stabilizer examples with unusual configuration [here ➶](../../../help/stabilizer_ex/)" -   \ No newline at end of file diff --git a/docs/gears/streamgear/introduction.md b/docs/gears/streamgear/introduction.md index e2e1c1a0d..21ebdbcf0 100644 --- a/docs/gears/streamgear/introduction.md +++ b/docs/gears/streamgear/introduction.md @@ -72,7 +72,7 @@ StreamGear primarily operates in following independent modes for transcoding: ??? warning "Real-time Frames Mode is NOT Live-Streaming." - Rather, you can enable live-streaming in Real-time Frames Mode by using using exclusive [`-livestream`](../params/#a-exclusive-parameters) attribute of `stream_params` dictionary parameter in StreamGear API. Checkout [this usage example](../rtfm/usage/#bare-minimum-usage-with-live-streaming) for more information. + Rather, you can enable live-streaming in Real-time Frames Mode by using the exclusive [`-livestream`](../params/#a-exclusive-parameters) attribute of `stream_params` dictionary parameter in StreamGear API. Checkout [this usage example](../rtfm/usage/#bare-minimum-usage-with-live-streaming) for more information. - [**Single-Source Mode**](../ssm/overview): In this mode, StreamGear **transcodes entire video file** _(as opposed to frame-by-frame)_ into a sequence of multiple smaller chunks/segments for streaming. This mode works exceptionally well when you're transcoding long-duration lossless videos(with audio) for streaming that required no interruptions. But on the downside, the provided source cannot be flexibly manipulated or transformed before sending onto FFmpeg Pipeline for processing. @@ -170,10 +170,4 @@ from vidgear.gears import StreamGear See here 🚀 -  - -## Bonus Examples - -!!! example "Checkout more advanced StreamGear examples with unusual configuration [here ➶](../../../help/streamgear_ex/)" - -  \ No newline at end of file +  \ No newline at end of file diff --git a/docs/gears/streamgear/rtfm/overview.md b/docs/gears/streamgear/rtfm/overview.md index 7ac4292a7..1f892d594 100644 --- a/docs/gears/streamgear/rtfm/overview.md +++ b/docs/gears/streamgear/rtfm/overview.md @@ -68,6 +68,9 @@ For this mode, StreamGear API provides exclusive [`stream()`](../../../../bonus/ See here 🚀 +!!! experiment "After going through StreamGear Usage Examples, Checkout more of its advanced configurations [here ➶](../../../help/streamgear_ex/)" + + ## Parameters
diff --git a/docs/gears/streamgear/rtfm/usage.md b/docs/gears/streamgear/rtfm/usage.md index dfaa972c9..e3d2aec09 100644 --- a/docs/gears/streamgear/rtfm/usage.md +++ b/docs/gears/streamgear/rtfm/usage.md @@ -35,6 +35,8 @@ limitations under the License. * Always use `terminate()` function at the very end of the main code. +!!! experiment "After going through following Usage Examples, Checkout more of its advanced configurations [here ➶](../../../help/streamgear_ex/)" +   diff --git a/docs/gears/streamgear/ssm/overview.md b/docs/gears/streamgear/ssm/overview.md index 6ab8a3413..0fb479499 100644 --- a/docs/gears/streamgear/ssm/overview.md +++ b/docs/gears/streamgear/ssm/overview.md @@ -58,6 +58,9 @@ This mode can be easily activated by assigning suitable video path as input to [ See here 🚀
+!!! experiment "After going through StreamGear Usage Examples, Checkout more of its advanced configurations [here ➶](../../../help/streamgear_ex/)" + + ## Parameters
diff --git a/docs/gears/streamgear/ssm/usage.md b/docs/gears/streamgear/ssm/usage.md index 156d3fa10..d4354824e 100644 --- a/docs/gears/streamgear/ssm/usage.md +++ b/docs/gears/streamgear/ssm/usage.md @@ -31,6 +31,9 @@ limitations under the License. * Always use `terminate()` function at the very end of the main code. +!!! experiment "After going through following Usage Examples, Checkout more of its advanced configurations [here ➶](../../../help/streamgear_ex/)" + +   ## Bare-Minimum Usage diff --git a/docs/gears/videogear/overview.md b/docs/gears/videogear/overview.md index b13be384a..b37518dd9 100644 --- a/docs/gears/videogear/overview.md +++ b/docs/gears/videogear/overview.md @@ -59,6 +59,9 @@ from vidgear.gears import VideoGear See here 🚀
+!!! experiment "After going through VideoGear Usage Examples, Checkout more of its advanced configurations [here ➶](../../../help/videogear_ex/)" + + ## Parameters
diff --git a/docs/gears/videogear/usage.md b/docs/gears/videogear/usage.md index bff0a6751..17eb8a345 100644 --- a/docs/gears/videogear/usage.md +++ b/docs/gears/videogear/usage.md @@ -20,6 +20,7 @@ limitations under the License. # VideoGear API Usage Examples: +!!! experiment "After going through following Usage Examples, Checkout more of its advanced configurations [here ➶](../../../help/videogear_ex/)"   diff --git a/docs/gears/webgear/advanced.md b/docs/gears/webgear/advanced.md index 3b7a880c6..55bc4ff02 100644 --- a/docs/gears/webgear/advanced.md +++ b/docs/gears/webgear/advanced.md @@ -22,6 +22,8 @@ limitations under the License. !!! note "This is a continuation of the [WebGear doc ➶](../overview/#webgear-api). Thereby, It's advised to first get familiarize with this API, and its [requirements](../usage/#requirements)." +!!! examples "After going through following Usage Examples, Checkout more bonus examples [here ➶](../../../help/webgear_ex/)" +   diff --git a/docs/gears/webgear/overview.md b/docs/gears/webgear/overview.md index 5e77dfad8..7f2766e86 100644 --- a/docs/gears/webgear/overview.md +++ b/docs/gears/webgear/overview.md @@ -149,6 +149,9 @@ The WebGear API by default uses simple & elegant [**WebGear's Default Theme**](h See here 🚀
+!!! examples "After going through WebGear Usage Examples, Checkout more bonus examples [here ➶](../../../help/webgear_ex/)" + + ## Parameters
diff --git a/docs/gears/webgear_rtc/advanced.md b/docs/gears/webgear_rtc/advanced.md index 175c0b676..04b06729d 100644 --- a/docs/gears/webgear_rtc/advanced.md +++ b/docs/gears/webgear_rtc/advanced.md @@ -23,6 +23,8 @@ limitations under the License. !!! note "This is a continuation of the [WebGear_RTC doc ➶](../overview/#webgear_rtc-api). Thereby, It's advised to first get familiarize with this API, and its [requirements](../usage/#requirements)." +!!! examples "After going through following Usage Examples, Checkout more bonus examples [here ➶](../../../help/webgear_rtc_ex/)" +   diff --git a/docs/gears/webgear_rtc/overview.md b/docs/gears/webgear_rtc/overview.md index 3e99d1b30..78b5a364d 100644 --- a/docs/gears/webgear_rtc/overview.md +++ b/docs/gears/webgear_rtc/overview.md @@ -151,6 +151,8 @@ The WebGear_RTC API by default uses simple & elegant [**WebGear_RTC's Default Th See here 🚀
+!!! examples "After going through WebGear_RTC Usage Examples, Checkout more bonus examples [here ➶](../../../help/webgear_rtc_ex/)" + ## Parameters
diff --git a/docs/gears/writegear/compression/overview.md b/docs/gears/writegear/compression/overview.md index e2bee57ef..11d9c7cd3 100644 --- a/docs/gears/writegear/compression/overview.md +++ b/docs/gears/writegear/compression/overview.md @@ -67,6 +67,8 @@ This function opens endless possibilities of exploiting any FFmpeg supported par See here 🚀
+!!! examples "After going through WriteGear Usage Examples, Checkout more bonus examples [here ➶](../../../help/writegear_ex/)" + ## Parameters diff --git a/docs/gears/writegear/compression/usage.md b/docs/gears/writegear/compression/usage.md index 88304272c..0132f479d 100644 --- a/docs/gears/writegear/compression/usage.md +++ b/docs/gears/writegear/compression/usage.md @@ -38,6 +38,7 @@ limitations under the License. * Always use `writer.close()` at the very end of the main code. **NEVER USE IT INBETWEEN CODE** to avoid undesired behavior. +!!! examples "After going through WriteGear Usage Examples, Checkout more bonus examples [here ➶](../../../help/writegear_ex/)"   @@ -218,13 +219,13 @@ writer.close()   -## Using Compression Mode for Streaming URLs +## Using Compression Mode for live streaming -In Compression Mode, WriteGear also allows URL strings _(as output)_ for network streaming with its [`output_filename`](../params/#output_filename) parameter. +In Compression Mode, WriteGear also allows URL strings _(as output)_ for live streaming realtime frames with its [`output_filename`](../params/#output_filename) parameter. -In this example, we will stream live camera feed directly to Twitch :fontawesome-brands-twitch:: +In this example, we will stream live camera frames directly to Twitch :fontawesome-brands-twitch:: -!!! info ":fontawesome-brands-youtube: YouTube-Live Streaming example code also available in [WriteGear's Bonus Examples ➶](../../../../help/writegear_ex/#using-writegears-compression-mode-for-youtube-live-streaming)" +!!! example ":fontawesome-brands-youtube: YouTube-Live Streaming example code also available in [WriteGear's Bonus Examples ➶](../../../../help/writegear_ex/#using-writegears-compression-mode-for-youtube-live-streaming)" !!! warning "This example assume you already have a [**Twitch Account**](https://www.twitch.tv/) for publishing video." diff --git a/docs/gears/writegear/introduction.md b/docs/gears/writegear/introduction.md index e3d15263d..68f0e6226 100644 --- a/docs/gears/writegear/introduction.md +++ b/docs/gears/writegear/introduction.md @@ -31,7 +31,7 @@ limitations under the License. WriteGear API provides a complete, flexible, and robust wrapper around [**FFmpeg**](https://ffmpeg.org/), a leading multimedia framework. WriteGear can process real-time frames into a lossless compressed video-file with any suitable specifications _(such as`bitrate, codec, framerate, resolution, subtitles, etc.`)_. -WriteGear also supports streaming with traditional protocols such as RTMP, RTSP/RTP. It is powerful enough to perform complex tasks such as [Live-Streaming](../compression/usage/#using-compression-mode-for-streaming-urls) _(such as for Twitch, YouTube etc.)_ and [Multiplexing Video-Audio](../compression/usage/#using-compression-mode-with-live-audio-input) with real-time frames in just few lines of code. +WriteGear also supports streaming with traditional protocols such as RTMP, RTSP/RTP. It is powerful enough to perform complex tasks such as [Live-Streaming](../compression/usage/#using-compression-mode-for-live-streaming) _(such as for Twitch, YouTube etc.)_ and [Multiplexing Video-Audio](../compression/usage/#using-compression-mode-with-live-audio-input) with real-time frames in just few lines of code. Best of all, WriteGear grants users the complete freedom to play with any FFmpeg parameter with its exclusive ==Custom Commands function== _(see this [doc](../compression/advanced/cciw/))_ without relying on any third-party API. @@ -75,10 +75,4 @@ from vidgear.gears import WriteGear See here 🚀 -  - -## Bonus Examples - -!!! example "Checkout more advanced WriteGear examples with unusual configuration [here ➶](../../../help/writegear_ex/)" - -  \ No newline at end of file +  \ No newline at end of file diff --git a/docs/gears/writegear/non_compression/overview.md b/docs/gears/writegear/non_compression/overview.md index 5c3b6ed1f..938a4d8c1 100644 --- a/docs/gears/writegear/non_compression/overview.md +++ b/docs/gears/writegear/non_compression/overview.md @@ -51,6 +51,7 @@ This mode provides flexible access to [**OpenCV's VideoWriter API**](https://doc See here 🚀 +!!! examples "After going through WriteGear Usage Examples, Checkout more bonus examples [here ➶](../../../help/writegear_ex/)" ## Parameters diff --git a/docs/gears/writegear/non_compression/usage.md b/docs/gears/writegear/non_compression/usage.md index b14469575..a46cda61b 100644 --- a/docs/gears/writegear/non_compression/usage.md +++ b/docs/gears/writegear/non_compression/usage.md @@ -30,6 +30,9 @@ limitations under the License. * Always use `writer.close()` at the very end of the main code. **NEVER USE IT INBETWEEN CODE** to avoid undesired behavior. +!!! examples "After going through WriteGear Usage Examples, Checkout more bonus examples [here ➶](../../../help/writegear_ex/)" + +   diff --git a/docs/overrides/assets/stylesheets/custom.css b/docs/overrides/assets/stylesheets/custom.css index d8f8ba882..ab890144a 100755 --- a/docs/overrides/assets/stylesheets/custom.css +++ b/docs/overrides/assets/stylesheets/custom.css @@ -33,7 +33,7 @@ limitations under the License. --md-admonition-icon--xabstract: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23000000' d='M3,3H21V5H3V3M3,7H15V9H3V7M3,11H21V13H3V11M3,15H15V17H3V15M3,19H21V21H3V19Z' /%3E%3C/svg%3E"); --md-admonition-icon--xnote: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23000000' d='M20.71,7.04C20.37,7.38 20.04,7.71 20.03,8.04C20,8.36 20.34,8.69 20.66,9C21.14,9.5 21.61,9.95 21.59,10.44C21.57,10.93 21.06,11.44 20.55,11.94L16.42,16.08L15,14.66L19.25,10.42L18.29,9.46L16.87,10.87L13.12,7.12L16.96,3.29C17.35,2.9 18,2.9 18.37,3.29L20.71,5.63C21.1,6 21.1,6.65 20.71,7.04M3,17.25L12.56,7.68L16.31,11.43L6.75,21H3V17.25Z' /%3E%3C/svg%3E"); --md-admonition-icon--xinfo: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23000000' d='M18 2H12V9L9.5 7.5L7 9V2H6C4.9 2 4 2.9 4 4V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V4C20 2.89 19.1 2 18 2M17.68 18.41C17.57 18.5 16.47 19.25 16.05 19.5C15.63 19.79 14 20.72 14.26 18.92C14.89 15.28 16.11 13.12 14.65 14.06C14.27 14.29 14.05 14.43 13.91 14.5C13.78 14.61 13.79 14.6 13.68 14.41S13.53 14.23 13.67 14.13C13.67 14.13 15.9 12.34 16.72 12.28C17.5 12.21 17.31 13.17 17.24 13.61C16.78 15.46 15.94 18.15 16.07 18.54C16.18 18.93 17 18.31 17.44 18C17.44 18 17.5 17.93 17.61 18.05C17.72 18.22 17.83 18.3 17.68 18.41M16.97 11.06C16.4 11.06 15.94 10.6 15.94 10.03C15.94 9.46 16.4 9 16.97 9C17.54 9 18 9.46 18 10.03C18 10.6 17.54 11.06 16.97 11.06Z' /%3E%3C/svg%3E"); - --md-admonition-icon--xadvance: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M7,2V4H8V18A4,4 0 0,0 12,22A4,4 0 0,0 16,18V4H17V2H7M11,16C10.4,16 10,15.6 10,15C10,14.4 10.4,14 11,14C11.6,14 12,14.4 12,15C12,15.6 11.6,16 11,16M13,12C12.4,12 12,11.6 12,11C12,10.4 12.4,10 13,10C13.6,10 14,10.4 14,11C14,11.6 13.6,12 13,12M14,7H10V4H14V7Z' /%3E%3C/svg%3E"); + --md-admonition-icon--xadvance: url("data:image/svg+xml,%3C%3Fxml version='1.0' standalone='no'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 20010904//EN' 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'%3E%3Csvg version='1.0' xmlns='http://www.w3.org/2000/svg' width='512.000000pt' height='512.000000pt' viewBox='0 0 512.000000 512.000000' preserveAspectRatio='xMidYMid meet'%3E%3Cg transform='translate(0.000000,512.000000) scale(0.100000,-0.100000)'%0Afill='%23000000' stroke='none'%3E%3Cpath d='M2372 5103 c-39 -19 -70 -59 -78 -102 -12 -57 4 -98 63 -162 l57 -60%0A-280 -278 -279 -278 -774 -329 c-426 -181 -797 -342 -824 -359 -57 -34 -111%0A-105 -128 -168 -17 -62 -7 -173 20 -227 16 -32 215 -237 679 -702 590 -590%0A663 -660 717 -684 144 -66 328 -6 396 129 12 22 167 391 345 821 l324 781 274%0A274 275 275 60 -57 c41 -37 73 -58 96 -63 130 -24 225 99 166 214 -24 46 -934%0A954 -978 976 -41 20 -89 20 -131 -1z m421 -701 l157 -157 -263 -263 -262 -262%0A-488 2 -488 3 293 124 293 124 295 293 c162 162 297 294 300 294 3 0 76 -71%0A163 -158z m-545 -999 c-3 -10 -132 -325 -288 -701 l-284 -683 -628 628 c-345%0A345 -628 631 -628 634 0 3 69 35 153 72 l152 66 764 0 c722 1 763 0 759 -16z'/%3E%3Cpath d='M3742 4560 c-42 -26 -76 -99 -68 -144 13 -68 65 -121 126 -126 62 -5%0A82 1 123 39 41 39 42 41 42 106 0 65 -1 67 -42 106 -38 35 -47 39 -95 39 -36%0A0 -64 -7 -86 -20z'/%3E%3Cpath d='M3980 3922 c-104 -57 -108 -201 -8 -262 95 -58 222 17 222 130 0 110%0A-120 184 -214 132z'/%3E%3Cpath d='M3052 3270 c-99 -61 -95 -203 8 -257 34 -18 59 -23 117 -23 l73 0 0%0A-419 0 -419 -57 -27 c-275 -135 -509 -401 -617 -703 -87 -243 -91 -546 -10%0A-799 33 -105 104 -246 170 -339 61 -87 217 -244 266 -267 33 -16 94 -17 753%0A-17 658 0 720 1 753 17 51 24 206 182 269 273 151 221 223 454 223 719 0 261%0A-68 485 -213 701 -102 152 -281 313 -448 403 l-79 42 0 418 0 417 62 0 c81 0%0A137 27 166 79 40 70 20 154 -47 198 l-34 23 -661 0 c-642 0 -662 -1 -694 -20z%0Am908 -763 c0 -600 -16 -546 182 -636 201 -91 332 -212 443 -407 25 -43 45 -82%0A45 -86 0 -5 -394 -8 -875 -8 -481 0 -875 2 -875 5 0 3 12 29 26 58 97 191 249%0A338 446 432 53 25 100 45 105 45 20 0 75 70 84 106 4 22 9 249 9 507 l0 467%0A205 0 205 0 0 -483z m737 -1554 c-10 -227 -95 -428 -251 -591 l-59 -62 -632 0%0A-632 0 -60 63 c-156 162 -240 359 -250 585 l-6 122 948 0 948 0 -6 -117z'/%3E%3C/g%3E%3C/svg%3E%0A"); } .md-typeset .admonition.advance, diff --git a/mkdocs.yml b/mkdocs.yml index 068011ec1..3b5db4309 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -174,29 +174,36 @@ nav: - CamGear: - Overview: gears/camgear/overview.md - Usage Examples: gears/camgear/usage.md - - Advanced: - - Source Tweak Parameters: gears/camgear/advanced/source_params.md - Parameters: gears/camgear/params.md - - References: bonus/reference/camgear.md - - FAQs: help/camgear_faqs.md + - Bonus: + - Source Tweak Parameters: gears/camgear/advanced/source_params.md + - API References: bonus/reference/camgear.md + - Bonus Examples: help/camgear_ex.md + - FAQs: help/camgear_faqs.md - PiGear: - Overview: gears/pigear/overview.md - Usage Examples: gears/pigear/usage.md - Parameters: gears/pigear/params.md - - References: bonus/reference/pigear.md - - FAQs: help/pigear_faqs.md + - Bonus: + - API References: bonus/reference/pigear.md + - Bonus Examples: help/pigear_ex.md + - FAQs: help/pigear_faqs.md - VideoGear: - Overview: gears/videogear/overview.md - Usage Examples: gears/videogear/usage.md - Parameters: gears/videogear/params.md - - References: bonus/reference/videogear.md - - FAQs: help/videogear_faqs.md + - Bonus: + - API References: bonus/reference/videogear.md + - Bonus Examples: help/videogear_ex.md + - FAQs: help/videogear_faqs.md - ScreenGear: - Overview: gears/screengear/overview.md - Usage Examples: gears/screengear/usage.md - Parameters: gears/screengear/params.md - - References: bonus/reference/screengear.md - - FAQs: help/screengear_faqs.md + - Bonus: + - API References: bonus/reference/screengear.md + - Bonus Examples: help/screengear_ex.md + - FAQs: help/screengear_faqs.md - WriteGear: - Introduction: gears/writegear/introduction.md - Compression Mode: @@ -210,8 +217,10 @@ nav: - Overview: gears/writegear/non_compression/overview.md - Usage Examples: gears/writegear/non_compression/usage.md - Parameters: gears/writegear/non_compression/params.md - - References: bonus/reference/writegear.md - - FAQs: help/writegear_faqs.md + - Bonus: + - API References: bonus/reference/writegear.md + - Bonus Examples: help/writegear_ex.md + - FAQs: help/writegear_faqs.md - StreamGear: - Introduction: gears/streamgear/introduction.md - Single-Source Mode: @@ -220,11 +229,12 @@ nav: - Real-time Frames Mode: - Overview: gears/streamgear/rtfm/overview.md - Usage Examples: gears/streamgear/rtfm/usage.md + - Parameters: gears/streamgear/params.md - Bonus: + - API References: bonus/reference/streamgear.md - FFmpeg Installation: gears/streamgear/ffmpeg_install.md - - Parameters: gears/streamgear/params.md - - References: bonus/reference/streamgear.md - - FAQs: help/streamgear_faqs.md + - Bonus Examples: help/streamgear_ex.md + - FAQs: help/streamgear_faqs.md - NetGear: - Overview: gears/netgear/overview.md - Usage Examples: gears/netgear/usage.md @@ -234,38 +244,48 @@ nav: - Bidirectional Mode: gears/netgear/advanced/bidirectional_mode.md - SSH Tunneling Mode: gears/netgear/advanced/ssh_tunnel.md - Secure Mode: gears/netgear/advanced/secure_mode.md - - Frame Compression: gears/netgear/advanced/compression.md + - Frame Compression: gears/netgear/advanced/compression.md - Parameters: gears/netgear/params.md - - References: bonus/reference/netgear.md - - FAQs: help/netgear_faqs.md + - Bonus: + - API References: bonus/reference/netgear.md + - Bonus Examples: help/netgear_ex.md + - FAQs: help/netgear_faqs.md - WebGear: - Overview: gears/webgear/overview.md - Usage Examples: gears/webgear/usage.md - Advanced Usages: gears/webgear/advanced.md - Parameters: gears/webgear/params.md - - References: bonus/reference/webgear.md - - FAQs: help/webgear_faqs.md + - Bonus: + - API References: bonus/reference/webgear.md + - Bonus Examples: help/webgear_ex.md + - FAQs: help/webgear_faqs.md - WebGear_RTC: - Overview: gears/webgear_rtc/overview.md - Usage Examples: gears/webgear_rtc/usage.md - Advanced Usages: gears/webgear_rtc/advanced.md - Parameters: gears/webgear_rtc/params.md - - References: bonus/reference/webgear_rtc.md - - FAQs: help/webgear_rtc_faqs.md + - Bonus: + - API References: bonus/reference/webgear_rtc.md + - Bonus Examples: help/webgear_rtc_ex.md + - FAQs: help/webgear_rtc_faqs.md - NetGear_Async: - Overview: gears/netgear_async/overview.md - Usage Examples: gears/netgear_async/usage.md - Advanced Usages: - Bidirectional Mode: gears/netgear_async/advanced/bidirectional_mode.md - Parameters: gears/netgear_async/params.md - - References: bonus/reference/netgear_async.md - - FAQs: help/netgear_async_faqs.md + - Bonus: + - API References: bonus/reference/netgear_async.md + - Bonus Examples: help/netgear_async_ex.md + - FAQs: help/netgear_async_faqs.md - Stabilizer Class: - Overview: gears/stabilizer/overview.md - Usage Examples: gears/stabilizer/usage.md - Parameters: gears/stabilizer/params.md - - References: bonus/reference/stabilizer.md - - FAQs: help/stabilizer_faqs.md + - Bonus: + - API References: bonus/reference/stabilizer.md + - Bonus Examples: help/stabilizer_ex.md + - FAQs: help/stabilizer_faqs.md - References: - API References: - vidgear.gears: From e8d783ada94a1c47837973d2c66c5f9a7777b80c Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Mon, 27 Jun 2022 12:52:02 +0530 Subject: [PATCH 23/49] =?UTF-8?q?=F0=9F=90=9B=20CI:=20Fixed=20pinned=20ver?= =?UTF-8?q?sion=20bug=20in=20Docs=5FDeployer=20Workflow.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy_docs.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index acd6b1736..4326fa476 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -48,7 +48,7 @@ jobs: - name: install_dependencies run: | pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike mkdocstrings - pip install jinja2<3.1.0 + pip install jinja2==3.0.* if: success() - name: git configure run: | @@ -89,7 +89,7 @@ jobs: - name: install_dependencies run: | pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike mkdocstrings - pip install jinja2<3.1.0 + pip install jinja2==3.0.* if: success() - name: git configure run: | @@ -133,7 +133,7 @@ jobs: - name: install_dependencies run: | pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike mkdocstrings - pip install jinja2<3.1.0 + pip install jinja2==3.0.* if: success() - name: git configure run: | From 11dedd69e704d11e39a3542c848464295e1d41bd Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Mon, 27 Jun 2022 12:56:11 +0530 Subject: [PATCH 24/49] =?UTF-8?q?=F0=9F=90=9B=20Docs:=20Removed=20unused?= =?UTF-8?q?=20plugin=20from=20mkdocs.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mkdocs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index 3b5db4309..0d8b8f45b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -117,7 +117,6 @@ markdown_extensions: - footnotes - md_in_html - meta - - deduplicate-toc - toc: permalink: ⚓ permalink_title: Anchor link to this section for reference From 6991bb811a0b2a755e7be6b3ef655dd1deb642db Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Mon, 27 Jun 2022 13:02:02 +0530 Subject: [PATCH 25/49] =?UTF-8?q?=F0=9F=91=B7=20CI:=20Added=20missing=20de?= =?UTF-8?q?pendency.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy_docs.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 4326fa476..1cbb62b61 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -47,7 +47,7 @@ jobs: if: success() - name: install_dependencies run: | - pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike mkdocstrings + pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike mkdocstrings mkdocstrings-python-legacy pip install jinja2==3.0.* if: success() - name: git configure @@ -88,7 +88,7 @@ jobs: if: success() - name: install_dependencies run: | - pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike mkdocstrings + pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike mkdocstrings mkdocstrings-python-legacy pip install jinja2==3.0.* if: success() - name: git configure @@ -132,7 +132,7 @@ jobs: if: success() - name: install_dependencies run: | - pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike mkdocstrings + pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike mkdocstrings mkdocstrings-python-legacy pip install jinja2==3.0.* if: success() - name: git configure From c8ed093fea8e0a6294bb50faa5112043209e7e78 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Mon, 27 Jun 2022 18:55:22 +0530 Subject: [PATCH 26/49] =?UTF-8?q?=F0=9F=97=91=EF=B8=8F=20Docs:=20Commented?= =?UTF-8?q?=20out=20announcement=20block.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/overrides/main.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/overrides/main.html b/docs/overrides/main.html index ede637a4f..7b8d48ce6 100644 --- a/docs/overrides/main.html +++ b/docs/overrides/main.html @@ -22,10 +22,11 @@ {% endblock %} + {% include ".icons/material/alert-decagram.svg" %} Python-3.6 legacies support has been dropped in v0.2.5. {% endblock %} +--> {% block outdated %} You're not viewing the latest version. From 064dfdf315924b12b94d86bc288cba9085d9d246 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Mon, 27 Jun 2022 19:09:27 +0530 Subject: [PATCH 27/49] =?UTF-8?q?=F0=9F=91=B7=20CI:=20Added=20more=20paths?= =?UTF-8?q?=20and=20files=20to=20skip=20commits.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci_linux.yml | 4 +++- appveyor.yml | 4 +++- azure-pipelines.yml | 6 ++++-- codecov.yml | 6 ++++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci_linux.yml b/.github/workflows/ci_linux.yml index 4db597619..64ffe804a 100644 --- a/.github/workflows/ci_linux.yml +++ b/.github/workflows/ci_linux.yml @@ -20,7 +20,9 @@ on: - testing paths-ignore: - '**/*.md' - - 'docs/**' + - '**/*.html' + - dir/**/* + - mkdocs.yml pull_request: branches: - testing diff --git a/appveyor.yml b/appveyor.yml index 0d93c023f..75666d5ae 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -46,7 +46,9 @@ branches: skip_commits: files: - '**/*.md' - - docs/* + - '**/*.html' + - dir/**/* + - mkdocs.yml matrix: fast_finish: true diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2769cfa9e..193d958e2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -19,8 +19,10 @@ trigger: - testing paths: exclude: - - docs - - README.md + - dir/**/* + - mkdocs.yml + - '**/*.md' + - '**/*.html' pr: - testing diff --git a/codecov.yml b/codecov.yml index 12a628887..0be02ec86 100644 --- a/codecov.yml +++ b/codecov.yml @@ -28,9 +28,11 @@ coverage: ignore: - "vidgear/tests" - - "docs" + - "dir/**/*" - "scripts" - "vidgear/gears/__init__.py" #trivial - "vidgear/gears/asyncio/__main__.py" #trivial - "setup.py" - - "**/*.md" \ No newline at end of file + - "**/*.md" + - "**/*.html" + - "mkdocs.yml" \ No newline at end of file From d1b1fba5d71ffb8c7b1342fab7d137b43297ebe2 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Mon, 27 Jun 2022 20:13:14 +0530 Subject: [PATCH 28/49] =?UTF-8?q?=F0=9F=93=9D=20Docs:=20Added=20new=20exam?= =?UTF-8?q?ple=20for=20RSTP/RTP=20Live-Streaming.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ✨ Added new bonus example for RSTP/RTP Live-Streaming using WriteGear's Compression Mode. - ✏️ Fixed typos in admonitions. --- docs/gears.md | 2 +- docs/gears/netgear/overview.md | 2 +- docs/gears/netgear/usage.md | 2 +- docs/gears/netgear_async/overview.md | 2 +- docs/gears/netgear_async/usage.md | 2 +- docs/gears/webgear/advanced.md | 2 +- docs/gears/webgear/overview.md | 2 +- docs/gears/webgear_rtc/advanced.md | 2 +- docs/gears/webgear_rtc/overview.md | 2 +- docs/gears/writegear/compression/overview.md | 2 +- docs/gears/writegear/compression/usage.md | 4 +- .../writegear/non_compression/overview.md | 4 +- docs/gears/writegear/non_compression/usage.md | 2 +- docs/help/writegear_ex.md | 61 ++++++++++++++++++- 14 files changed, 75 insertions(+), 16 deletions(-) diff --git a/docs/gears.md b/docs/gears.md index 5b1514911..963b4bbae 100644 --- a/docs/gears.md +++ b/docs/gears.md @@ -54,7 +54,7 @@ These Gears can be classified as follows: > **Basic Function:** Transcodes/Broadcasts files and [`numpy.ndarray`](https://numpy.org/doc/1.18/reference/generated/numpy.ndarray.html#numpy-ndarray) frames for streaming. -!!! tip "You can also use [WriteGear](writegear/introduction/) for streaming with traditional protocols such as RTMP, RTSP/RTP." +!!! tip "You can also use [WriteGear](writegear/introduction/) for :material-video-wireless: streaming with traditional protocols such as RTMP, RTSP/RTP." * [StreamGear](streamgear/introduction/): Handles Transcoding of High-Quality, Dynamic & Adaptive Streaming Formats. diff --git a/docs/gears/netgear/overview.md b/docs/gears/netgear/overview.md index 68001bc95..82c3dafe3 100644 --- a/docs/gears/netgear/overview.md +++ b/docs/gears/netgear/overview.md @@ -141,7 +141,7 @@ from vidgear.gears import NetGear See here 🚀 -!!! examples "After going through NetGear Usage Examples, Checkout more bonus examples [here ➶](../../../help/netgear_ex/)" +!!! example "After going through NetGear Usage Examples, Checkout more bonus examples [here ➶](../../../help/netgear_ex/)" ## Parameters diff --git a/docs/gears/netgear/usage.md b/docs/gears/netgear/usage.md index eb05afc1b..b8f9152fa 100644 --- a/docs/gears/netgear/usage.md +++ b/docs/gears/netgear/usage.md @@ -29,7 +29,7 @@ limitations under the License. * Only either of two functions (i.e. `send()` and `recv()`) can be accessed at any given instance based on activated [primary mode](../overview/#primary-modes) selected during NetGear API initialization. Trying to access wrong function in incorrect mode (_for e.g using `send()` function in Receive Mode_), will result in `ValueError`. -!!! examples "After going through following Usage Examples, Checkout more bonus examples [here ➶](../../../help/netgear_ex/)" +!!! example "After going through following Usage Examples, Checkout more bonus examples [here ➶](../../../help/netgear_ex/)"   diff --git a/docs/gears/netgear_async/overview.md b/docs/gears/netgear_async/overview.md index 804e5e59f..102ab6215 100644 --- a/docs/gears/netgear_async/overview.md +++ b/docs/gears/netgear_async/overview.md @@ -73,7 +73,7 @@ from vidgear.gears.asyncio import NetGear_Async See here 🚀 -!!! examples "After going through NetGear_Async Usage Examples, Checkout more bonus examples [here ➶](../../../help/netgear_async_ex/)" +!!! example "After going through NetGear_Async Usage Examples, Checkout more bonus examples [here ➶](../../../help/netgear_async_ex/)" ## Parameters diff --git a/docs/gears/netgear_async/usage.md b/docs/gears/netgear_async/usage.md index 4a3c571d4..db6654961 100644 --- a/docs/gears/netgear_async/usage.md +++ b/docs/gears/netgear_async/usage.md @@ -27,7 +27,7 @@ limitations under the License. * It is advised to comprehend [NetGear API](../../netgear/overview/) before using this API. -!!! examples "After going through following Usage Examples, Checkout more bonus examples [here ➶](../../../help/netgear_async_ex/)" +!!! example "After going through following Usage Examples, Checkout more bonus examples [here ➶](../../../help/netgear_async_ex/)" ## Requirement diff --git a/docs/gears/webgear/advanced.md b/docs/gears/webgear/advanced.md index 55bc4ff02..b8a0fdbf7 100644 --- a/docs/gears/webgear/advanced.md +++ b/docs/gears/webgear/advanced.md @@ -22,7 +22,7 @@ limitations under the License. !!! note "This is a continuation of the [WebGear doc ➶](../overview/#webgear-api). Thereby, It's advised to first get familiarize with this API, and its [requirements](../usage/#requirements)." -!!! examples "After going through following Usage Examples, Checkout more bonus examples [here ➶](../../../help/webgear_ex/)" +!!! example "After going through following Usage Examples, Checkout more bonus examples [here ➶](../../../help/webgear_ex/)"   diff --git a/docs/gears/webgear/overview.md b/docs/gears/webgear/overview.md index 7f2766e86..7ef43c517 100644 --- a/docs/gears/webgear/overview.md +++ b/docs/gears/webgear/overview.md @@ -149,7 +149,7 @@ The WebGear API by default uses simple & elegant [**WebGear's Default Theme**](h See here 🚀 -!!! examples "After going through WebGear Usage Examples, Checkout more bonus examples [here ➶](../../../help/webgear_ex/)" +!!! example "After going through WebGear Usage Examples, Checkout more bonus examples [here ➶](../../../help/webgear_ex/)" ## Parameters diff --git a/docs/gears/webgear_rtc/advanced.md b/docs/gears/webgear_rtc/advanced.md index 04b06729d..28bdbbbc4 100644 --- a/docs/gears/webgear_rtc/advanced.md +++ b/docs/gears/webgear_rtc/advanced.md @@ -23,7 +23,7 @@ limitations under the License. !!! note "This is a continuation of the [WebGear_RTC doc ➶](../overview/#webgear_rtc-api). Thereby, It's advised to first get familiarize with this API, and its [requirements](../usage/#requirements)." -!!! examples "After going through following Usage Examples, Checkout more bonus examples [here ➶](../../../help/webgear_rtc_ex/)" +!!! example "After going through following Usage Examples, Checkout more bonus examples [here ➶](../../../help/webgear_rtc_ex/)"   diff --git a/docs/gears/webgear_rtc/overview.md b/docs/gears/webgear_rtc/overview.md index 78b5a364d..35ff7b49e 100644 --- a/docs/gears/webgear_rtc/overview.md +++ b/docs/gears/webgear_rtc/overview.md @@ -151,7 +151,7 @@ The WebGear_RTC API by default uses simple & elegant [**WebGear_RTC's Default Th See here 🚀 -!!! examples "After going through WebGear_RTC Usage Examples, Checkout more bonus examples [here ➶](../../../help/webgear_rtc_ex/)" +!!! example "After going through WebGear_RTC Usage Examples, Checkout more bonus examples [here ➶](../../../help/webgear_rtc_ex/)" ## Parameters diff --git a/docs/gears/writegear/compression/overview.md b/docs/gears/writegear/compression/overview.md index 11d9c7cd3..9e925fee3 100644 --- a/docs/gears/writegear/compression/overview.md +++ b/docs/gears/writegear/compression/overview.md @@ -27,7 +27,7 @@ limitations under the License. ## Overview -When [`compression_mode`](../params/#compression_mode) parameter is enabled (.i.e compression_mode = True), WriteGear API provides a complete, flexible & robust wrapper around [**FFmpeg**](https://ffmpeg.org/) to encode lossless & compressed multimedia files. +When [`compression_mode`](../params/#compression_mode) parameter is enabled (.i.e `compression_mode = True`), WriteGear API provides a complete, flexible & robust wrapper around [**FFmpeg**](https://ffmpeg.org/) to encode lossless & compressed multimedia files. This mode can process real-time video frames into a lossless compressed format with any suitable setting video/audio properties such as _bitrate, codec, framerate, resolution, subtitles, and much more_ in just a few easy lines of code. It can also perform complex tasks such as [Live-Streaming](../usage/#using-compression-mode-for-streaming-urls) _(such as for Twitch)_, multiplexing video with audio in real-time (see this [usage example](../usage/#using-compression-mode-with-live-audio-input)) while handling all errors robustly. diff --git a/docs/gears/writegear/compression/usage.md b/docs/gears/writegear/compression/usage.md index 0132f479d..33c26dbe7 100644 --- a/docs/gears/writegear/compression/usage.md +++ b/docs/gears/writegear/compression/usage.md @@ -38,7 +38,7 @@ limitations under the License. * Always use `writer.close()` at the very end of the main code. **NEVER USE IT INBETWEEN CODE** to avoid undesired behavior. -!!! examples "After going through WriteGear Usage Examples, Checkout more bonus examples [here ➶](../../../help/writegear_ex/)" +!!! example "After going through WriteGear Usage Examples, Checkout more bonus examples [here ➶](../../../help/writegear_ex/)"   @@ -225,6 +225,8 @@ In Compression Mode, WriteGear also allows URL strings _(as output)_ for live st In this example, we will stream live camera frames directly to Twitch :fontawesome-brands-twitch:: +!!! tip "For streaming with traditional protocols such as :material-video-wireless: RTSP/RTP, Checkout this [WriteGear's Bonus Examples ➶](../../../../help/writegear_ex/#using-writegears-compression-mode-for-rstprtp-live-streaming)." + !!! example ":fontawesome-brands-youtube: YouTube-Live Streaming example code also available in [WriteGear's Bonus Examples ➶](../../../../help/writegear_ex/#using-writegears-compression-mode-for-youtube-live-streaming)" !!! warning "This example assume you already have a [**Twitch Account**](https://www.twitch.tv/) for publishing video." diff --git a/docs/gears/writegear/non_compression/overview.md b/docs/gears/writegear/non_compression/overview.md index 938a4d8c1..45c7b3b7b 100644 --- a/docs/gears/writegear/non_compression/overview.md +++ b/docs/gears/writegear/non_compression/overview.md @@ -28,7 +28,7 @@ limitations under the License. ## Overview -When [`compression_mode`](../params/#compression_mode) parameter is disabled (.i.e compression_mode = False), WriteGear API uses basic OpenCV's inbuilt [**VideoWriter API**](https://docs.opencv.org/master/dd/d9e/classcv_1_1VideoWriter.html#ad59c61d8881ba2b2da22cff5487465b5) tools for encoding multimedia files but without compression. +When [`compression_mode`](../params/#compression_mode) parameter is disabled (.i.e `compression_mode = False`), WriteGear API uses basic OpenCV's inbuilt [**VideoWriter API**](https://docs.opencv.org/master/dd/d9e/classcv_1_1VideoWriter.html#ad59c61d8881ba2b2da22cff5487465b5) tools for encoding multimedia files but without compression. This mode provides flexible access to [**OpenCV's VideoWriter API**](https://docs.opencv.org/master/dd/d9e/classcv_1_1VideoWriter.html#ad59c61d8881ba2b2da22cff5487465b5),and also supports various parameters available within this API, but lacks the ability to control output quality, compression, and other important features like _lossless video compression, audio encoding, etc._ which are only available in [Compression Mode](../../compression/overview/). Thereby, the resultant output video-file size will be many times larger as compared to Compression Mode. @@ -51,7 +51,7 @@ This mode provides flexible access to [**OpenCV's VideoWriter API**](https://doc See here 🚀 -!!! examples "After going through WriteGear Usage Examples, Checkout more bonus examples [here ➶](../../../help/writegear_ex/)" +!!! example "After going through WriteGear Usage Examples, Checkout more bonus examples [here ➶](../../../help/writegear_ex/)" ## Parameters diff --git a/docs/gears/writegear/non_compression/usage.md b/docs/gears/writegear/non_compression/usage.md index a46cda61b..8430c9a0f 100644 --- a/docs/gears/writegear/non_compression/usage.md +++ b/docs/gears/writegear/non_compression/usage.md @@ -30,7 +30,7 @@ limitations under the License. * Always use `writer.close()` at the very end of the main code. **NEVER USE IT INBETWEEN CODE** to avoid undesired behavior. -!!! examples "After going through WriteGear Usage Examples, Checkout more bonus examples [here ➶](../../../help/writegear_ex/)" +!!! example "After going through WriteGear Usage Examples, Checkout more bonus examples [here ➶](../../../help/writegear_ex/)"   diff --git a/docs/help/writegear_ex.md b/docs/help/writegear_ex.md index 8f866c138..81af3328a 100644 --- a/docs/help/writegear_ex.md +++ b/docs/help/writegear_ex.md @@ -23,6 +23,63 @@ limitations under the License.   +## Using WriteGear's Compression Mode for RSTP/RTP Live-Streaming + +In Compression Mode, you can use WriteGear for livestreaming with traditional protocols such as RSTP/RTP. The example to achieve that is as follows: + +??? new "New in v0.2.6" + This example was added in `v0.2.6`. + +!!! alert "This example assume you already have a RSTP Server running at specified RSTP address with format *`rtsp://[RTSP_ADDRESS]:[RTSP_PORT]/[RTSP_PATH]`* for publishing video frames." + +??? tip "Creating your own RSTP Server locally" + If you want to create your RSTP Server locally, then checkout [**rtsp-simple-server**](https://github.com/aler9/rtsp-simple-server) - a ready-to-use and zero-dependency server and proxy that allows users to publish, read and proxy live video and audio streams through various protocols such as RSTP. + +!!! danger "Make sure to change RSTP address `rtsp://localhost:8554/mystream` with yours in following code before running!" + + +```python hl_lines="10 15" +# import required libraries +import cv2 +from vidgear.gears import CamGear +from vidgear.gears import WriteGear + +# open any valid video stream(for e.g `foo.mp4` file) +stream = CamGear(source="foo.mp4").start() + +# define required FFmpeg parameters for your writer +output_params = {"-f": "rtsp", "-rtsp_transport": "tcp"} + +# Define writer with defined parameters and RSTP address +# [WARNING] Change your RSTP address `rtsp://localhost:8554/mystream` with yours! +writer = WriteGear( + output_filename="rtsp://localhost:8554/mystream", logging=True, **output_params +) + +# loop over +while True: + + # read frames from stream + frame = stream.read() + + # check for frame if Nonetype + if frame is None: + break + + # {do something with the frame here} + + # write frame to writer + writer.write(frame) + +# safely close video stream +stream.stop() + +# safely close writer +writer.close() +``` + +  + ## Using WriteGear's Compression Mode for YouTube-Live Streaming In Compression Mode, you can also use WriteGear for Youtube-Livestreaming. The example is as follows: @@ -46,7 +103,7 @@ VIDEO_SOURCE = "/home/foo/foo.mp4" # Open stream stream = CamGear(source=VIDEO_SOURCE, logging=True).start() -# define required FFmpeg optimizing parameters for your writer +# define required FFmpeg parameters for your writer # [NOTE]: Added VIDEO_SOURCE as audio-source, since YouTube rejects audioless streams! output_params = { "-i": VIDEO_SOURCE, @@ -64,7 +121,7 @@ output_params = { # [WARNING] Change your YouTube-Live Stream Key here: YOUTUBE_STREAM_KEY = "xxxx-xxxx-xxxx-xxxx-xxxx" -# Define writer with defined parameters and +# Define writer with defined parameters writer = WriteGear( output_filename="rtmp://a.rtmp.youtube.com/live2/{}".format(YOUTUBE_STREAM_KEY), logging=True, From 00e62bb1f57a2a0208befa95882025756d4fbea5 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Mon, 27 Jun 2022 20:58:19 +0530 Subject: [PATCH 29/49] =?UTF-8?q?=F0=9F=93=9D=20Docs:=20Updated=20Admoniti?= =?UTF-8?q?on=20Icon=20and=20URLs.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++- docs/gears/writegear/introduction.md | 2 +- docs/overrides/assets/stylesheets/custom.css | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a7faf527c..ba652958b 100644 --- a/README.md +++ b/README.md @@ -408,7 +408,7 @@ stream.stop() WriteGear API provides a complete, flexible, and robust wrapper around [**FFmpeg**][ffmpeg], a leading multimedia framework. WriteGear can process real-time frames into a lossless compressed video-file with any suitable specifications _(such as`bitrate, codec, framerate, resolution, subtitles, etc.`)_. -WriteGear also supports streaming with traditional protocols such as RTMP, RTSP/RTP. It is powerful enough to perform complex tasks such as [Live-Streaming][live-stream] _(such as for Twitch, YouTube etc.)_ and [Multiplexing Video-Audio][live-audio-doc] with real-time frames in just few lines of code. +WriteGear also supports streaming with traditional protocols such as [RTSP/RTP][rstp-ex], RTMP. It is powerful enough to perform complex tasks such as [Live-Streaming][live-stream] _(such as for Twitch, YouTube etc.)_ and [Multiplexing Video-Audio][live-audio-doc] with real-time frames in just few lines of code. Best of all, WriteGear grants users the complete freedom to play with any FFmpeg parameter with its exclusive **Custom Commands function** _(see this [doc][custom-command-doc])_ without relying on any third-party API. @@ -755,6 +755,7 @@ Internal URLs [bs_script_dataset]:https://github.com/abhiTronix/vidgear/blob/testing/scripts/bash/prepare_dataset.sh [faq]:https://abhitronix.github.io/vidgear/latest/help/get_help/#frequently-asked-questions +[rstp-ex]:https://abhitronix.github.io/vidgear/latest/help/writegear_ex/#using-writegears-compression-mode-for-rstprtp-live-streaming [doc-vidgear-purpose]:https://abhitronix.github.io/vidgear/latest/help/motivation/#why-is-vidgear-a-thing [live-stream]:https://abhitronix.github.io/vidgear/latest/gears/writegear/compression/usage/#using-compression-mode-for-live-streaming [live-audio-doc]:https://abhitronix.github.io/vidgear/latest/gears/writegear/compression/usage/#using-compression-mode-with-live-audio-input diff --git a/docs/gears/writegear/introduction.md b/docs/gears/writegear/introduction.md index 68f0e6226..faee5c9b9 100644 --- a/docs/gears/writegear/introduction.md +++ b/docs/gears/writegear/introduction.md @@ -31,7 +31,7 @@ limitations under the License. WriteGear API provides a complete, flexible, and robust wrapper around [**FFmpeg**](https://ffmpeg.org/), a leading multimedia framework. WriteGear can process real-time frames into a lossless compressed video-file with any suitable specifications _(such as`bitrate, codec, framerate, resolution, subtitles, etc.`)_. -WriteGear also supports streaming with traditional protocols such as RTMP, RTSP/RTP. It is powerful enough to perform complex tasks such as [Live-Streaming](../compression/usage/#using-compression-mode-for-live-streaming) _(such as for Twitch, YouTube etc.)_ and [Multiplexing Video-Audio](../compression/usage/#using-compression-mode-with-live-audio-input) with real-time frames in just few lines of code. +WriteGear also supports streaming with traditional protocols such as [RTSP/RTP](../../../help/writegear_ex/#using-writegears-compression-mode-for-rstprtp-live-streaming), RTMP. It is powerful enough to perform complex tasks such as [Live-Streaming](../compression/usage/#using-compression-mode-for-live-streaming) _(such as for Twitch, YouTube etc.)_ and [Multiplexing Video-Audio](../compression/usage/#using-compression-mode-with-live-audio-input) with real-time frames in just few lines of code. Best of all, WriteGear grants users the complete freedom to play with any FFmpeg parameter with its exclusive ==Custom Commands function== _(see this [doc](../compression/advanced/cciw/))_ without relying on any third-party API. diff --git a/docs/overrides/assets/stylesheets/custom.css b/docs/overrides/assets/stylesheets/custom.css index ab890144a..639f34b7b 100755 --- a/docs/overrides/assets/stylesheets/custom.css +++ b/docs/overrides/assets/stylesheets/custom.css @@ -20,7 +20,7 @@ limitations under the License. :root { --md-admonition-icon--new: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23000000' d='M13 2V3H12V9H11V10H9V11H8V12H7V13H5V12H4V11H3V9H2V15H3V16H4V17H5V18H6V22H8V21H7V20H8V19H9V18H10V19H11V22H13V21H12V17H13V16H14V15H15V12H16V13H17V11H15V9H20V8H17V7H22V3H21V2M14 3H15V4H14Z' /%3E%3C/svg%3E"); - --md-admonition-icon--alert: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23000000' d='M6,6.9L3.87,4.78L5.28,3.37L7.4,5.5L6,6.9M13,1V4H11V1H13M20.13,4.78L18,6.9L16.6,5.5L18.72,3.37L20.13,4.78M4.5,10.5V12.5H1.5V10.5H4.5M19.5,10.5H22.5V12.5H19.5V10.5M6,20H18A2,2 0 0,1 20,22H4A2,2 0 0,1 6,20M12,5A6,6 0 0,1 18,11V19H6V11A6,6 0 0,1 12,5Z' /%3E%3C/svg%3E"); + --md-admonition-icon--alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M23 7v6h-2V7m0 8h2v2h-2M12 2a2 2 0 0 0-2 2 2 2 0 0 0 0 .29C7.12 5.14 5 7.82 5 11v6l-2 2v1h18v-1l-2-2v-6c0-3.18-2.12-5.86-5-6.71A2 2 0 0 0 14 4a2 2 0 0 0-2-2m-2 19a2 2 0 0 0 2 2 2 2 0 0 0 2-2Z'/%3E%3C/svg%3E"); --md-admonition-icon--xquote: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23000000' d='M20 2H4C2.9 2 2 2.9 2 4V16C2 17.1 2.9 18 4 18H8V21C8 21.6 8.4 22 9 22H9.5C9.7 22 10 21.9 10.2 21.7L13.9 18H20C21.1 18 22 17.1 22 16V4C22 2.9 21.1 2 20 2M11 13H7V8.8L8.3 6H10.3L8.9 9H11V13M17 13H13V8.8L14.3 6H16.3L14.9 9H17V13Z' /%3E%3C/svg%3E"); --md-admonition-icon--xwarning: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M23,12L20.56,9.22L20.9,5.54L17.29,4.72L15.4,1.54L12,3L8.6,1.54L6.71,4.72L3.1,5.53L3.44,9.21L1,12L3.44,14.78L3.1,18.47L6.71,19.29L8.6,22.47L12,21L15.4,22.46L17.29,19.28L20.9,18.46L20.56,14.78L23,12M13,17H11V15H13V17M13,13H11V7H13V13Z' /%3E%3C/svg%3E"); --md-admonition-icon--xdanger: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23000000' d='M12,2A9,9 0 0,0 3,11C3,14.03 4.53,16.82 7,18.47V22H9V19H11V22H13V19H15V22H17V18.46C19.47,16.81 21,14 21,11A9,9 0 0,0 12,2M8,11A2,2 0 0,1 10,13A2,2 0 0,1 8,15A2,2 0 0,1 6,13A2,2 0 0,1 8,11M16,11A2,2 0 0,1 18,13A2,2 0 0,1 16,15A2,2 0 0,1 14,13A2,2 0 0,1 16,11M12,14L13.5,17H10.5L12,14Z' /%3E%3C/svg%3E"); From 84f373dbde1e3d7b5da3b6bb804d642842ce1964 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Mon, 27 Jun 2022 21:28:08 +0530 Subject: [PATCH 30/49] =?UTF-8?q?=F0=9F=93=9D=20Docs:=20Updated=20FAQs=20a?= =?UTF-8?q?nd=20site-links.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/gears/writegear/compression/overview.md | 2 +- docs/help/get_help.md | 4 ++-- docs/help/writegear_ex.md | 2 +- docs/help/writegear_faqs.md | 8 +++++++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/gears/writegear/compression/overview.md b/docs/gears/writegear/compression/overview.md index 9e925fee3..b74194172 100644 --- a/docs/gears/writegear/compression/overview.md +++ b/docs/gears/writegear/compression/overview.md @@ -29,7 +29,7 @@ limitations under the License. When [`compression_mode`](../params/#compression_mode) parameter is enabled (.i.e `compression_mode = True`), WriteGear API provides a complete, flexible & robust wrapper around [**FFmpeg**](https://ffmpeg.org/) to encode lossless & compressed multimedia files. -This mode can process real-time video frames into a lossless compressed format with any suitable setting video/audio properties such as _bitrate, codec, framerate, resolution, subtitles, and much more_ in just a few easy lines of code. It can also perform complex tasks such as [Live-Streaming](../usage/#using-compression-mode-for-streaming-urls) _(such as for Twitch)_, multiplexing video with audio in real-time (see this [usage example](../usage/#using-compression-mode-with-live-audio-input)) while handling all errors robustly. +This mode can process real-time video frames into a lossless compressed format with any suitable setting video/audio properties such as _bitrate, codec, framerate, resolution, subtitles, and much more_ in just a few easy lines of code. It can also perform complex tasks such as [Live-Streaming](../usage/#using-compression-mode-for-live-streaming) _(such as for Twitch)_, multiplexing video with audio in real-time (see this [usage example](../usage/#using-compression-mode-with-live-audio-input)) while handling all errors robustly.   diff --git a/docs/help/get_help.md b/docs/help/get_help.md index 861e860b6..8f9567e10 100644 --- a/docs/help/get_help.md +++ b/docs/help/get_help.md @@ -37,7 +37,7 @@ There are several ways to get help with VidGear: > Got a question related to VidGear Working? -Checkout the Frequently Asked Questions, a curated list of all the questions with adequate answer that we commonly receive, for quickly troubleshooting your problems: +Checkout the **Frequently Asked Questions** - a curated list of all the questions with adequate answer that we commonly receive for quickly troubleshooting your problems: - [General FAQs ➶](general_faqs.md) - [CamGear FAQs ➶](camgear_faqs.md) @@ -60,7 +60,7 @@ Checkout the Frequently Asked Questions, a curated list of all the questions wit > How we do this with that API? -Checkout the Bonus Examples, a curated list of all advanced examples with unusual configuration, which isn't available in Vidgear API's usage examples: +Checkout the **Bonus Examples** - a curated list of all experimental examples with unusual configuration that aren't included in general usage examples: - [CamGear Examples ➶](camgear_ex.md) - [PiGear Examples ➶](pigear_ex.md) diff --git a/docs/help/writegear_ex.md b/docs/help/writegear_ex.md index 81af3328a..8b4ebdeba 100644 --- a/docs/help/writegear_ex.md +++ b/docs/help/writegear_ex.md @@ -33,7 +33,7 @@ In Compression Mode, you can use WriteGear for livestreaming with traditional pr !!! alert "This example assume you already have a RSTP Server running at specified RSTP address with format *`rtsp://[RTSP_ADDRESS]:[RTSP_PORT]/[RTSP_PATH]`* for publishing video frames." ??? tip "Creating your own RSTP Server locally" - If you want to create your RSTP Server locally, then checkout [**rtsp-simple-server**](https://github.com/aler9/rtsp-simple-server) - a ready-to-use and zero-dependency server and proxy that allows users to publish, read and proxy live video and audio streams through various protocols such as RSTP. + If you want to create your RSTP Server locally, then checkout [**rtsp-simple-server**](https://github.com/aler9/rtsp-simple-server) - a ready-to-use and zero-dependency server and proxy that allows users to publish, read and proxy live video and audio streams through various protocols such as RSTP, RTMP etc. !!! danger "Make sure to change RSTP address `rtsp://localhost:8554/mystream` with yours in following code before running!" diff --git a/docs/help/writegear_faqs.md b/docs/help/writegear_faqs.md index bb2764b2c..a5007a9f9 100644 --- a/docs/help/writegear_faqs.md +++ b/docs/help/writegear_faqs.md @@ -101,7 +101,7 @@ limitations under the License. ## Can I live stream to Twitch with WriteGear API? -**Answer:** Yes, See [this usage example ➶](../../gears/writegear/compression/usage/#using-compression-mode-for-streaming-urls) +**Answer:** Yes, See [this usage example ➶](../../gears/writegear/compression/usage/#using-compression-mode-for-live-streaming)   @@ -111,6 +111,12 @@ limitations under the License.   +## How to Live-Streaming using RSTP/RTP protocol with WriteGear? + +**Answer:** See [this bonus example ➶](../writegear_ex/#using-writegears-compression-mode-for-rstprtp-live-streaming). + +  + ## How to create MP4 segments from a video stream with WriteGear? From 56669c172564d16ddd18977e7e3e542febea53ac Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Mon, 27 Jun 2022 22:35:36 +0530 Subject: [PATCH 31/49] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Setup:=20Updated=20o?= =?UTF-8?q?perators=20and=20dependencies.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 🎨 Replaced `>=` comparsion operator with more flexible `~=`. - 🎨 Replaced `distutils.version.LooseVersion` with `pkg_resources.parse_version`. --- setup.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index efb3495c0..2d233cd8e 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ import setuptools import urllib.request -from distutils.version import LooseVersion +from pkg_resources import parse_version from distutils.util import convert_path from setuptools import setup @@ -40,10 +40,10 @@ def test_opencv(): import cv2 # check whether OpenCV Binaries are 3.x+ - if LooseVersion(cv2.__version__) < LooseVersion("3"): + if parse_version(cv2.__version__) < parse_version("3"): raise ImportError( "Incompatible (< 3.0) OpenCV version-{} Installation found on this machine!".format( - LooseVersion(cv2.__version__) + parse_version(cv2.__version__) ) ) except ImportError: @@ -61,11 +61,11 @@ def latest_version(package_name): response = urllib.request.urlopen(urllib.request.Request(url), timeout=1) data = json.load(response) versions = list(data["releases"].keys()) - versions.sort(key=LooseVersion) - return ">={}".format(versions[-1]) - except Exception as e: - if versions and isinstance(e, TypeError): - return ">={}".format(versions[-1]) + versions.sort(key=parse_version) + return "~={}".format(versions[-1]) + except TypeError as e: + if versions: + return "~={}".format(versions[-1]) return "" From ec1501e5ebee996a0579b88300b54217d54199f4 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Mon, 27 Jun 2022 23:26:30 +0530 Subject: [PATCH 32/49] =?UTF-8?q?=F0=9F=94=A5=20Docs:=20Removed=20unused?= =?UTF-8?q?=20code.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/overrides/assets/javascripts/extra.js | 7 +------ docs/overrides/main.html | 10 +++++----- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/docs/overrides/assets/javascripts/extra.js b/docs/overrides/assets/javascripts/extra.js index a09882de3..e76cef5ef 100755 --- a/docs/overrides/assets/javascripts/extra.js +++ b/docs/overrides/assets/javascripts/extra.js @@ -101,9 +101,4 @@ var player_stab = new Clappr.Player({ parentId: '#player_stab', poster: 'https://rawcdn.githack.com/abhiTronix/vidgear-docs-additionals/94bf767c28bf2fe61b9c327625af8e22745f9fdf/stabilizer_video_chunks/hd_thumbnail_2.png', preload: 'metadata', -}); - -// gitter sidecard -((window.gitter = {}).chat = {}).options = { - room: 'vidgear/community' -}; \ No newline at end of file +}); \ No newline at end of file diff --git a/docs/overrides/main.html b/docs/overrides/main.html index 7b8d48ce6..bc6e2dbda 100644 --- a/docs/overrides/main.html +++ b/docs/overrides/main.html @@ -22,11 +22,6 @@ {% endblock %} - {% block outdated %} You're not viewing the latest version. @@ -51,6 +46,11 @@ + {% endblock %} - -## Brief Description - - -_Kindly briefly explain the issue here._ - - -### Acknowledgment - - - -- [ ] I have searched the [issues](https://github.com/abhiTronix/vidgear/issues) for my issue and found nothing related or helpful. -- [ ] I have read the [Documentation](https://abhitronix.github.io/vidgear/latest). -- [ ] I have read the [Issue Guidelines](https://abhitronix.github.io/vidgear/latest/contribution/issue/#submitting-an-issue-guidelines). - - -### Environment - - -* VidGear version: -* Branch: -* Python version: -* PiP version: -* Operating System and version: - -### Expected Behavior - - -### Actual Behavior - - - -### Possible Fix - - -### Steps to reproduce - - - -(Write your steps here:) - -1. -2. -3. - - -### Optional - \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml new file mode 100644 index 000000000..ea04b2a34 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -0,0 +1,92 @@ +name: Bug Report +description: File a bug report for VidGear +title: "[Bug]: " +labels: ["BUG :bug:", "NEED TRIAGE :police_car:"] +assignees: + - abhiTronix +body: + - type: textarea + attributes: + label: Description + description: Please provide a brief description of the bug in 1-2 sentences, and why you consider it to be a bug? + validations: + required: true + - type: checkboxes + attributes: + label: Acknowledgment + description: "By posting this issue you acknowledge the following:" + options: + - label: I have searched the [issues](https://github.com/abhiTronix/vidgear/issues) for my issue and found nothing related or helpful. + required: true + - label: I have read the [Documentation](https://abhitronix.github.io/vidgear/latest) and found nothing related or helpful. + required: true + - label: I've read the [Issue Guidelines](https://abhitronix.github.io/vidgear/latest/contribution/issue/#submitting-an-issue-guidelines) and wholeheartedly agree. + required: true + - type: textarea + attributes: + label: Expected behaviour + description: Please describe precisely what you'd expect to happen. + validations: + required: true + - type: textarea + attributes: + label: Actual behaviour + description: Please describe precisely what is actually happening. + validations: + required: true + - type: textarea + attributes: + label: Steps to reproduce + description: Please describe the steps to reproduce the bug. + placeholder: |- + 1. ... + 2. ... + 3. ... + validations: + required: true + - type: textarea + attributes: + label: Terminal log output + description: Please copy and paste any relevant terminal log output to help quickly debug bugs. You can enable logging with `logging=True` in any Vidgear API for getting verbose terminal logs. + render: shell + - type: textarea + attributes: + label: Python Code + description: Share your python code here (only if available) or else leave this block empty. You can directly paste your python code here, no need for any backticks or formatting. + render: python + - type: input + attributes: + label: VidGear Version + description: What version of VidGear are you running? Run command `python -c "import vidgear; print(vidgear.__version__)"` to find out. + placeholder: ex. 0.2.6 + validations: + required: true + - type: input + attributes: + label: Python version + description: What version of Python you're running Vidgear on? Run command `python -V` to find out. + placeholder: ex. 3.7 + validations: + required: true + - type: input + attributes: + label: OpenCV version + description: What version of OpenCV binaries you're running? Run command `python -c "import cv2; print(cv2.__version__)"` to find out. + placeholder: ex. 4.6.0.66 + validations: + required: true + - type: input + attributes: + label: Operating System version + description: What Operating system you're using? + placeholder: ex. Linux Mint 20.3 “Una” Xfce + validations: + required: true + - type: textarea + attributes: + label: Any other Relevant Information? + description: Provide any other relevant information if available or else leave this block empty. + placeholder: |- + ex. Related Issue: xyz/foo#4083 + validations: + required: false From de44f53e847e25ac2995650a6637cb21e4ce2a27 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Mon, 4 Jul 2022 15:03:11 +0530 Subject: [PATCH 41/49] =?UTF-8?q?=F0=9F=9A=A7=20Maintenance:=20Switched=20?= =?UTF-8?q?to=20new=20Issue=20GitHub's=20form=20schema=20for=20questions.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ✨ Added new `question.yaml` - 🔥 Deleted `question.md` --- .github/ISSUE_TEMPLATE/question.md | 39 ------------------- .github/ISSUE_TEMPLATE/question.yaml | 57 ++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 39 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/question.md create mode 100644 .github/ISSUE_TEMPLATE/question.yaml diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md deleted file mode 100644 index e5a33ea66..000000000 --- a/.github/ISSUE_TEMPLATE/question.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -name: Question -about: Have any questions regarding VidGear? -labels: 'QUESTION :question:' -title: '[Question]: ' ---- - - - -## Question - - -_Kindly describe the issue here._ - - -### Acknowledgment - - -- [ ] I have searched the [issues](https://github.com/abhiTronix/vidgear/issues) for my issue and found nothing related or helpful. -- [ ] I have read the [FAQs](https://abhitronix.github.io/vidgear/latest/help/get_help/#frequently-asked-questions). -- [ ] I have read the [Documentation](https://abhitronix.github.io/vidgear/latest). - - -### Context - - - - -### Your Environment - -* VidGear version: -* Branch: -* Python version: -* PiP version: -* Operating System and version: - - -### Optional - \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/question.yaml b/.github/ISSUE_TEMPLATE/question.yaml new file mode 100644 index 000000000..bb58ff92f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.yaml @@ -0,0 +1,57 @@ +name: Question +description: Have any questions regarding VidGear? +title: "[Question]: " +labels: "QUESTION :question:" +body: + - type: textarea + attributes: + label: Description + description: Please provide a brief description of the question in 1-2 sentences. + validations: + required: true + - type: checkboxes + attributes: + label: Acknowledgment + description: "By posting this issue you acknowledge the following:" + options: + - label: I have searched open or closed [issues](https://github.com/abhiTronix/vidgear/issues) for my problem and found nothing related or helpful. + required: true + - label: I have read the [Documentation](https://abhitronix.github.io/vidgear/latest) and found nothing related or helpful. + required: true + - label: I have gone through the [Bonus Examples](https://abhitronix.github.io/vidgear/latest/help/get_help/#bonus-examples) and [FAQs](https://abhitronix.github.io/vidgear/latest/help/get_help/#frequently-asked-questions) and found nothing related or helpful. + required: true + - type: textarea + attributes: + label: Explain your Question + description: Please describe your question thoroughly here. What are you trying to accomplish? + validations: + required: true + - type: input + attributes: + label: VidGear Version + description: What version of VidGear are you running? Run command `python -c "import vidgear; print(vidgear.__version__)"` to find out. + placeholder: ex. 0.2.6 + validations: + required: true + - type: input + attributes: + label: Python version + description: What version of Python you're running Vidgear on? Run command `python -V` to find out. + placeholder: ex. 3.7 + validations: + required: true + - type: input + attributes: + label: Operating System version + description: What Operating system you're using? + placeholder: ex. Linux Mint 20.3 “Una” Xfce + validations: + required: true + - type: textarea + attributes: + label: Any other Relevant Information? + description: Provide any other relevant information if available or else leave this block empty. If applicable, you can also drag-and-drop mockups or screenshots images here, or link to external assets. + placeholder: |- + ex. Related Issue: xyz/foo#4083 + validations: + required: false From 72bf039f1c521d1be738f5d3844e8676e1daae34 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Mon, 4 Jul 2022 15:04:40 +0530 Subject: [PATCH 42/49] =?UTF-8?q?=F0=9F=8E=A8=20Maintenance:=20Polished=20?= =?UTF-8?q?Bug=20Report=20form.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug_report.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index ea04b2a34..738391f5b 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -16,7 +16,7 @@ body: label: Acknowledgment description: "By posting this issue you acknowledge the following:" options: - - label: I have searched the [issues](https://github.com/abhiTronix/vidgear/issues) for my issue and found nothing related or helpful. + - label: I have searched open or closed [issues](https://github.com/abhiTronix/vidgear/issues) for my problem and found nothing related or helpful. required: true - label: I have read the [Documentation](https://abhitronix.github.io/vidgear/latest) and found nothing related or helpful. required: true @@ -52,7 +52,7 @@ body: - type: textarea attributes: label: Python Code - description: Share your python code here (only if available) or else leave this block empty. You can directly paste your python code here, no need for any backticks or formatting. + description: Share python code you're using(only if available) here or else leave this block empty. You can directly paste your python code here, no need for any backticks or formatting. render: python - type: input attributes: @@ -85,7 +85,7 @@ body: - type: textarea attributes: label: Any other Relevant Information? - description: Provide any other relevant information if available or else leave this block empty. + description: Provide any other relevant information if available or else leave this block empty. If applicable, you can also drag-and-drop mockups or screenshots images here, or link to external assets. placeholder: |- ex. Related Issue: xyz/foo#4083 validations: From fa72ddb529ced9d18c702e72652184817cc10ac6 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Mon, 4 Jul 2022 15:31:26 +0530 Subject: [PATCH 43/49] =?UTF-8?q?=F0=9F=9A=A7=20Maintenance:=20Switched=20?= =?UTF-8?q?to=20new=20Issue=20GitHub's=20form=20schema=20for=20proposals.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ✨ Added new `proposal.yaml` - 🔥 Deleted `proposal.md` --- .github/ISSUE_TEMPLATE/proposal.md | 32 --------------------- .github/ISSUE_TEMPLATE/proposal.yaml | 43 ++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 32 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/proposal.md create mode 100644 .github/ISSUE_TEMPLATE/proposal.yaml diff --git a/.github/ISSUE_TEMPLATE/proposal.md b/.github/ISSUE_TEMPLATE/proposal.md deleted file mode 100644 index c6ebee716..000000000 --- a/.github/ISSUE_TEMPLATE/proposal.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -name: Proposal -about: Suggest an idea for improving VidGear -labels: 'PROPOSAL :envelope_with_arrow:' -title: '[Proposal]: ' ---- - - - - -## Brief Description - - -_Kindly explain the issue here._ - - -### Context - - - - - -### Your Current Environment - -* VidGear version: -* Branch: -* Python version: -* Operating System and version: - - -### Any Other Important Information - \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/proposal.yaml b/.github/ISSUE_TEMPLATE/proposal.yaml new file mode 100644 index 000000000..4a3b66f8f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/proposal.yaml @@ -0,0 +1,43 @@ +name: Proposal +description: Suggest an idea for improving VidGear 💡 +title: "[Proposal]: " +labels: "PROPOSAL :envelope_with_arrow:" +body: + - type: checkboxes + attributes: + label: Issue guidelines + description: Please read the Issue guidelines before proceeding. + options: + - label: I've read the [Issue Guidelines](https://abhitronix.github.io/vidgear/latest/contribution/issue/#submitting-an-issue-guidelines) and wholeheartedly agree. + required: true + - type: checkboxes + attributes: + label: Issue Checklist + description: "By posting this issue you acknowledge the following:" + options: + - label: I have searched open or closed [issues](https://github.com/abhiTronix/vidgear/issues) and found nothing related to my idea. + required: true + - label: I have read the [Documentation](https://abhitronix.github.io/vidgear/latest) and it doesn't mention anything about my idea. + required: true + - label: To my best knowledge, my idea wouldn't break something for other users. + required: true + - type: textarea + attributes: + label: Describe your Idea + description: Please describe your Idea thoroughly here. Will this change the existing VidGear APIs? How? + validations: + required: true + - type: textarea + attributes: + label: Use Cases + description: Please describe how would you use it? How can it benefit other users? + validations: + required: true + - type: textarea + attributes: + label: Any other Relevant Information? + description: Provide any other relevant information if available or else leave this block empty. If applicable, you can also drag-and-drop mockups or screenshots images here, or link to external assets. + placeholder: |- + ex. Related Issue: xyz/foo#4083 + validations: + required: false From acb1a1af8bcb4d8f3c24901613caf11fa2e04cc0 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Mon, 4 Jul 2022 15:32:22 +0530 Subject: [PATCH 44/49] =?UTF-8?q?=F0=9F=8E=A8=20Maintenance:=20Fixed=20typ?= =?UTF-8?q?os=20and=20Polished=20forms.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug_report.yaml | 4 ++-- .github/ISSUE_TEMPLATE/question.yaml | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 738391f5b..650773725 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -13,12 +13,12 @@ body: required: true - type: checkboxes attributes: - label: Acknowledgment + label: Issue Checklist description: "By posting this issue you acknowledge the following:" options: - label: I have searched open or closed [issues](https://github.com/abhiTronix/vidgear/issues) for my problem and found nothing related or helpful. required: true - - label: I have read the [Documentation](https://abhitronix.github.io/vidgear/latest) and found nothing related or helpful. + - label: I have read the [Documentation](https://abhitronix.github.io/vidgear/latest) and found nothing related to my problem. required: true - label: I've read the [Issue Guidelines](https://abhitronix.github.io/vidgear/latest/contribution/issue/#submitting-an-issue-guidelines) and wholeheartedly agree. required: true diff --git a/.github/ISSUE_TEMPLATE/question.yaml b/.github/ISSUE_TEMPLATE/question.yaml index bb58ff92f..e73528c6f 100644 --- a/.github/ISSUE_TEMPLATE/question.yaml +++ b/.github/ISSUE_TEMPLATE/question.yaml @@ -3,26 +3,27 @@ description: Have any questions regarding VidGear? title: "[Question]: " labels: "QUESTION :question:" body: - - type: textarea + - type: checkboxes attributes: - label: Description - description: Please provide a brief description of the question in 1-2 sentences. - validations: - required: true + label: Issue guidelines + description: Please read the Issue guidelines before proceeding. + options: + - label: I've read the [Issue Guidelines](https://abhitronix.github.io/vidgear/latest/contribution/issue/#submitting-an-issue-guidelines) and wholeheartedly agree. + required: true - type: checkboxes attributes: - label: Acknowledgment + label: Issue Checklist description: "By posting this issue you acknowledge the following:" options: - label: I have searched open or closed [issues](https://github.com/abhiTronix/vidgear/issues) for my problem and found nothing related or helpful. required: true - - label: I have read the [Documentation](https://abhitronix.github.io/vidgear/latest) and found nothing related or helpful. + - label: I have read the [Documentation](https://abhitronix.github.io/vidgear/latest) and found nothing related to my problem. required: true - label: I have gone through the [Bonus Examples](https://abhitronix.github.io/vidgear/latest/help/get_help/#bonus-examples) and [FAQs](https://abhitronix.github.io/vidgear/latest/help/get_help/#frequently-asked-questions) and found nothing related or helpful. required: true - type: textarea attributes: - label: Explain your Question + label: Describe your Question description: Please describe your question thoroughly here. What are you trying to accomplish? validations: required: true From 357e9c7114a6ce96af12ca86703fdad52b1c2037 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Mon, 4 Jul 2022 15:44:27 +0530 Subject: [PATCH 45/49] =?UTF-8?q?=F0=9F=8E=A8=20Maintenance:=20Minor=20twe?= =?UTF-8?q?aks=20to=20forms.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug_report.yaml | 8 ++++---- .github/ISSUE_TEMPLATE/question.yaml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 650773725..a4be68d3c 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -1,5 +1,5 @@ name: Bug Report -description: File a bug report for VidGear +description: File a bug report for VidGear 🐛 title: "[Bug]: " labels: ["BUG :bug:", "NEED TRIAGE :police_car:"] assignees: @@ -8,7 +8,7 @@ body: - type: textarea attributes: label: Description - description: Please provide a brief description of the bug in 1-2 sentences, and why you consider it to be a bug? + description: Please provide a brief description of the bug in 1-2 sentences. validations: required: true - type: checkboxes @@ -31,7 +31,7 @@ body: - type: textarea attributes: label: Actual behaviour - description: Please describe precisely what is actually happening. + description: Please describe precisely what is actually happening, and why you consider it to be a bug? validations: required: true - type: textarea @@ -79,7 +79,7 @@ body: attributes: label: Operating System version description: What Operating system you're using? - placeholder: ex. Linux Mint 20.3 “Una” Xfce + placeholder: ex. Linux Mint 20.3 Cinnamon validations: required: true - type: textarea diff --git a/.github/ISSUE_TEMPLATE/question.yaml b/.github/ISSUE_TEMPLATE/question.yaml index e73528c6f..d3b596c80 100644 --- a/.github/ISSUE_TEMPLATE/question.yaml +++ b/.github/ISSUE_TEMPLATE/question.yaml @@ -45,7 +45,7 @@ body: attributes: label: Operating System version description: What Operating system you're using? - placeholder: ex. Linux Mint 20.3 “Una” Xfce + placeholder: ex. Linux Mint 20.3 Cinnamon validations: required: true - type: textarea From 8c909214d20f215a18fd0843e4dc7127b41117ec Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Tue, 5 Jul 2022 10:28:51 +0530 Subject: [PATCH 46/49] =?UTF-8?q?=F0=9F=92=AC=20Docs:=20Updated=20Announce?= =?UTF-8?q?ment=20Block.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ✨ Added feedback link to the Announcement Block for our new DeFFcode library. - 💄 Added and tweaked new glowing text effect with CSS properties. - ✏️ Fixed typos and rewritten some docs. - 💡 Added comments to CSS file. --- README.md | 2 +- docs/help.md | 2 +- docs/index.md | 2 +- docs/overrides/assets/stylesheets/custom.css | 61 ++++++++++++++------ docs/overrides/main.html | 4 ++ 5 files changed, 49 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index b3ce97d2d..d84ede884 100644 --- a/README.md +++ b/README.md @@ -659,7 +659,7 @@ We're offering support for VidGear on [**Gitter Community Channel ➶**](https:/

VidGear is free and open source and will always remain so. :heart:

-It is something I am doing with my own free time. BUT - so much more needs to be done, and I need your help to do this. For just the price of a cup of coffee, you can make a difference :heartpulse: +It is something I am doing with my own free time. But so much more needs to be done, and I need your help to do this. For just the price of a cup of coffee, you can make a difference :slightly_smiling_face:
Buy Me a Coffee at ko-fi.com diff --git a/docs/help.md b/docs/help.md index c02b766eb..a7884f87a 100644 --- a/docs/help.md +++ b/docs/help.md @@ -77,7 +77,7 @@ Let others know how you are using VidGear and why you like it! > Donations help keep VidGear's development alive and motivate me _(as author)_. :heart:{ .heart } -It is (like all open source software) a labour of love and something I am doing with my own free time. If you would like to say thanks, please feel free to make a donation through ko-fi: +It is something I am doing with my own free time. But so much more needs to be done, and I need your help to do this. For just the price of a cup of coffee, you can make a difference :slight_smile: diff --git a/docs/index.md b/docs/index.md index e8c8ee022..1ea3746e1 100644 --- a/docs/index.md +++ b/docs/index.md @@ -116,7 +116,7 @@ You can be a [**Stargazer** :star2:{ .heart }][stargazer] by starring us on Gith > VidGear is free and open source and will always remain so. :heart:{ .heart } -It is something I am doing with my own free time. BUT - so much more needs to be done, and I need your help to do this. For just the price of a cup of coffee, you can make a difference :heartpulse: +It is something I am doing with my own free time. But so much more needs to be done, and I need your help to do this. For just the price of a cup of coffee, you can make a difference :slight_smile: diff --git a/docs/overrides/assets/stylesheets/custom.css b/docs/overrides/assets/stylesheets/custom.css index 639f34b7b..1fcf73fe1 100755 --- a/docs/overrides/assets/stylesheets/custom.css +++ b/docs/overrides/assets/stylesheets/custom.css @@ -320,7 +320,8 @@ blockquote p { .embed-responsive-1by1::before { padding-top: 100%; } -/* ends */ + +/* Handles footer sponsorship block animation */ footer.sponsorship { text-align: center; @@ -400,6 +401,29 @@ footer.sponsorship:not(:hover) .twemoji.heart-throb-hover svg { animation: heart 1000ms infinite; } +footer.sponsorship { + text-align: center; +} + footer.sponsorship hr { + display: inline-block; + width: px2rem(32px); + margin: 0 px2rem(14px); + vertical-align: middle; + border-bottom: 2px solid var(--md-default-fg-color--lighter); +} + footer.sponsorship:hover hr { + border-color: var(--md-accent-fg-color); +} + footer.sponsorship:not(:hover) .twemoji.heart-throb-hover svg { + color: var(--md-default-fg-color--lighter) !important; +} + +/* Tweaks to body appearance */ + +[data-md-color-scheme="slate"] { + --md-hue: 260; +} + body[data-md-color-scheme="slate"] img[class="shadow"]{ -webkit-filter: drop-shadow(2px 2px 1px rgba(0, 0, 0, 0.5)); filter: drop-shadow(2px 2px 1px rgba(0, 0, 0, 0.5)); @@ -425,23 +449,22 @@ body[data-md-color-scheme="slate"] img[class="shadow2"]{ filter: drop-shadow(1px 1px 0 black); } -footer.sponsorship { - text-align: center; -} - footer.sponsorship hr { - display: inline-block; - width: px2rem(32px); - margin: 0 px2rem(14px); - vertical-align: middle; - border-bottom: 2px solid var(--md-default-fg-color--lighter); -} - footer.sponsorship:hover hr { - border-color: var(--md-accent-fg-color); -} - footer.sponsorship:not(:hover) .twemoji.heart-throb-hover svg { - color: var(--md-default-fg-color--lighter) !important; +/* Glow text effect */ + +x-sign { + color: white; + text-shadow: + 0 0 10px var(--md-code-hl-keyword-color), + 0 0 20px var(--md-code-hl-constant-color), + 0 0 40px var(--md-code-hl-function-color), + 0 0 80px var(--md-code-hl-special-color); + will-change: filter, color; + filter: saturate(60%); + animation: flicker steps(100) 1s 1s infinite; } - -[data-md-color-scheme="slate"] { - --md-hue: 260; + +@keyframes flicker { + 50% { + filter: saturate(150%) hue-rotate(20deg); + } } \ No newline at end of file diff --git a/docs/overrides/main.html b/docs/overrides/main.html index bc6e2dbda..df9f67005 100644 --- a/docs/overrides/main.html +++ b/docs/overrides/main.html @@ -22,6 +22,10 @@ {% endblock %} +{% block announce %} + + {% include ".icons/material/message-alert.svg" %} Hey, checkout our new Deffcode library that will replace OpenCV soon. We’d love to hear your feedback! +{% endblock %} {% block outdated %} You're not viewing the latest version. From 89c43ac71801645959e6ebc34052951af54ded9f Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Tue, 5 Jul 2022 12:22:43 +0530 Subject: [PATCH 47/49] =?UTF-8?q?=E2=8F=AA=EF=B8=8F=20CI:=20Reverted=20to?= =?UTF-8?q?=20mkdocs-material=20release=20installation.=20(Fixed=20#318)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Bug fix has been released as part of new version `8.3.9`. --- .github/workflows/deploy_docs.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 6c6b36d30..f3f7c9a53 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -47,9 +47,7 @@ jobs: if: success() - name: install_dependencies run: | - pip install -U mkdocs - pip install https://github.com/squidfunk/mkdocs-material/archive/master.zip - pip install -U mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike mkdocstrings mkdocstrings-python-legacy + pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike mkdocstrings mkdocstrings-python-legacy pip install jinja2==3.0.* if: success() - name: git configure @@ -90,9 +88,7 @@ jobs: if: success() - name: install_dependencies run: | - pip install -U mkdocs - pip install https://github.com/squidfunk/mkdocs-material/archive/master.zip - pip install -U mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike mkdocstrings mkdocstrings-python-legacy + pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike mkdocstrings mkdocstrings-python-legacy pip install jinja2==3.0.* if: success() - name: git configure @@ -136,9 +132,7 @@ jobs: if: success() - name: install_dependencies run: | - pip install -U mkdocs - pip install https://github.com/squidfunk/mkdocs-material/archive/master.zip - pip install -U mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike mkdocstrings mkdocstrings-python-legacy + pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike mkdocstrings mkdocstrings-python-legacy pip install jinja2==3.0.* if: success() - name: git configure From 78248b1fc089460a3fe3d19753c37bbe8fe09b62 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Tue, 5 Jul 2022 17:29:24 +0530 Subject: [PATCH 48/49] =?UTF-8?q?=F0=9F=93=9D=20Docs:=20Updated=20`changel?= =?UTF-8?q?og.md`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/changelog.md | 85 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) diff --git a/docs/changelog.md b/docs/changelog.md index 7af90d699..aef330e1a 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -20,6 +20,89 @@ limitations under the License. # Release Notes +## v0.2.6 (2022-07-05) + +??? tip "New Features" + - [x] **Docs:** + * Added new bonus example for RSTP/RTP Live-Streaming using WriteGear's Compression Mode. + * Added "How to resolve zmq.error.ZMQError" FAQ for NetGear API.(PR by @iandol) + * Added new ko-fi button to README.md + - [x] **Maintenance:** + * Added new patterns to `.gitignore` to ignore pypi's `build` directory and `egg-info` files. + - [x] **CI:** + * Switched to new Issue GitHub's form schema using YAML + + Added new `bug_report.yaml`. + + Added new `question.yaml`. + + Added new `proposal.yaml`. + + Deleted depreciated markdown files. + + Polished forms. + +??? success "Updates/Improvements" + - [x] Setup.py: + * Bumped version to `0.2.6`. + * Updated logic operators and dependency. + + Replaced `>=` comparsion operator with more flexible `~=`. + + Replaced `distutils.version.LooseVersion` with `pkg_resources.parse_version`. + - [x] Docs: + * Updated Site Navigation. + + Added new notices to inform users more effectively about bonus examples. + + Added new `Bonus` section to navigation and moved suitable pages under it. + + Updated headings and URLs. + * Redesigned and Rewritten Donation and Contribution section to README.md + * Updated Zenodo badge and bibtex entry. + * Updated Admonition Icon, FAQs and site-links. + * Reformatted code and its comments. + * Updated `changelog.md`. + - [x] API: + * Updated depreciated tostring() to tobytes(). `tostring` was renamed to `tobytes` for the purposes for clarity in Python 3.2. https://docs.python.org/3/library/array.html#array.array.tobytes + - [x] CI: + * Added more paths and files to skip commits. + +??? danger "Breaking Updates/Changes" + - [ ] `-input_framerate` parameter now accepts any positive value for WriteGear and StreamGear APIs. + +??? bug "Bug-fixes" + - [x] API: + * Fixed `-input_framerate` less than 5 does not get used in WriteGear and StreamGear APIs.(PR by @freol35241) + - [x] CamGear: Fixed Yt-dlp generated HTTP DASH Segments URLs not supported by OpenCV's VideoCapture(PR by @DynamiteC) + - [x] StreamGear: + * Fixed `hls_segment_type` not working bug. (PR by @enarche-ahn) + * Fixed critical logging parameter bug + + Fixed debug logs even when `logging=False` in StreamGear's Real-time Mode. (patch suggested by @enarche-ahn) + + Added length check to `-video_source` attribute to correctly infers it as empty(or invalid). + - [x] CI: + * Xfailed RSTP CamGear CI test. + * Fixed pinned version syntax bug in docs_deployer workflow. + * Fixed typos in Github forms and its context. + * Added missing dependency. + - [x] Docs: + * Fixed jinja2 `3.1.0` or above breaks mkdocs. + + `jinja2>=3.1.0` breaks mkdocs (mkdocs/mkdocs#2799), therefore pinned jinja2 version to `<3.1.0`. + * Fixed support for new `mkdocstring` versions + + Replaced rendering sub-value with options. + + Removed pinned `mkdocstrings==0.17.0` version. + * Fixed Netgear+Webgear bonus example code bugs.(PR by @iandol) + + Added a missing import. + + Removed `self.` typo. + + Replaced the `return` value with `break` in the async as it triggers an error. + * Fixed external bug that causing "Home" tab to irresponsive randomly when accessed from other tabs. + * Fixed indentation and spacing. + * Fixed typos and updated context. + * Removed dead code. + +??? question "Pull Requests" + * PR #288 + * PR #290 + * PR #293 + * PR #295 + * PR #307 + * PR #313 + * PR #320 + +  + +  + ## v0.2.5 (2021-02-11) ??? tip "New Features" @@ -85,7 +168,7 @@ limitations under the License. * Fixed UnboundLocalError bug. - [x] Setup: Fixed uvicorn and aiortc dropped support for Python-3.6 legacies. - [x] CI: - * Fixed GitHub Actions interprets 3.10 as 3.1 if used without strings. + * Fixed GitHub Actions interprets `3.10` as `3.1` if used without strings. * Fixed naming error in azure YAML. - [x] Docs: * Fixed codecov badge URL in README.md From 4898dddb883a40773062dd523f59166faa15af26 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Tue, 5 Jul 2022 18:02:22 +0530 Subject: [PATCH 49/49] =?UTF-8?q?=E2=9C=A8=20Docs:=20Added=20new=20contrib?= =?UTF-8?q?utors=20block=20to=20changelog.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/changelog.md | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index aef330e1a..4383d3dba 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -27,6 +27,7 @@ limitations under the License. * Added new bonus example for RSTP/RTP Live-Streaming using WriteGear's Compression Mode. * Added "How to resolve zmq.error.ZMQError" FAQ for NetGear API.(PR by @iandol) * Added new ko-fi button to README.md + * Added new contributors block to changelog.md - [x] **Maintenance:** * Added new patterns to `.gitignore` to ignore pypi's `build` directory and `egg-info` files. - [x] **CI:** @@ -99,6 +100,12 @@ limitations under the License. * PR #313 * PR #320 +??? new "New Contributors" + * @iandol + * @freol35241 + * @enarche-ahn + * @DynamiteC +     @@ -183,6 +190,7 @@ limitations under the License. * PR #283 * PR #284 +     @@ -306,6 +314,8 @@ limitations under the License. * PR #272 * PR #274 +??? new "New Contributors" + * @zpapakipos   @@ -410,6 +420,8 @@ limitations under the License. * PR #249 * PR #262 +??? new "New Contributors" + * @Vboivin   @@ -823,6 +835,8 @@ limitations under the License. * PR #239 * PR #243 +??? new "New Contributors" + * @kpetrykin   @@ -1098,6 +1112,9 @@ limitations under the License. * PR #203 * PR #206 +??? new "New Contributors" + * @bml1g12 +     @@ -1699,6 +1716,10 @@ limitations under the License. * PR #118 * PR #124 +??? new "New Contributors" + * @cclauss + * @chollinger93 +   @@ -1813,7 +1834,8 @@ limitations under the License. - [x] PR #82 - [x] PR #84 - +??? new "New Contributors" + * @BoboTiG   @@ -1880,8 +1902,6 @@ limitations under the License. - [x] PR #33 - [x] PR #34 - -