Releases: abhiTronix/vidgear
VidGear Stable v0.3.3
This update significantly enhances Vidgear's capabilities, ensuring better performance, broader compatibility, and improved user experience. The introduction of the Picamera2 API support, enhanced error handling, and detailed documentation updates are pivotal in making Vidgear more robust and user-friendly.
📓 Complete Release Notes can be found here
VidGear is free and open source and will always remain so. ❤️
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 🙂
What's Changed
New Features ✨
- PiGear:
- Official Support for Picamera2 API backend:
- This massive update brings official support for the new Picamera2 API, unlocking powerful features for Raspberry Pi Camera Modules and limited USB camera support.
- Seamless Python wrapper: A robust wrapper around Picamera2 API library simplifies integration with minimal code changes for existing PiGear users.
- Enhanced camera control: Leverages libcamera API under the hood for Raspberry Pi Camera Modules.
- Existing compatibility: Maintains compatibility with PiGear's existing super-charged multi-threaded and colorspace manipulation framework.
- Proper Resource management: Ensures proper resource release during PiGear termination.
- USB camera support (limited): Provides basic functionality for USB webcams. PiGear could accurately differentiates between USB and Raspberry Pi cameras using metadata.
- Backward compatibility: Seamlessly switches to the legacy Picamera library backend if Picamera2 is unavailable.
- Standalone functionalities: Standalone functionalities for both legacy
picameraand newerpicamera2backends for clarity. - Advanced optional parameters handling: Handles camera configurational parameters and user-defined settings for various camera types.
- Official Support for Picamera2 API backend:
- StreamGear:
- Introduced new
-enable_force_terminationattribute for immediate FFmpeg process termination.
- Introduced new
- Helper:
- Added support for SRTP/RTSPS in
is_valid_urlfunction:- SRTP/RTSPS extends RTSP/RTP to encrypt video and audio data using the same ciphers as HTTPS, typically AES with a 128-bit key length.
- Added a custom deprecated decorator to mark deprecated functions and parameters.
- Added support for SRTP/RTSPS in
Updates/Improvements ⚡️
- Core:
- Improved exception handling for module imports.
- Improved colorspace handling in videocapture gears.
- Asyncio:
- Replaced deprecated Starlette's
on_shutdownparameter with an async context managerlifespanin WebGear and WebGear_RTC APIs.
- Replaced deprecated Starlette's
- NetGear_Async API:
- Changed launch method to use
self.loop.create_task()instead ofasyncio.ensure_future() - Moved the event loop initialization code to an earlier point before setting event loop policy to ensure it is set up correctly before selecting
WindowsSelectorEventLooppolicy.
- Changed launch method to use
- StreamGear:
- Updated
close()methods for handling gracefully signal interruptions based on different operating systems with device audio streams. - Enhanced stream copy support in Single Source mode.
- Updated
- NetGear:
- Handled socket session expiration more gracefully in
recv_handler. - Ensured proper termination of the ZMQ context and socket when closing the NetGear instance.
- Handled socket session expiration more gracefully in
- WebGear:
- Enhanced error messages for WebGear auto-generation workflow.
- WriteGear:
- Improved error handling in
execute_ffmpeg_cmdmethod.
- Improved error handling in
- Setup.py:
- Dropped legacy
picameradependency insetup.py. - Updated
pyzmqversion to address installation issues.
- Dropped legacy
- Helper:
- Updated
extract_timehelper function regex to handle milliseconds.
- Updated
Breaking Updates/Changes 💥
- StreamGear:
- 💣 Deprecated
terminate()method and introduceclose()method.- The
terminate()method in StreamGear is now deprecated and will be removed in a future release. Developers should use the newclose()method instead, which provides a more descriptive name like in WriteGear API for terminating StreamGear processes safely.
- The
- 💣 Deprecated
rgb_modeparameter instream()method.- This parameter will be removed in a future version, and only BGR format frames will be supported.
- 💣 Restricted
-livestreamparameter to Real-time Frames Mode only.- Live streaming is intended for low-latency streaming of real-time frames, where chunks contain only the most recent frames. It doesn't make sense when streaming from a video file, as the entire file can be streamed normally without the need for live streaming.
- 💣 Deprecated
Bug-fixes 🐛
- PiGear:
- Modify PiGear class behavior when
enforce_legacy_picamera=Trueon unsupported system.
- Modify PiGear class behavior when
- StreamGear:
- Removed non-essential aspect ratio parameter to prevent unwanted distortions.
- NetGear:
- Fixed Secure Mode failing to work on conflicting ZMQ Contexts.
- Fixed
msg_jsonundefined when terminating context in therecv_handlermethod.
- CamGear:
- Fixed logging condition for yt-dlp.
VidGear Stable v0.3.2
📓 Complete Release Notes can be found here
New Features ✨
- NetGear:
- Added new
killparameter toclose()method to forcefully kill ZMQ context instead of graceful exit only in thereceivemode. - Added new
subscriber_timeoutinteger optional parameter to support timeout withpattern=2(or Publisher-Subscriber) pattern.- Receiver will exit safely if timeout defined(any value(in milliseconds) > 0), and timeout occurs in Receiver Mode with
pattern=2. - 💬 Note: Default behavior still is to block the thread till infinite time.
- Receiver will exit safely if timeout defined(any value(in milliseconds) > 0), and timeout occurs in Receiver Mode with
- Added new
- WriteGear:
- Added new
-disable_ffmpeg_windowoptional Boolean flag to enable patch that prevents FFmpeg creation window from opening when building.exefiles on Windows OS. (PR by @ibtsam3301)- 💬 Note:
-disable_ffmpeg_windowoptional Boolean flag is only available on Windows OS with logging disabled(logging=False) in compression mode. - 💬 Use Case: This flag can be useful while creating an
.exefile for a python script that uses WriteGear API. On windows even after creating the.exefile in windowed mode or no-console mode, theffmpeg.execommand line window would pop up while its being used by WriteGear API.
- 💬 Note:
- Added new
- Setup.py
- Added official support for python
3.11.xlegacies.
- Added official support for python
Updates/Improvements ⚡️
- Asyncio:
- Formatted TemplateResponse class parameters w.r.t new changes in backend Starlette API.
- Setup.py:
- Readded latest patch to
uvicorn,starlette,pyzmqdependencies. - Removed
3.7legacy from Programming Language metadata.
- Readded latest patch to
- Maintenance:
- Added GitHub sponsors and dropped liberapay from
Funding.yml.
- Added GitHub sponsors and dropped liberapay from
- Docs:
- Updated information related to Supported Dimensional Attributes in ScreenGear docs.
- Updated minimum python to version
3.8while installing vidgear in docs. - Updated API-specific dependencies in docs.
Breaking Updates/Changes 💥
- Setup.py:
- 💣 Removed support for python-3.7 legacies
- 💬 Raised
python_requiresto>=3.8. Thereby python3.7and any before legacy are no longer supported.
- 💬 Raised
- 💣 Removed support for python-3.7 legacies
Bug-fixes 🐛
- ScreenGear:
- Fixed swapped region dimensions bug with dxcam backend.
- Fixed "mss" backend disabled when
monitorparameter is not defined.
- Docs:
- Fixed missing
compression_modeflags in WriteGear API docs.
- Fixed missing
VidGear Stable v0.3.1
📓 Complete Release Notes can be found here
New Features ✨
- WebGear:
- Added an option to add a custom video endpoint path.
- Users can now change the video endpoint path from
"/video"to any alphanumeric string. - Added the
custom_video_endpointoptional string attribute for this purpose. - Only alphanumeric strings with no spaces in between are allowed as its value.
- Users can now change the video endpoint path from
- Added an option to add a custom video endpoint path.
- ScreenGear:
- Added
dxcambackend support for Windows machines.dxcamis now the default backend for Windows machines when no backend is defined.- Added support for variable screen dimensions to capture an area from the screen.
- Added the optional flag
dxcam_target_fpsto control the target fps indxcam. Defaults to0(disabled).
- Added support for tuple values in the monitor parameter to specify device and output indexes as
(int[device_idx], int[output_idx])in thedxcambackend only.- Default
intindex is also allowed as a value for selecting device index.
- Default
- Added
- Helper
- Added multiple servers support for downloading assets.
- Added GitHub server to the
generate_webdatamethod to make it more robust for rate limits and other shortcomings. - Now, the
generate_webdatamethod will retry a different server when one fails.
- Added GitHub server to the
- Added multiple servers support for downloading assets.
- Setup.py
- Added
dxcamdependency incoreandasyncioextra requires for Windows machines.
- Added
Updates/Improvements ⚡️
- WebGear:
- Improved the conditions logic to check if non-empty values are assigned to optional parameters.
- WebGear_RTC:
- Improved the handling of the
formatparameter when constructing aVideoFramefrom ndarray frames.
- Improved the handling of the
- ScreenGear:
- Enforced
dxcambackend (if installed) whenmonitoris defined on Windows machines. - Refactored code blocks to ensure backward compatibility.
- Enforced
Breaking Updates/Changes 💥
- ScreenGear:
- 💣 Previously enforced threaded queue mode is now completely removed, resulting in a potential performance boost.
+ 💬 Reason: The IO is automatically blocked by the screen refresh rate, so adding the overhead of maintaining a separate queue is pointless. - 💣 Removed the
THREAD_TIMEOUToptional flag.
- 💣 Previously enforced threaded queue mode is now completely removed, resulting in a potential performance boost.
Bug-fixes 🐛
- WebGear_RTC:
- Fixed a bug caused by PyAV's error when
ndim==3grayscale frames are encountered.- The API will now drop the third dimension if
ndim==3grayscale frames are detected.
- The API will now drop the third dimension if
- Fixed a bug caused by PyAV's error when
- Setup.py:
- Starting from version
8.0.0, the python-mss library dropped support for Python3.7, so as a temporary measure,mssdependency has been pinned to version7.0.1.
- Starting from version
VidGear Stable v0.3.0
📓 Complete Release Notes can be found here
New Features ✨
- WriteGear:
- Added support for higher than 8-bit depth frames with datatypes of unsigned integer(
uint) kind and element size2. - Added new
-input_pixfmtattribute tooutput_paramsdictionary parameter for easily specifying custom input pixel-format. - Added support for Context Managers
__enter__()and__exit__()methods for proper handling of resources viawithstatement for allocating and releasing resources precisely. (Suggested by @sueskind)
- Added support for higher than 8-bit depth frames with datatypes of unsigned integer(
- StreamGear:
- Added support for Context Managers
__enter__()and__exit__()methods for proper handling of resources viawithstatement for allocating and releasing resources precisely. (Suggested by @sueskind)
- Added support for Context Managers
- WebGear:
- Added new
skip_generate_webdataboolean optional attribute(Falseby default) to completely disable Data-Files Auto-Generation WorkFlow.- This flag enables only
/videoroute for disabled Data-Files Auto-Generation WorkFlow.
- This flag enables only
- Added new
- Helper:
- Added more robust implementation of validate_audio method with more robust regex pattern for extracting audio-samplerate.
- Added support for Linux video device path (such as
/dev/video0).
- Maintenance:
- Logging current vidgear version when vidgear APIs are called, not at import.
- Current version can only be logged by VidGear APIs with the logging turned on (i.e.
logging=True).
- Current version can only be logged by VidGear APIs with the logging turned on (i.e.
- Logging current vidgear version when vidgear APIs are called, not at import.
Updates/Improvements ⚡️
- WriteGear:
- Updated comments, description, and logging messages to more sensible and developer friendly.
- Renamed
startFFmpeg_Processinternal class method tostart_FFProcess. - Renamed
Preprocessinternal class method toPreprocessFFParams. - Renamed
startCV_Processinternal class method tostart_CVProcess. - Renamed
initiateinternal class parameter toinitiate_process. - Renamed
force_terminationinternal class parameter toforced_termination.
- Renamed
- Updated comments, description, and logging messages to more sensible and developer friendly.
- Helper:
- Updated
validate_audiomethod with improved and more robust regex patterns for identifying audio bitrate in ay audio file.
- Updated
- Setup.py:
- Replaced
distutils.version.LooseVersionwithpkg_resources.parse_version.
- Replaced
- Maintenance:
- Replaced depreciated
LooseVersionwithparse_version. - Updated
Retrypackage to be imported fromrequests.adapters.
- Replaced depreciated
- Bash Scripts:
- Updated FFmpeg Static Binaries links to latest date/version tag to
12-07-2022.
- Updated FFmpeg Static Binaries links to latest date/version tag to
Breaking Updates/Changes 💥
- WriteGear:
- 💣 Renamed
output_filenamestring parameter tooutput. - 💣 Renamed
cmdparameter inexecute_ffmpeg_cmd()class method to more sensiblecommand. - 💣
ValueErrorwill be raised if datatype of input frames mismatches.
- 💣 Renamed
Bug-fixes 🐛
- Camgear:
- Fixed
CamGear.read()blocked unnecessarily. - Fixed deadlock on termination.
- Fixed
- ScreenGear:
- Fixed
ScreenGear.read()blocked during startup.- 💬 During startup,
ScreenGear.read()doesn't checks if queue is empty before continuing.
- 💬 During startup,
- Fixed
- WriteGear:
- Fixed gstpipeline_mode not activating when wrongly assuming
outputvalue as valid path. - Fixed name 'compression' is not defined bug.
- Fixed gstpipeline_mode not activating when wrongly assuming
- Helper:
- Fixed
fltpkeyword in regex pattern causing non-ftlp streams to be not recognized. - Fixed response.headers returning
content-lengthas Nonetype since it may not necessarily have the Content-Length header set.
- Fixed
- Setup:
- Pinned
pyzmq==24.0.1working version.
- Pinned
VidGear Stable v0.2.6
📓 Complete Release Notes can be found here
New Features ✨
- 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)
- Maintenance:
- Added new patterns to
.gitignoreto ignore pypi'sbuilddirectory andegg-infofiles.
- Added new patterns to
- CI:
- Switched to new Issue GitHub's form schema using YAMLs.
Updates/Improvements ⚡️
- Setup.py:
- Replaced
distutils.version.LooseVersionwithpkg_resources.parse_version.
- Replaced
- Docs:
- Updated Site Navigation.
- Added new notices to inform users more effectively about bonus examples.
- Added new
Bonussection to navigation and moved suitable pages under it.
- Redesigned and Rewritten Donation and Contribution section to README.md.
- Updated Site Navigation.
- API:
- Updated depreciated
tostring()totobytes()for the purposes for clarity in Python 3.2.
- Updated depreciated
- CI:
- Added more paths and files to skip commits.
Breaking Updates/Changes 💥
-input_framerateparameter now accepts any positive value for WriteGear and StreamGear APIs.
Bug-fixes 🐛
- API: Fixed
-input_framerateless than 5 does not get used in WriteGear and StreamGear APIs.(PR by @freol35241) - CamGear: Fixed Yt-dlp generated HTTP DASH Segments URLs not supported by OpenCV's VideoCapture(PR by @DynamiteC)
- StreamGear:
- Fixed
hls_segment_typenot working bug. (PR by @enarche-ahn) - Fixed critical logging parameter bug
- Fixed debug logs even when
logging=Falsein StreamGear's Real-time Mode. (patch suggested by @enarche-ahn) - Added length check to
-video_sourceattribute to correctly infers it as empty(or invalid).
- Fixed debug logs even when
- Fixed
- CI:
- Fixed pinned version syntax bug in docs_deployer workflow.
- Fixed typos in Github forms and its context.
- Docs:
- Fixed jinja2
3.1.0or above breaks mkdocs.jinja2>=3.1.0breaks mkdocs (mkdocs/mkdocs#2799), therefore pinned jinja2 version to<3.1.0.
- Fixed support for new
mkdocstringversions - Fixed Netgear+Webgear bonus example code bugs.(PR by @iandol)
- Fixed external bug that causing "Home" tab not responsive randomly when accessed from other tabs.
- Fixed jinja2
VidGear Stable v0.2.5
📓 Complete Release Notes can be found here
New Features ✨
- WriteGear:
- Added support for GStreamer pipeline in WriteGear API's Non-Compression mode:
- Implemented GStreamer Pipeline Mode to accept GStreamer pipeline formatted as string to its
output_filenameparameter. - Added new special
-gst_pipeline_modeattribute to itsoutput_paramsdictionary parameter to enable this mode. - This feature provides flexible way to directly write video frames into custom GStreamer Pipeline with controlled bitrate.
- Implemented GStreamer Pipeline Mode to accept GStreamer pipeline formatted as string to its
- Added new
-ffpreheadersspecial attribute to WriteGear'soutput_paramsdictionary parameter in Compression mode:- This attribute is specifically required to set special FFmpeg parameters in Compression Mode that are present at the starting of command(such as
-re). - This attribute only accepts list datatype as value.
- This attribute is specifically required to set special FFmpeg parameters in Compression Mode that are present at the starting of command(such as
- Added support for GStreamer pipeline in WriteGear API's Non-Compression mode:
- NetGear:
- Added bidirectional data transfer support to existing exclusive Multi-Clients and Multi-Servers exclusive modes:
- Users will now able to send data bidirectionally in both Multi-Clients and Multi-Servers exclusive modes.
- Bidirectional mode will no longer disables automatically when enabled along with Multi-Clients and Multi-Servers exclusive modes.
- Added bidirectional data transfer support to existing exclusive Multi-Clients and Multi-Servers exclusive modes:
- Maintenance:
- 🌟 Added official support for Python-3.10 legacies. 🌟
- Added
floatvalue support toTHREAD_TIMEOUToptional attributes in threaded gears.
Updates/Improvements ⚡️
- Setup.py:
- Dropped support for Python-3.6 and below legacies.
- Updated logging formating.
- Updated python_requires to
>=3.7.
- Helper:
- Vidgear will now report current version on every run.
Breaking Updates/Changes 💥
⚠️ Dropped support for Python-3.6 legacies from vidgear.
Bug-fixes 🐛
- NetGear: Fixed bidirectional mode forcefully overriding multi-clients mode's payload.
- Setup: Fixed uvicorn and aiortc dropped support for Python-3.6 legacies.
VidGear Stable v0.2.4
📓 Complete Release Notes can be found here
New Features ✨
- CamGear:
- Added a new YT_backend Internal Class with YT-DLP backend:
- Implemented
YT_backenda new CamGear's Internal YT-DLP backend class for extracting metadata from Streaming URLs. - Added support for pipeling (live) video-frames from all yt-dlp supported streaming sites: https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md#supported-sites
- Implemented algorithm from scratch for auto-extracting resolution specific streamable URLs for pipelineing.
- Added new
ytv_metadataglobal parameter to CamGear for accessing video's metadata(such as duration, title, description) on-the-go. ⚠️ Playlists are still unsupported.
- Implemented
- Added a new YT_backend Internal Class with YT-DLP backend:
- WebGear_RTC:
- Implemented a new easy way of defining Custom Streaming Class with suitable source(such as OpenCV):
- Added new
custom_streamattribute with WebGear_RTCoptionsparameter 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.
- Added new
- Implemented a new easy way of defining Custom Streaming Class with suitable source(such as OpenCV):
Updates/Improvements ⚡️
- CamGear:
- Added
is_livestreamglobal YT_backend parameters. - Added default options for yt-dlp for extracting info_dict(metadata) of the video as a single JSON line.
- Removed all dead code related to streamlink backend.
- Added
- Setup.py:
- Moved all API specific dependencies to
extra_requiresunder the name"core". [PR #268 by @zpapakipos] - Added rule to replace GitHub heading links in description.
- Updated
extra_requiredependencies. - Removed
streamlinkdependency. - Removed
pafydependency.
- Moved all API specific dependencies to
Breaking Updates/Changes 💥
⚠️ Installation command withpiphas been changed inv0.2.4:- The legacy
pip install vidgearcommand now installs critical bare-minimum dependencies only. Therefore in order to automatically install all the API specific dependencies as previous versions, usepip install vidgear[core]command instead.
- The legacy
- CamGear:
⚠️ Removedstreamlinkbackend support fromstream_modein favor of more reliable CamGear's Internal YT-DLP backend class for extracting metadata from Streaming URLs.- CamGear will raise
ValueErrorif streaming site URL is unsupported by yt-dlp backend. - CamGear will raise
ValueErrorifyt-dlpisn't installed andstream_modeis enabled.
- CamGear will raise
⚠️ Removed automatic enforcing of GStreamer backend for YouTube-livestreams and made it optional.- The CamGear will not raise ValueError if GStreamer support is missing in OpenCV backends.
- WebGear_RTC:
⚠️ Removed support for assigning Custom Media Server Class(inherited from aiortc's VideoStreamTrack) in WebGear_RTC through itsconfigglobal parameter.⚠️ WebGear_RTC API will now throws ValueError ifsourceparameter is NoneType as well ascustom_streamattribute is undefined.
- Helper:
⚠️ Removedrestore_levelnamesmethod.⚠️ Removedyoutube_url_validatormethod.
Bug-fixes 🐛
- CamGear:
- Fixed KeyError Bug for missing attributed in meta_data json in some streaming sites.
- Helper:
- Removed unused imports.
Related Pull Requests 🔧
VidGear Stable v0.2.3
📓 Complete Release Notes can be found here
New Features ✨
- CamGear:
- Added support for
4KStreaming URLs.
- Added support for
- Helper:
- Implemented logging ColorFormatter string alignment.
Updates/Improvements ⚡️
- CamGear:
- Replaced
youtube-dlwithyt-dlpas pafy backend for YouTube videos pipelining.- Implemented hack to trick pafy into assuming
yt-dlpasyoutube-dl. - Replaced
youtube-dldependency withyt-dlp. - Replaced
youtube-dlimports withyt-dlp.
- Implemented hack to trick pafy into assuming
- Replaced
- Helper:
- Enabled logging for
check_WriteAccessmethod.
- Enabled logging for
- Maintenance:
- Added
.gitignorefor specifying intentionally untracked files to ignore - Added
.gitattributesto manage how Git reads line endings. - Introduced python short-circuiting for handling logging logic in APIs.
- Added
Breaking Updates/Changes 💥
check_WriteAccesswill now return as invalid path if writing directory does not exists. This will effect output file handling in WriteGear and StreamGear APIs.
Bug-fixes 🐛
- StreamGear:
- WriteGear:
- Fixed bug in
-disable_force_terminationattribute logic which accidentally disables force termination.
- Fixed bug in
- WebGear_RTC:
- Fixed
name 'VideoStreamTrack' is not definedbug.
- Fixed
- Setup.py:
- Fixed
TypeErrorbug. - Fixed invalid
latest_versionretrieval.
- Fixed
- Helper:
- Fixed
check_WriteAccessfailing to recognize correct permission for writing the output file on windows platform.- Implemented separate logic for
Windowsand*nixplatforms.
- Implemented separate logic for
- Fixed bug in
check_WriteAccessthat throwsOSErrorwhile handling URLs.
- Fixed
Related Pull Requests 🔧
VidGear Stable v0.2.2
📓 Complete Release Notes can be found here ↗️
New Features ✨
- StreamGear:
- Added native support for new Apple HLS (HTTP Live Streaming) HTTP streaming format in StreamGear.
- Added seamless support for audio input from external audio devices.
- NetGear:
- New SSH Tunneling Mode for remote connection of ZMQ sockets across machines via SSH tunneling.
- Additional colorspace support for input frames with Frame-Compression enabled.
- Allowed users to manually select colorspace on-the-fly with its JPEG frame compression mode.
- NetGear_Async:
- New exclusive Bidirectional Mode for bidirectional data transfer with pure asyncio implementation.
⚠️ Bidirectional mode is only available with User-defined Custom Source(i.e.source=None)⚠️ NetGear_Async will throwRuntimeErrorif bidirectional mode is disabled at server or client but not both.
- Added new
disable_confirmationused to force disable termination confirmation from client interminate_connection. - Added
task_done()method after everyget()call to gracefully terminate queues. - Added new
secretsandstringimports.
- New exclusive Bidirectional Mode for bidirectional data transfer with pure asyncio implementation.
- WebGear:
- Updated JPEG Frame compression with
simplejpeg:- Implemented JPEG compression algorithm for 4-5% performance boost at cost of minor loss in quality.
- Utilized
encode_jpeganddecode_jpegmethods to implement turbo-JPEG transcoding withsimplejpeg. - Added new options to control JPEG frames quality, enable fastest dct, fast upsampling to boost performance.
- Added new
jpeg_compression,jpeg_compression_quality,jpeg_compression_fastdct,jpeg_compression_fastupsampleattributes.
- Added new WebGear Theme: (Checkout at https://github.com/abhiTronix/vidgear-vitals)
- Added responsive image scaling according to screen aspect ratios.
- Added responsive text scaling.
- Updated JPEG Frame compression with
- WebGear_RTC:
- Added native support for middlewares:
- Added new global
middlewarevariable for easily defining Middlewares as list.
- Added new global
- Added new WebGear_RTC Theme: (Checkout at https://github.com/abhiTronix/vidgear-vitals)
- Implemented new responsive video scaling according to screen aspect ratios.
- Added bootstrap CSS properties to implement auto-scaling.
- Added native support for middlewares:
- Helper:
- New automated interpolation selection for gears:
- Implemented
retrieve_best_interpolationmethod to automatically select best available interpolation within OpenCV.
- Implemented
- Implemented
get_supported_demuxersmethod to get list of supported demuxers.
- New automated interpolation selection for gears:
- Setup.py:
- Added new
cythonandmsgpackdependency. - Added
msgpackandmsgpack_numpyto auto-install latest.
- Added new
Updates/Improvements ⚡️
- VidGear Core:
- New behavior to virtually isolate optional API specific dependencies by silencing
ImportErroron all VidGear's APIs import. - Implemented algorithm to cache all imports on startup but silence any
ImportErroron missing optional dependency. ⚠️ NowImportErrorwill be raised only any certain API specific dependency is missing during given API's initialization.
- New behavior to virtually isolate optional API specific dependencies by silencing
- StreamGear:
- Replaced depreciated
-min_seg_durationflag with-seg_duration. - Removed redundant
-reflag from RTFM. - Improved Live-Streaming performance by disabling SegmentTimline
- Improved DASH assets detection for removal by using filename prefixes.
- Replaced depreciated
- NetGear:
- Replaced
np.newaxiswithnp.expand_dims. - Replaced
randommodule withsecretswhile generating system ID. - Update array indexing with
np.copy.
- Replaced
- NetGear_Async:
- Improved custom source handling.
- Removed deprecated
loopparameter from asyncio methods. - Re-implemented
skip_loopparameter inclose()method. ⚠️ run_until_completewill not used ifskip_loopis enabled.⚠️ skip_loopnow will create asyncio task instead and will enabledisable_confirmationby default.- Replaced
create_taskwithensure_futureto ensure backward compatibility with python-3.6 legacies. - Simplified code for
transceive_datamethod.
- WebGear_RTC:
- Improved handling of failed ICE connection.
- Made
is_runningvariable globally available for internal use.
- Helper:
- Added
4320presolution support todimensions_to_resolutionsmethod. - Implemented new
delete_file_safeto safely delete files at given path. - Replaced
os.removecalls withdelete_file_safe. - Added support for filename prefixes in
delete_ext_safemethod. - Improved and simplified
create_blank_framefunctions frame channels detection. - Added
loggingparameter to capPropId function to forcefully discard any error(if required).
- Added
- Setup.py:
- Added patch for
numpydependency,numpyrecently dropped support for python 3.6.x legacies. See https://github.com/numpy/numpy/releases/tag/v1.20.0 - Removed version check on certain dependencies.
- Re-added
aiortcto auto-install latest version.
- Added patch for
- Asyncio:
- Changed
asyncio.sleepvalue to0.- The amount of time sleep is irrelevant; the only purpose await asyncio.sleep() serves is to force asyncio to suspend execution to the event loop, and give other tasks a chance to run. Also,
await asyncio.sleep(0)will achieve the same effect. https://stackoverflow.com/a/55782965/10158117
- The amount of time sleep is irrelevant; the only purpose await asyncio.sleep() serves is to force asyncio to suspend execution to the event loop, and give other tasks a chance to run. Also,
- Changed
- License:
- Dropped publication year range to avoid confusion. (Signed and Approved by @abhiTronix)
- Updated Vidgear license's year of first publication of the work in accordance with US copyright notices defined by Title 17, Chapter 4(Visually perceptible copies): https://www.copyright.gov/title17/92chap4.html
Breaking Updates/Changes 💥
- 💣 Virtually isolated all API specific dependencies, Now
ImportErrorfor API-specific dependencies will be raised only when any of them is missing at API's initialization. - 💣 Renamed
delete_safetodelete_ext_safe. - 💣 Dropped support for
frame_jpeg_quality,frame_jpeg_optimize,frame_jpeg_progressiveattributes from WebGear.
Bug-fixes 🐛
- CamGear:
- Hot-fix for Live Camera Streams:
- Added new event flag to keep check on stream read.
- Implemented event wait for
read()to block it when source stream is busy. - Added and Linked
THREAD_TIMEOUTwith event wait timout. - Improved backward compatibility of new additions.
- Hot-fix for Live Camera Streams:
- NetGear:
- Fixed Bidirectional Video-Frame Transfer broken with frame-compression:
- Fixed
return_datainterfering with return JSON-data in receive mode. - Fixed logic.
- Fixed
- Fixed color-subsampling interfering with colorspace.
- Patched external
simplejpegbug. Issue: https://gitlab.com/jfolz/simplejpeg/-/issues/11- Added
np.squeezeto drop grayscale frame's 3rd dimension on Client's end.
- Added
- Fixed bug that cause server end frame dimensions differ from client's end when frame compression enabled.
- Fixed Bidirectional Video-Frame Transfer broken with frame-compression:
- NetGear_Async:
- Fixed bug related asyncio queue freezing on calling
join(). - Fixed ZMQ connection bugs in bidirectional mode.
- Fixed several critical bugs in event loop handling.
- Fixed several bugs in bidirectional mode implementation.
- Fixed missing socket termination in both server and client end.
- Fixed
timeoutparameter logic.
- Fixed bug related asyncio queue freezing on calling
- WebGear_RTC:
- Fixed stream freezes after web-page reloading:
- Implemented new algorithm to continue stream even when webpage is reloaded.
- Inherit and modified
next_timestampVideoStreamTrack method for generating accurate timestamps. - Implemented
reset_connectionscallable to reset all peer connections and recreate Video-Server timestamps. (Implemented by @kpetrykin) - Added
close_connectionendpoint in JavaScript to inform server page refreshing.(Thanks to @kpetrykin) - Added exclusive reset connection node
/close_connectionin routes. - Added
reset()method to Video-Server class for manually resetting timestamp clock. - Added
reset_enabledflag to keep check on reloads. - Fixed premature webpage auto-reloading.
- Fixed web-page reloading bug after stream ended:
- Disable webpage reload behavior handling for Live broadcasting.
- Disable reload CI test on Windows machines due to random failures.
- Improved handling of failed ICE connection.
- Fixed Assertion error bug:
- Source must raise MediaStreamError when stream ends instead of returning None-type.
- Fixed stream freezes after web-page reloading:
- WebGear:
- Removed format specific OpenCV decoding and encoding support for WebGear.
- Helper:
- Regex bugs fixed:
- New improved regex for discovering supported encoders in
get_supported_vencoders. - Re-implemented check for extracting only valid output protocols in
is_valid_url.
- New improved regex for discovering supported encoders in
- Bugfix related to OpenCV import:
- Bug fixed for OpenCV import comparison test failing with Legacy versions and throwing
ImportError.
- Bug fixed for OpenCV import comparison test failing with Legacy versions and throwing
- Fixed bug with
create_blank_framethat throws error with gray frames. - Implemented
RSTPprotocol validation as demuxer, since it's not a protocol but a demuxer. - Removed redundant
logger_handler,mkdir_safe,retrieve_best_interpolation,capPropIdhelper functions from asyncio package. Relatively imported helper functions from non-asyncio package. - Removed unused
aiohttpdependency. - Removed
asctimeformatting from logging.
- Regex bugs fixed:
- StreamGear:
- Fixed Multi-Bitrate HLS VOD streams:
- Re-implemented complete workflow for Multi-Bitrate HLS VOD streams.
- Extended support to both Single-Source and Real-time Frames Mode...
- Fixed Multi-Bitrate HLS VOD streams:
VidGear v0.2.1
New Features ✨
- WebGear_RTC:
- A new API that is similar to WeGear API in all aspects but utilizes WebRTC standard instead of Motion JPEG for streaming.
- Added a flexible backend for
aiortc- a python library for Web Real-Time Communication (WebRTC). - Integrated all functionality and parameters of WebGear into WebGear_RTC API.
- Implemented JSON Response with a WebRTC Peer Connection of Video Server.
- Added a internal
RTC_VideoServerserver on WebGear_RTC, a inherit-class to aiortc's VideoStreamTrack API. - New Standalone UI Default theme v0.1.1 for WebGear_RTC from scratch without using 3rd-party assets. (by @abhiTronix)
- New
custom.jsandcustom.cssfor custom responsive behavior. - Added WebRTC support to
custom.jsand ensured compatibility with WebGear_RTC. - Added example support for ICE framework and STUN protocol like WebRTC features to
custom.js. - Added
resize()function tocustom.jsto automatically adjustvideo&imgtags for smaller screens. - Added WebGear_RTC support in main.py for easy access through terminal using
--modeflag. - Integrated all WebGear_RTC enhancements to WebGear Themes.
- Added CI test for WebGear_RTC.
- Added complete docs for WebGear_RTC API.
- Added bare-minimum as well as advanced examples usage code.
- Added new theme images.
- Added Reference and FAQs.
- CamGear API:
- New Improved Pure-Python Multiple-Threaded Implementation:
- Optimized Threaded-Queue-Mode Performance. (PR by @bml1g12)
- Replaced regular
queue.fullchecks followed by sleep with implicit sleep with blockingqueue.put. - Replaced regular
queue.emptychecks followed by queue. - Replaced
nowait_getwith a blockingqueue.getnatural empty check. - Up-to 2x performance boost than previous implementations.
- New
THREAD_TIMEOUTattribute to prevent deadlocks:- Added support for
THREAD_TIMEOUTattribute to itsoptionsparameter. - Updated CI Tests and docs.
- Added support for
- New Improved Pure-Python Multiple-Threaded Implementation:
- WriteGear API:
- New more robust handling of default video-encoder in compression mode:
- Implemented auto-switching of default video-encoder automatically based on availability.
- API now selects Default encoder based on priority:
"libx264" > "libx265" > "libxvid" > "mpeg4". - Added
get_supported_vencodersHelper method to enumerate Supported Video Encoders. - Added common handler for
-c:vand-vcodecflags.
- New more robust handling of default video-encoder in compression mode:
- NetGear API:
- New Turbo-JPEG compression with simplejpeg
- Implemented JPEG compression algorithm for 4-5% performance boost at cost of minor loss in quality.
- Utilized
encode_jpeganddecode_jpegmethods to implement turbo-JPEG transcoding withsimplejpeg. - Added options to control JPEG frames quality, enable fastest dct, fast upsampling to boost performance.
- Added new
jpeg_compression,jpeg_compression_quality,jpeg_compression_fastdct,jpeg_compression_fastupsampleattributes. - Enabled fast dct by default with JPEG frames at 90%.
- Added Docs for JPEG Frame Compression.
- New Turbo-JPEG compression with simplejpeg
- WebGear API:
- New modular and flexible configuration for Custom Sources:
- Implemented more convenient approach for handling custom source configuration.
- Added new
configglobal variable for this new behavior. - Now None-type
sourceparameter value is allowed for defining own custom sources. - Added new Example case and Updates Docs for this feature.
- Added new CI Tests.
- New Browser UI Updates:
- New Standalone UI Default theme v0.1.0 for browser (by @abhiTronix)
- Completely rewritten theme from scratch with only local resources.
- New
custom.jsandcustom.cssfor custom responsive behavior. - New sample glow effect with css.
- New sample click to full-screen behavior with javascript.
- Removed all third-party theme dependencies.
- Update links to new github server
abhiTronix/vidgear-vitals - Updated docs with new theme's screenshots.
- Added
enable_infinite_framesattribute for enabling infinite frames. - Added New modular and flexible configuration for Custom Sources.
- Bumped WebGear Theme Version to v0.1.1.
- Updated Docs and CI tests.
- New modular and flexible configuration for Custom Sources:
- ScreenGear API:
- Implemented Improved Pure-Python Multiple-Threaded like CamGear.
- Added support for
THREAD_TIMEOUTattribute to itsoptionsparameter.
- StreamGear API:
- Enabled pseudo live-streaming flag
refor live content.
- Enabled pseudo live-streaming flag
- Docs:
- Added new native docs versioning to mkdocs-material.
- Added new examples and few visual tweaks.
- Updated Stylesheet for versioning.
- Added new DASH video chunks at https://github.com/abhiTronix/vidgear-docs-additionals for StreamGear and Stabilizer streams.
- Added open-sourced "Tears of Steel" * project Mango Teaser video chunks.
- Added open-sourced "Subspace Video Stabilization" http://web.cecs.pdx.edu/~fliu/project/subspace_stabilization/ video chunks.
- Added support for DASH Video Thumbnail preview in Clappr within
custom.js. - Added responsive clappr DASH player with bootstrap's
embed-responsive. - Added new permalink icon and slugify to toc.
- Added "back-to-top" button for easy navigation.
- Helper:
- New GitHub Mirror with latest Auto-built FFmpeg Static Binaries:
- Replaced new GitHub Mirror
abhiTronix/FFmpeg-Buildsin helper.py - New CI maintained Auto-built FFmpeg Static Binaries.
- Removed all 3rd-party and old links for better compatibility and Open-Source reliability.
- Updated Related CI tests.
- Added auto-font-scaling for
create_blank_framemethod.
- Replaced new GitHub Mirror
- Added
c_nameparameter togenerate_webdataanddownload_webdatato specify class. - A more robust Implementation of Downloading Artifacts:
- Added a custom HTTP
TimeoutHTTPAdapterAdapter with a default timeout for all HTTP calls based on this GitHub comment. - Implemented http client and the
send()method to ensure that the default timeout is used if a timeout argument isn't provided. - Implemented Requests session
withblock to exit properly even if there are unhandled exceptions. - Add a retry strategy to custom
TimeoutHTTPAdapterAdapter with max 3 retries and sleep(backoff_factor=1) between failed requests.
- Added a custom HTTP
- Added
create_blank_framemethod to create bland frames with suitable text.
- New GitHub Mirror with latest Auto-built FFmpeg Static Binaries:
- [CI] Continuous Integration:
- Added new fake frame generated for fake
picameraclass with numpy. - Added new
create_bugparameter to fakepicameraclass for emulating various artificial bugs. - Added float/int instance check on
time_delayfor camgear and pigear. - Added
EXIT_CODEto new timeout implementation for pytests to upload codecov report when no timeout. - Added auxiliary classes to fake
picamerafor facilitating the emulation. - Added new CI tests for PiGear Class for testing on all platforms.
- Added
shutdown()function to gracefully terminate WebGear_RTC API. - Added new
coreutilsbrew dependency. - Added handler for variable check on exit and codecov upload.
- Added
is_runningflag to WebGear_RTC to exit safely.
- Added new fake frame generated for fake
- Setup:
- New automated latest version retriever for packages:
- Implemented new
latest_versionmethod to automatically retrieve latest version for packages. - Added Some Dependencies.
- Implemented new
- Added
simplejpegpackage for all platforms.
- New automated latest version retriever for packages:
Updates/Improvements 🔧
- Added exception for RunTimeErrors in NetGear CI tests.
- WriteGear: Critical file write access checking method:
- Added new
check_WriteAccessHelper method. - Implemented a new robust algorithm to check if given directory has write-access.
- Removed old behavior which gives irregular results.
- Added new
- Helper: Maintenance Updates
- Added workaround for Python bug.
- Added
safe_mkdirtocheck_WriteAccessto automatically create non-existential parent folder in path. - Extended
check_WriteAccessPatch to StreamGear. - Simplified
check_WriteAccessto handle Windows envs easily. - Updated FFmpeg Static Download URL for WriteGear.
- Implemented fallback option for auto-calculating bitrate from extracted audio sample-rate in
validate_audiomethod.
- Docs: General UI Updates
- Updated Meta tags for og site and twitter cards.
- Replaced Custom dark theme toggle with mkdocs-material's official Color palette toggle
- Added example for external audio input and creating segmented MP4 video in WriteGear FAQ.
- Added example for YouTube streaming with WriteGear.
- Removed custom
dark-material.jsandheader.htmlfiles from theme. - Added blogpost link for detailed information on Stabilizer Working.
- Updated
mkdocs.ymlandcustom.cssconfiguration. - Remove old hack to resize clappr DASH player with css.
- Updated Admonitions.
- Improved docs contexts.
- Updated CSS for version-selector-button.
- Adjusted files to match new themes.
- Updated welcome-bot message for typos.
- Removed redundant FAQs from NetGear Docs.
- Updated Assets Images.
- Updated spacing.
- CI:
- Removed unused
github.reffrom yaml. - Updated OpenCV Bash Script for Linux envs.
- Added
timeout-minutesflag to github-actions workflow. - Added
timeoutflag to pytest. - Replaced Threaded Gears with OpenCV VideoCapture API.
- Moved files and Removed redundant code.
- Replaced grayscale frames with color frames for WebGear tests.
- Updat...
- Removed unused