Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚡️ WebGear_RTC: Implemented a new easy way of defining Custom Streaming Class #272

Merged
merged 4 commits into from
Dec 2, 2021

Conversation

abhiTronix
Copy link
Owner

Description

With this PR, WebGear_RTC now provides custom_stream attribute with its options parameter that allows you to easily define your own Custom Streaming Class with suitable source that you want to use to transform your frames before sending them onto the browser. This implementation support Auto-Reconnection or Auto-Refresh works out-of-the-box.

Notable Changes:

  • 💥 Removed support for assigning Custom Media Server Class(inherited from aiortc's VideoStreamTrack) in WebGear_RTC through its config global parameter.
  • ✨ Added new custom_stream attribute with WebGear_RTC options parameter that allows you to easily define your own Custom Streaming Class with suitable source(such as OpenCV).
  • ⚡️ This implementation supports repeated Auto-Reconnection or Auto-Refresh out-of-the-box.
  • 🧑‍💻 This implementation is more user-friendly and easy to integrate within complex APIs.
  • 🎨 This implementation supports all vidgear's VideoCapture APIs readily as input.
  • 🏗️ This implementation requires at-least read() and stop() methods implemented within Custom Streaming Class, otherwise WebGear_RTC will throw ValueError.
  • 🥚 WebGear_RTC API now automatically constructs av.frame.Frame from numpy.nd.array based on available channels in frames.
  • 🏗️ WebGear_RTC API will now throws ValueError if source parameter is None and custom_stream attribute isn't defined.
  • CI:
    • 👷 Updated CI tests for new WebGear_RTC custom streaming class.
  • Docs:
    • 📝 Added related usage docs for new WebGear_RTC custom streaming class.
    • 📝 Updated Advanced examples using WebGear_RTC's custom streaming class.
    • 👽️ Added changes for upgrading mkdocs-material from 7.x to 8.x in docs.
    • 🚸 Added outdated version warning block.
    • 🐛 Fixed content tabs failing to work.
    • 🚩 Updated WebGear_RTC parameters.
    • 🔥 Removed slugify from mkdocs causing invalid hyperlinks in docs.
    • 🐛 Fixed hyperlink in announcement bar.
    • 💄 Updated code highlighting.

Requirements / Checklist

Related Issue

#258

Context

Currently for using OpenCV with WebGear_RTC we use Custom Source/Server which do not implement close_connection route or __reset_connections internal function. With this PR, WebGear_RTC now provides custom_stream attribute with its options parameter that allows you to easily define your own Custom Streaming Class with suitable source which can seamlessly handle restarting of source/server any number of times.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

…ng Class. (Fixes #258)

💥 Removed support for assigning Custom Media Server Class(inherited from aiortc's VideoStreamTrack) in WebGear_RTC through its `config` global parameter.

- ✨ Added new `custom_stream` attribute with WebGear_RTC `options` parameter that allows you to easily define your own Custom Streaming Class with suitable source(such as OpenCV).
- ⚡️ This implementation supports repeated Auto-Reconnection or Auto-Refresh out-of-the-box.
- 🧑‍💻 This implementation is more user-friendly and easy to integrate within complex APIs.
- 🎨 This implementation supports all vidgear's VideoCapture APIs readily as input.
- 🏗️ This implementation requires at-least `read()` and `stop()` methods implemented within Custom Streaming Class, otherwise WebGear_RTC will throw ValueError.
- 🥚 WebGear_RTC API now automatically constructs `av.frame.Frame` from `numpy.nd.array` based on available channels in frames.
- 🏗️ WebGear_RTC API will now throws ValueError if `source` parameter is None and `custom_stream` attribute isn't defined.

CI:
- 👷 Updated CI tests for new WebGear_RTC custom streaming class.

Docs:
- 📝 Added related usage docs for new WebGear_RTC custom streaming class.
- 📝 Updated Advanced examples using WebGear_RTC's custom streaming class.
- 👽️ Added changes for upgrading mkdocs-material from 7.x to 8.x in docs.
- 🚸 Added outdated version warning block.
- 🐛 Fixed content tabs failing to work.
- 🚩 Updated WebGear_RTC parameters.
- 🔥 Removed slugify from mkdocs causing invalid hyperlinks in docs.
- 🐛 Fixed hyperlink in announcement bar.
- 💄 Updated code highlighting.
@abhiTronix abhiTronix self-assigned this Dec 1, 2021
@abhiTronix abhiTronix added DOCS 📜 Issue/PR is related to vidgear docs. ENHANCEMENT ⚡ New Feature/Addition/Improvement WORK IN PROGRESS 🚧 currently been worked on. labels Dec 1, 2021
@abhiTronix abhiTronix added this to In progress in VidGear v0.2.4 via automation Dec 1, 2021
@abhiTronix abhiTronix added this to the 0.2.4 milestone Dec 1, 2021
@abhiTronix abhiTronix added the PROPOSAL 📩 A proposal/proposition label Dec 1, 2021
@abhiTronix abhiTronix added the CI IGNORED ✖️ CI test reports are ignored for this PR. label Dec 1, 2021
@codecov
Copy link

codecov bot commented Dec 1, 2021

Codecov Report

Merging #272 (c0c66e5) into testing (0cb52d1) will increase coverage by 4.52%.
The diff coverage is 86.95%.

Impacted file tree graph

@@             Coverage Diff             @@
##           testing     #272      +/-   ##
===========================================
+ Coverage    90.24%   94.76%   +4.52%     
===========================================
  Files           16       16              
  Lines         3034     3040       +6     
===========================================
+ Hits          2738     2881     +143     
+ Misses         296      159     -137     
Impacted Files Coverage Δ
vidgear/gears/asyncio/webgear_rtc.py 94.97% <86.95%> (+1.41%) ⬆️
vidgear/gears/screengear.py 90.51% <0.00%> (+1.45%) ⬆️
vidgear/gears/helper.py 94.06% <0.00%> (+1.69%) ⬆️
vidgear/gears/videogear.py 100.00% <0.00%> (+3.84%) ⬆️
vidgear/gears/camgear.py 88.30% <0.00%> (+4.67%) ⬆️
vidgear/gears/pigear.py 100.00% <0.00%> (+84.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0cb52d1...c0c66e5. Read the comment docs.

@abhiTronix abhiTronix removed the CI IGNORED ✖️ CI test reports are ignored for this PR. label Dec 2, 2021
@abhiTronix abhiTronix merged commit cd481c1 into testing Dec 2, 2021
VidGear v0.2.4 automation moved this from In progress to Done Dec 2, 2021
@abhiTronix abhiTronix deleted the development branch December 2, 2021 02:56
@abhiTronix abhiTronix added SOLVED 🏁 This issue/PR is resolved now. Goal Achieved! and removed WORK IN PROGRESS 🚧 currently been worked on. labels Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DOCS 📜 Issue/PR is related to vidgear docs. ENHANCEMENT ⚡ New Feature/Addition/Improvement PROPOSAL 📩 A proposal/proposition SOLVED 🏁 This issue/PR is resolved now. Goal Achieved!
Projects
No open projects
1 participant