Skip to content

Commit

Permalink
⚡️ New Major enhancements @abhiTronix (#183)
Browse files Browse the repository at this point in the history
- CamGear: Support for various Live-Video-Streaming services (Fixes #160)
	- Added seamless support for live video streaming sites like Twitch, LiveStream, Dailymotion etc.
	- Implemented flexible framework around `streamlink` python library with easy control over parameters and quality.
	- Stream Mode can now automatically detects whether `source` belong to YouTube or elsewhere, and handles it with appropriate API.
	- Added additional `STREAM_QUALITY` and `STREAM_PARAMS` attributes.
	- Updated docs with all new additions and examples.
	- Moved WebGear API to Streaming Gears.
	- Added `restore_levelnames` auxiliary method.
	- Updated CI tests, `setup.py` and `ReadMe.md`.
	- Fixed Several logging bugs.

- Logging: Added file support (Fixes #182)
	- Added `VIDGEAR_LOGFILE` environment variable to manually add file/dir path.
	- Reworked `logger_handler()` Helper methods (in asyncio too).
	- Added new formatter and Filehandler for handling logger files.
	- Added auto version extraction from package `version.py` in setup.py.

- CamGear: Re-implemented YouTube URLs Handler (Fixes #133)
	:warning: `y_tube` parameter renamed as `stream_mode`!
	:warning: Removed `FORCE_YTUBE_VAMODE` attribute.

	- Re-implemented CamGear's YouTube URLs Handler completely from scratch.
	- New Robust Logic to flexibly handing video and video-audio streams.
	- Intelligent stream selector for selecting best possible stream compatible with OpenCV.
	- Added support for selecting stream qualities and parameters.
	- Added additional `STREAM_QUALITY` and `STREAM_PARAMS` attributes for CamGear.
	- Implemented new `get_supported_quality` helper method for handling specified qualities
	- Fixed Live-Stream URLs not supported by OpenCV's Videocapture and its FFmpeg.
	
- CI: Maintance Updates
	- Added support for new `VIDGEAR_LOGFILE` environment variable in Travis CI.
	- Fixed failing CI tests.
	- Added missing CI tests.
	- Added logging for helper functions.
	- Updated `contributing.md`

- Bash Scripts: Fixed OpenCV Release binaries detection bugs
- Docs: Few minor additions and fixes
- Bumped `dev` version.
- Docs: Quick typo fixed
- CI: Bumped codecov
- CI: Bugs fixed
  • Loading branch information
abhiTronix authored Dec 29, 2020
2 parents d0dfd90 + f963eea commit b31ca58
Show file tree
Hide file tree
Showing 38 changed files with 1,021 additions and 373 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ before_script:
bash scripts/bash/prepare_dataset.sh;
python -m pip install .;
fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ $TRAVIS_PYTHON_VERSION == 3.7 ]]; then
mkdir -p $HOME/logs;
export VIDGEAR_LOGFILE=$HOME/logs;
fi

script:
- function keep_alive() { while true; do echo -en "\a"; sleep 60; done }
Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ limitations under the License.

 

VidGear is a **High-Performance Video Processing Python Library** that provides an easy-to-use, highly extensible, **Multi-Threaded + Asyncio Framework** on top of many state-of-the-art specialized libraries like *[OpenCV][opencv], [FFmpeg][ffmpeg], [ZeroMQ][zmq], [picamera][picamera], [starlette][starlette], [pafy][pafy], [pyscreenshot][pyscreenshot] and [python-mss][mss]* at its backend, and enable us to flexibly exploit their internal parameters and methods, while silently delivering robust error-handling and unparalleled real-time performance.
VidGear is a **High-Performance Video Processing Python Library** that provides an easy-to-use, highly extensible, **Multi-Threaded + Asyncio Framework** on top of many state-of-the-art specialized libraries like *[OpenCV][opencv], [FFmpeg][ffmpeg], [ZeroMQ][zmq], [picamera][picamera], [starlette][starlette], [streamlink][streamlink], [pafy][pafy], [pyscreenshot][pyscreenshot] and [python-mss][mss]* at its backend, and enable us to flexibly exploit their internal parameters and methods, while silently delivering robust error-handling and unparalleled real-time performance.

VidGear primarily focuses on simplicity, and thereby lets programmers and software developers to easily integrate and perform Complex Video Processing Tasks, in just a few lines of code.

Expand Down Expand Up @@ -127,7 +127,7 @@ Each API is designed exclusively to handle/control/process different data-specif

**A. Video-Capture Gears:**

* [**CamGear:**](#camgear) Multi-Threaded API targeting various IP-USB-Cameras/Network-Streams/YouTube-Video-URLs.
* [**CamGear:**](#camgear) Multi-Threaded API targeting various IP-USB-Cameras/Network-Streams/Streaming-Sites-URLs.
* [**PiGear:**](#pigear) Multi-Threaded API targeting various Raspberry-Pi Camera Modules.
* [**ScreenGear:**](#screengear) Multi-Threaded API targeting ultra-fast Screencasting.
* [**VideoGear:**](#videogear) Common Video-Capture API with internal [Video Stabilizer](https://abhitronix.github.io/vidgear/gears/stabilizer/overview/) wrapper.
Expand All @@ -140,14 +140,16 @@ Each API is designed exclusively to handle/control/process different data-specif

* [**StreamGear**](#streamgear): Handles Transcoding of High-Quality, Dynamic & Adaptive Streaming Formats.

* **Asynchronous I/O Streaming Gear:**

* [**WebGear:**](#webgear) ASGI Video-Server that broadcasts Live Video-Frames to any web-browser on the network.

**D. Network Gears:**

* [**NetGear:**](#netgear) Handles High-Performance Video-Frames & Data Transfer between interconnecting systems over the network.

* **Asynchronous I/O Network Gears:**
* **Asynchronous I/O Network Gear:**

* [**WebGear:**](#webgear) ASGI Video-Server that broadcasts Live Video-Frames to any web-browser on the network.
* [**NetGear_Async:**](#netgear_async) Immensely Memory-Efficient Asyncio Video-Frames Network Messaging Framework.


Expand All @@ -162,9 +164,9 @@ Each API is designed exclusively to handle/control/process different data-specif
<img src="docs/overrides/assets/images/camgear.png" alt="CamGear Functional Block Diagram" width="45%"/>
</p>

> *CamGear can grab ultra-fast frames from a diverse range of file-formats/devices/streams, which includes almost any IP-USB Cameras, multimedia video file-formats ([_upto 4k tested_][test-4k]), various network stream protocols such as `http(s), rtp, rstp, rtmp, mms, etc.`, plus support for live GStreamer's and YouTube video/live stream pipeline.*
> *CamGear can grab ultra-fast frames from a diverse range of file-formats/devices/streams, which includes almost any IP-USB Cameras, multimedia video file-formats ([_upto 4k tested_][test-4k]), various network stream protocols such as `http(s), rtp, rstp, rtmp, mms, etc.`, and GStreamer's pipelines, plus direct support for live video streaming sites like YouTube, Twitch, LiveStream, Dailymotion etc.*
CamGear implements a flexible, high-level, multi-threaded framework around `OpenCV's` [VideoCapture class][opencv-vc] with access almost all of its available parameters and also employs [`pafy`][pafy] python APIs for live [YouTube pipelining][youtube-doc]. Furthermore, its framework relies exclusively on [**Threaded Queue mode**][TQM-doc] for ultra-fast, error-free, and synchronized video-frame handling.
CamGear implements a flexible, high-level, multi-threaded framework around OpenCV's [VideoCapture class][opencv-vc] with access almost all of its available parameters. CamGear also employs [streamlink][streamlink] for [piping live videos][piping-live-videos] from various streaming services and also utilizies [pafy][pafy] with [youtube-dl][youtube-dl] at its backend for [YouTube pipelining][youtube-doc]. Furthermore, its framework relies exclusively on [**Threaded Queue mode**][TQM-doc] for ultra-fast, error-free, and synchronized video-frame handling.

### CamGear API Guide:

Expand Down Expand Up @@ -686,6 +688,7 @@ Internal URLs
[doc-vidgear-purpose]:https://abhitronix.github.io/vidgear/help/motivation/#why-is-vidgear-a-thing
[live-stream]:https://abhitronix.github.io/vidgear/gears/writegear/compression/usage/#using-compression-mode-for-streaming-urls
[live-audio-doc]:https://abhitronix.github.io/vidgear/gears/writegear/compression/usage/#using-compression-mode-with-live-audio-input
[piping-live-videos]:https://abhitronix.github.io/vidgear/gears/camgear/usage/#using-camgear-with-streaming-websites
[ffmpeg-doc]:https://abhitronix.github.io/vidgear/gears/writegear/compression/advanced/ffmpeg_install/
[youtube-doc]:https://abhitronix.github.io/vidgear/gears/camgear/usage/#using-camgear-with-youtube-videos
[TQM-doc]:https://abhitronix.github.io/vidgear/bonus/TQM/#threaded-queue-mode
Expand Down Expand Up @@ -725,6 +728,8 @@ External URLs
-->
[asyncio-zmq]:https://pyzmq.readthedocs.io/en/latest/api/zmq.asyncio.html
[uvloop]: https://github.com/MagicStack/uvloop
[streamlink]:https://streamlink.github.io/
[youtube-dl]:https://youtube-dl.org/
[pyscreenshot]:https://github.com/ponty/pyscreenshot
[uvloop-ns]: https://github.com/MagicStack/uvloop/issues/14
[ffmpeg]:https://www.ffmpeg.org/
Expand Down
51 changes: 23 additions & 28 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,80 +18,75 @@ limitations under the License.
===============================================
-->

# Contribution Overview
<img src="https://abhitronix.github.io/vidgear/assets/images/contribute.webp" alt="VidGear Contribution" loading="lazy" width="90%" />

Contributions are welcome, We'd love your contribution to VidGear in order to fix bugs or to implement new features!

# Contribution Overview

> If you're looking for something to work on, check for the [PR WELCOMED :mailbox_with_mail:](https://github.com/abhiTronix/vidgear/issues?q=is%3Aissue+is%3Aopen+label%3A%22PR+WELCOMED+%3Amailbox_with_mail%3A%22) labeled issues on our GitHub Repository.

Contributions are welcome, We'd love your contribution to VidGear in order to fix bugs or to implement new features!

&nbsp;
> 💡 If you're looking for something to work on, check for the [PR WELCOMED :mailbox_with_mail:](https://github.com/abhiTronix/vidgear/issues?q=is%3Aissue+is%3Aopen+label%3A%22PR+WELCOMED+%3Amailbox_with_mail%3A%22) labeled issues on our GitHub Repository.
&nbsp;
&thinsp;

## Submission Contexts

### Got a question or problem?


For quick questions, please refrain from opening an issue, instead read our [FAQ & Troubleshooting](https://abhitronix.github.io/vidgear/help/get_help/#frequently-asked-questions) section or you can reach us on [Gitter][gitter] community channel.
For quick questions, please refrain from opening an issue, instead read our [FAQ & Troubleshooting](https://abhitronix.github.io/vidgear/help/get_help/#frequently-asked-questions) section or you can reach us on [Gitter](https://gitter.im/vidgear/community) community channel.


### Found a typo?

There's no need to contribute for some typos. Just reach us on [Gitter][gitter] community channel, We will correct them in (less than) no time.
There's no need to contribute for some typos. Just reach us on [Gitter](https://gitter.im/vidgear/community) community channel, We will correct them in (less than) no time.


### Found a bug?

If you encountered a bug, you can help us by submitting an issue in our GitHub repository. Even better, you can submit a Pull Request(PR) with a fix, but make sure to read the [guidelines](#submission-guidelines).
If you encountered a bug, you can help us by submitting an issue in our GitHub repository. Even better, you can submit a Pull Request(PR) with a fix, but make sure to read the [guidelines ➶](#submission-guidelines).


### Request for a feature/improvement?

### Missing a feature/improvement?
> 💡 You can [subscribe our GitHub Repository](https://github.com/abhiTronix/vidgear/watchers) to receive notifications through email for new pull requests, commits and issues that are created in VidGear. _Learn more about it [here ➶](https://help.github.com/en/github/managing-subscriptions-and-notifications-on-github/viewing-your-subscriptions)_
> You can [subscribe our GitHub Repository](https://github.com/abhiTronix/vidgear/watchers) to receive notifications through email for new pull requests, commits and issues that are created in VidGear. _Learn more about it [here ➶](https://help.github.com/en/github/managing-subscriptions-and-notifications-on-github/viewing-your-subscriptions)_
You can request our GitHub Repository for a new feature/improvement based on the type of request:

You can request a new feature by [submitting an issue](https://abhitronix.github.io/vidgear/contribution/issue/) to our GitHub Repository. If you would like to implement a new feature/improvement, please [submit an issue with a proposal template](https://abhitronix.github.io/vidgear/contribution/issue/proposal) for your work first, to be sure that it is benefit for everyone in the community, and then [submit a Pull Request](https://abhitronix.github.io/vidgear/contribution/PR/). Based on the type of request, you can consider following:
> Please [submit an issue with a proposal template](https://github.com/abhiTronix/vidgear/issues/new?labels=issue%3A+proposal&template=proposal.md) for your request to explain how it benefits everyone in the community.
* **Major Feature Requests:** If you require a major feature for VidGear, then first open an issue and outline your proposal so that it can be discussed. This will also allow us to better coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully accepted into the project. The purposed feature, if accepted, may take time based on its complexity and availability/time-schedule of our maintainers, but once it's completed, you will be notified right away. Please be patient!
* **Major Feature Requests:** If you require a major feature for VidGear, then first [open an issue](https://abhitronix.github.io/vidgear/contribution/issue/) and outline your proposal so that it can be discussed. This will also allow us to better coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully accepted into the project. The purposed feature, if accepted, may take time based on its complexity and availability/time-schedule of our maintainers, but once it's completed, you will be notified right away. Please be patient!

* **Minor Feature Requests:** Small features and bugs resolved on priority and can be directly submitted as a Pull Request. You just have to [submit an issue](https://abhitronix.github.io/vidgear/contribution/issue/) to our GitHub Repository.
* **Minor Feature Requests:** Small features and bugs resolved on priority. You just have to [submit an issue](https://abhitronix.github.io/vidgear/contribution/issue/) to our GitHub Repository.

&nbsp;
&thinsp;

## Submission Guidelines

- [Submitting an Issue Guidelines](https://abhitronix.github.io/vidgear/contribution/issue/)
- [Submitting Pull Request(PR) Guidelines](https://abhitronix.github.io/vidgear/contribution/PR/)


&nbsp;

&nbsp;

&thinsp;

## Community Channel

If you've come up with some new idea, or looking for the fastest way troubleshoot your problems, then please **join our [Gitter community channel][gitter]**.

&nbsp;

&nbsp;
&thinsp;

## Become a Stargazer

You can be a [**Stargazer**][stargazer] by starring this framework, it helps us a lot and **you're making it easier for others to find & trust this library.** Thanks!

&nbsp;
You can be a [**Stargazer 🌟**][stargazer] by starring this framework, it helps us a lot and **you're making it easier for others to find & trust this library.** Thanks!

&nbsp;
&thinsp;


## Love using VidGear?

**VidGear is free, but rely on your support.**
> VidGear is free, but rely on your support :heart:
Sending a donation using link below is **extremely** helpful in keeping VidGear development alive:
Donations help keep VidGear development alive. Small contributions can make a huge difference.


[![ko-fi][kofi-badge]][kofi]
Expand Down
4 changes: 2 additions & 2 deletions docs/bonus/TQM.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ limitations under the License.

> Threaded Queue Mode is designed exclusively for VidGear's Videocapture Gears _(namely CamGear, ScreenGear, VideoGear)_ and few Network Gears _(such as NetGear(Client's end))_ for achieving high-performance, synchronized, and error-free video-frames handling with their **Internal Multi-Threaded Frame Extractor Daemons**.
!!! info "Threaded-Queue-Mode is enabled by default, but a user [can disable it](), if extremely necessary."
!!! info "Threaded-Queue-Mode is enabled by default, but a user [can disable it](#manually-disabling-threaded-queue-mode), if extremely necessary."

&nbsp;

Expand Down Expand Up @@ -85,7 +85,7 @@ To manually disable Threaded-Queue-Mode, VidGear provides `THREADED_QUEUE_MODE`
**`THREADED_QUEUE_MODE`** _(boolean)_: This attribute can be used to override Threaded-Queue-Mode mode to manually disable it:

```python
options = {'THREADED_QUEUE_MODE': False} #to disable Threaded Queue Mode.
options = {'THREADED_QUEUE_MODE': False} # to disable Threaded Queue Mode.
```

and you can pass it to `options` dictionary parameter of the respective API.
Expand Down
10 changes: 6 additions & 4 deletions docs/bonus/colorspace_manipulation.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ limitations under the License.

# Colorspace Manipulation for VideoCapture Gears

## Source ColorSpace manipulation

<figure>
<img src="../../assets/images/colorspace.png" alt="Colorspace" loading="lazy" width="70%" />
<figcaption>BGR Colorspace</figcaption>
</figure>

All VidGear's VideoCapture Gears, namely CamGear, PiGear, ScreenGear, and VideoGear - internally supports Source ColorSpace manipulation. **There are two ways to alter source colorspace:**

## Source ColorSpace manipulation

> All VidGear's Videocapture Gears _(namely CamGear, ScreenGear, VideoGear)_ and some Streaming Gears _(WebGear)_ and Network Gears _(Client's end)_ - provides exclusive internal support for ==Source [Color Space](https://en.wikipedia.org/wiki/Color_space) manipulation==.
**There are two ways to alter source colorspace:**

### Using `colorspace` parameter

Expand Down
12 changes: 12 additions & 0 deletions docs/bonus/reference/helper.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ limitations under the License.

&nbsp;

::: vidgear.gears.helper.check_gstreamer_support

&nbsp;

::: vidgear.gears.helper.get_supported_resolution

&nbsp;

::: vidgear.gears.helper.dimensions_to_resolutions

&nbsp;

::: vidgear.gears.helper.mkdir_safe

&nbsp;
Expand Down
Loading

0 comments on commit b31ca58

Please sign in to comment.