High-performance cross-platform Video Processing Python framework powerpacked with unique trailblazing features :fire:

Overview

VidGear

VidGear tagline

Releases   |   Gears   |   Documentation   |   Installation   |   License

Build Status Codecov branch Build Status

Glitter chat PyPi version Twitter

Code Style

 

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, FFmpeg, ZeroMQ, picamera, starlette, streamlink, pafy, pyscreenshot and python-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.

 

The following functional block diagram clearly depicts the generalized functioning of VidGear APIs:

@Vidgear Functional Block Diagram

 

Table of Contents

 

 

TL;DR

What is vidgear?

"VidGear is a High-Performance Framework that provides an one-stop Video-Processing solution for building complex real-time media applications in python."

What does it do?

"VidGear can read, write, process, send & receive video files/frames/streams from/to various devices in real-time."

What is its purpose?

"Write Less and Accomplish More"VidGear's Motto

"Built with simplicity in mind, VidGear lets programmers and software developers to easily integrate and perform Complex Video-Processing Tasks in their existing or newer applications in just a few lines of code. Beneficial for both, if you're new to programming with Python language or already a pro at it."

 

 

Getting Started

If this is your first time using VidGear, head straight to the Installation ➶ to install VidGear.

Once you have VidGear installed, Checkout its Well-Documented Function-Specific Gears ➶

Also, if you're already familiar with OpenCV library, then see Switching from OpenCV Library ➶

Or, if you're just getting started with OpenCV, then see here ➶

 

 

Gears: What are these?

VidGear is built with multiple APIs a.k.a Gears, each with some unique functionality.

Each API is designed exclusively to handle/control/process different data-specific & device-specific video streams, network streams, and media encoders/decoders. These APIs provides the user an easy-to-use, dynamic, extensible, and exposed Multi-Threaded + Asyncio optimized internal layer above state-of-the-art libraries to work with, while silently delivering robust error-handling.

These Gears can be classified as follows:

A. Video-Capture Gears:

  • CamGear: Multi-Threaded API targeting various IP-USB-Cameras/Network-Streams/Streaming-Sites-URLs.
  • PiGear: Multi-Threaded API targeting various Raspberry-Pi Camera Modules.
  • ScreenGear: Multi-Threaded API targeting ultra-fast Screencasting.
  • VideoGear: Common Video-Capture API with internal Video Stabilizer wrapper.

B. Video-Writer Gears:

  • WriteGear: Handles Lossless Video-Writer for file/stream/frames Encoding and Compression.

C. Streaming Gears:

  • StreamGear: Handles Transcoding of High-Quality, Dynamic & Adaptive Streaming Formats.

  • Asynchronous I/O Streaming Gear:

    • WebGear: ASGI Video-Server that broadcasts Live Video-Frames to any web-browser on the network.

D. Network Gears:

  • NetGear: Handles High-Performance Video-Frames & Data Transfer between interconnecting systems over the network.

  • Asynchronous I/O Network Gear:

    • NetGear_Async: Immensely Memory-Efficient Asyncio Video-Frames Network Messaging Framework.

 

 

CamGear

CamGear Functional Block Diagram

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), 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 with access almost all of its available parameters. CamGear also employs streamlink for piping live videos from various streaming services and also utilizies pafy with youtube-dl at its backend for YouTube pipelining. Furthermore, its framework relies exclusively on Threaded Queue mode for ultra-fast, error-free, and synchronized video-frame handling.

CamGear API Guide:

>>> Usage Guide

 

 

VideoGear

VideoGear API provides a special internal wrapper around VidGear's exclusive Video Stabilizer class.

VideoGear also acts as a Common Video-Capture API that provides internal access for both CamGear and PiGear APIs and their parameters with an exclusive enablePiCamera boolean flag.

VideoGear is ideal when you need to switch to different video sources without changing your code much. Also, it enables easy stabilization for various video-streams (real-time or not) with minimum effort and writing way fewer lines of code.

Below is a snapshot of a VideoGear Stabilizer in action (See its detailed usage here):

VideoGear Stabilizer in action!
Original Video Courtesy @SIGGRAPH2013

Code to generate above result:

# import required libraries
from vidgear.gears import VideoGear
import numpy as np
import cv2

# open any valid video stream with stabilization enabled(`stabilize = True`)
stream_stab = VideoGear(source="test.mp4", stabilize=True).start()

# open same stream without stabilization for comparison
stream_org = VideoGear(source="test.mp4").start()

# loop over
while True:

    # read stabilized frames
    frame_stab = stream_stab.read()

    # check for stabilized frame if Nonetype
    if frame_stab is None:
        break

    # read un-stabilized frame
    frame_org = stream_org.read()

    # concatenate both frames
    output_frame = np.concatenate((frame_org, frame_stab), axis=1)

    # put text over concatenated frame
    cv2.putText(
        output_frame,
        "Before",
        (10, output_frame.shape[0] - 10),
        cv2.FONT_HERSHEY_SIMPLEX,
        0.6,
        (0, 255, 0),
        2,
    )
    cv2.putText(
        output_frame,
        "After",
        (output_frame.shape[1] // 2 + 10, output_frame.shape[0] - 10),
        cv2.FONT_HERSHEY_SIMPLEX,
        0.6,
        (0, 255, 0),
        2,
    )

    # Show output window
    cv2.imshow("Stabilized Frame", output_frame)

    # check for 'q' key if pressed
    key = cv2.waitKey(1) & 0xFF
    if key == ord("q"):
        break

# close output window
cv2.destroyAllWindows()

# safely close both video streams
stream_org.stop()
stream_stab.stop()

VideoGear API Guide:

>>> Usage Guide

 

 

PiGear

PiGear

PiGear is similar to CamGear but made to support various Raspberry Pi Camera Modules (such as OmniVision OV5647 Camera Module and Sony IMX219 Camera Module).

PiGear provides a flexible multi-threaded framework around complete picamera python library, and provide us the ability to exploit almost all of its parameters like brightness, saturation, sensor_mode, iso, exposure, etc. effortlessly. Furthermore, PiGear also supports multiple camera modules, such as in the case of Raspberry-Pi Compute Module IO boards.

Best of all, PiGear contains Threaded Internal Timer - that silently keeps active track of any frozen-threads/hardware-failures and exit safely, if any does occur. That means that if you're running PiGear API in your script and someone accidentally pulls the Camera-Module cable out, instead of going into possible kernel panic, API will exit safely to save resources.

Code to open picamera stream with variable parameters in PiGear API:

# import required libraries
from vidgear.gears import PiGear
import cv2

# add various Picamera tweak parameters to dictionary
options = {
    "hflip": True,
    "exposure_mode": "auto",
    "iso": 800,
    "exposure_compensation": 15,
    "awb_mode": "horizon",
    "sensor_mode": 0,
}

# open pi video stream with defined parameters
stream = PiGear(resolution=(640, 480), framerate=60, logging=True, **options).start()

# 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}

    # Show output window
    cv2.imshow("Output Frame", frame)

    # check for 'q' key if pressed
    key = cv2.waitKey(1) & 0xFF
    if key == ord("q"):
        break

# close output window
cv2.destroyAllWindows()

# safely close video stream
stream.stop()

PiGear API Guide:

>>> Usage Guide

 

 

ScreenGear

ScreenGear is designed exclusively for ultra-fast Screencasting, which means it can grab frames from your monitor in real-time, either by defining an area on the computer screen or full-screen, at the expense of inconsiderable latency. ScreenGear also seamlessly support frame capturing from multiple monitors as well as supports multiple backends.

ScreenGear implements a multi-threaded wrapper around pyscreenshot & python-mss python library API and also supports an easy and flexible direct internal parameter manipulation.

Below is a snapshot of a ScreenGear API in action:

ScreenGear in action!

Code to generate the above results:

# import required libraries
from vidgear.gears import ScreenGear
import cv2

# open video stream with default parameters
stream = ScreenGear().start()

# 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}

    # Show output window
    cv2.imshow("Output Frame", frame)

    # check for 'q' key if pressed
    key = cv2.waitKey(1) & 0xFF
    if key == ord("q"):
        break

# close output window
cv2.destroyAllWindows()

# safely close video stream
stream.stop()

ScreenGear API Guide:

>>> Usage Guide

 

 

WriteGear

WriteGear Functional Block Diagram

WriteGear handles various powerful Video-Writer Tools that provide us the freedom to do almost anything imaginable with multimedia data.

WriteGear API provides a complete, flexible, and robust wrapper around FFmpeg, a leading multimedia framework. WriteGear can process real-time frames into a lossless compressed video-file with any suitable specification (such asbitrate, codec, framerate, resolution, subtitles, etc.). It is powerful enough to perform complex tasks such as Live-Streaming (such as for Twitch) and Multiplexing Video-Audio with real-time frames in way fewer lines of code.

Best of all, WriteGear grants users the complete freedom to play with any FFmpeg parameter with its exclusive Custom Commands function (see this doc) without relying on any third-party API.

In addition to this, WriteGear also provides flexible access to OpenCV's VideoWriter API tools for video-frames encoding without compression.

WriteGear primarily operates in the following two modes:

  • Compression Mode: In this mode, WriteGear utilizes powerful FFmpeg inbuilt encoders to encode lossless multimedia files. This mode provides us the ability to exploit almost any parameter available within FFmpeg, effortlessly and flexibly, and while doing that it robustly handles all errors/warnings quietly. You can find more about this mode here ➶

  • Non-Compression Mode: In this mode, WriteGear utilizes basic OpenCV's inbuilt VideoWriter API tools. This mode also supports all parameters manipulation available within VideoWriter API, but it lacks the ability to manipulate encoding parameters and other important features like video compression, audio encoding, etc. You can learn about this mode here ➶

WriteGear API Guide:

>>> Usage Guide

 

 

StreamGear

NetGear API

StreamGear automates transcoding workflow for generating Ultra-Low Latency, High-Quality, Dynamic & Adaptive Streaming Formats (such as MPEG-DASH) in just few lines of python code.

StreamGear provides a standalone, highly extensible, and flexible wrapper around FFmpeg multimedia framework for generating chunked-encoded media segments of the content.

SteamGear easily transcodes source videos/audio files & real-time video-frames and breaks them into a sequence of multiple smaller chunks/segments of fixed length. These segments make it possible to stream videos at different quality levels (different bitrates or spatial resolutions) and can be switched in the middle of a video from one quality level to another – if bandwidth permits – on a per-segment basis. A user can serve these segments on a web server that makes it easier to download them through HTTP standard-compliant GET requests.

SteamGear also creates a Manifest file (such as MPD in-case of DASH) besides segments that describe these segment information (timing, URL, media characteristics like video resolution and bit rates) and is provided to the client before the streaming session.

SteamGear currently only supports MPEG-DASH (Dynamic Adaptive Streaming over HTTP, ISO/IEC 23009-1) but other adaptive streaming technologies such as Apple HLS, Microsoft Smooth Streaming will be added soon.

StreamGear primarily works in two Independent Modes for transcoding which serves different purposes:

  • Single-Source Mode: In this mode, StreamGear transcodes entire video/audio file (as opposed to frames by frame) into a sequence of multiple smaller chunks/segments for streaming. This mode works exceptionally well, when you're transcoding lossless long-duration videos(with audio) for streaming and required no extra efforts or interruptions. But on the downside, the provided source cannot be changed or manipulated before sending onto FFmpeg Pipeline for processing. This mode can be easily activated by assigning suitable video path as input to -video_source attribute, during StreamGear initialization. Learn more about this mode here ➶

  • Real-time Frames Mode: When no valid input is received on -video_source attribute, StreamGear API activates this mode where it directly transcodes video-frames (as opposed to a entire file), into a sequence of multiple smaller chunks/segments for streaming. In this mode, StreamGear supports real-time numpy.ndarray frames, and process them over FFmpeg pipeline. But on the downside, audio has to added manually (as separate source) for streams. Learn more about this mode here ➶

StreamGear API Guide:

>>> Usage Guide

 

 

NetGear

NetGear API

NetGear is exclusively designed to transfer video-frames & data synchronously between interconnecting systems over the network in real-time.

NetGear implements a high-level wrapper around PyZmQ python library that contains python bindings for ZeroMQ - a high-performance asynchronous distributed messaging library.

NetGear seamlessly supports Bidirectional data transmission along with video-frames between receiver(client) and sender(server).

NetGear can also robustly handle Multiple Server-Systems and Multiple Client-Systems and at once, thereby providing access to a seamless exchange of video-frames & data between multiple devices across the network at the same time.

NetGear supports real-time Frame Compression capabilities for optimizing performance while sending the frames directly over the network by automatic encoding/decoding in real-time.

For security, NetGear implements easy access to ZeroMQ's powerful, smart & secure Security Layers that enable Strong encryption on data and unbreakable authentication between the Server and the Client with the help of custom certificates/keys.

NetGear as of now seamlessly supports three ZeroMQ messaging patterns:

Whereas supported protocol are: tcp and ipc.

NetGear API Guide:

>>> Usage Guide

 

 

WebGear

WebGear is a powerful ASGI Video-Broadcaster API ideal for transmitting video-frames from a single source to multiple recipients via the browser.

WebGear API provides a highly extensible and flexible async wrapper around Starlette's ASGI application and provides easy access to its complete framework. WebGear can flexibly interact with Starlette's ecosystem of shared middleware, mountable applications, Response classes, Routing tables, Static Files, Templating engine(with Jinja2), etc.

In layman's terms, WebGear acts as a powerful Video Broadcaster that transmits live video-frames to any web-browser in the network. Additionally, WebGear API also provides a special internal wrapper around VideoGear, which itself provides internal access to both CamGear and PiGear APIs, thereby granting it exclusive power of broadcasting frames from any incoming stream.

Below is a snapshot of a WebGear Video Server in action on the Mozilla Firefox browser:

WebGear in action!
WebGear Video Server at http://localhost:8000/ address.

Code to generate the above result:

# import required libraries
import uvicorn
from vidgear.gears.asyncio import WebGear

# various performance tweaks
options = {
    "frame_size_reduction": 40,
    "frame_jpeg_quality": 80,
    "frame_jpeg_optimize": True,
    "frame_jpeg_progressive": False,
}

# initialize WebGear app
web = WebGear(source="foo.mp4", logging=True, **options)

# run this app on Uvicorn server at address http://localhost:8000/
uvicorn.run(web(), host="localhost", port=8000)

# close app safely
web.shutdown()

WebGear API Guide:

>>> Usage Guide

 

 

NetGear_Async

WebGear in action!

.

NetGear_Async can generate the same performance as NetGear API at about one-third the memory consumption, and also provide complete server-client handling with various options to use variable protocols/patterns similar to NetGear, but it doesn't support any of NetGear's Exclusive Modes yet.

NetGear_Async is built on zmq.asyncio, and powered by a high-performance asyncio event loop called uvloop to achieve unmatchable high-speed and lag-free video streaming over the network with minimal resource constraints. NetGear_Async can transfer thousands of frames in just a few seconds without causing any significant load on your system.

NetGear_Async provides complete server-client handling and options to use variable protocols/patterns similar to NetGear API but doesn't support any NetGear Exclusive modes yet. Furthermore, NetGear_Async allows us to define our custom Server as source to manipulate frames easily before sending them across the network(see this doc example).

NetGear_Async as of now supports all four ZeroMQ messaging patterns:

Whereas supported protocol are: tcp and ipc.

NetGear_Async API Guide:

>>> Usage Guide

 

 

Documentation

The complete documentation for all VidGear APIs can be found in the link below:

 

 

Contributions & Support

Contributions are welcome. We'd love to have your contributions to VidGear to fix bugs or to implement new features!

Please see our Contribution Guidelines for more details.

Support

PiGear

Donations help keep VidGear's Development alive. Giving a little means a lot, even the smallest contribution can make a huge difference.

ko-fi

Contributors

 

 

Community Channel

If you've come up with some new idea, or looking for the fastest way troubleshoot your problems, then join our Gitter community channel ➶

 

 

Citation

Here is a Bibtex entry you can use to cite this project in a publication:

@misc{vidgear,
    author = {Abhishek Thakur},
    title = {vidgear},
    howpublished = {\url{https://github.com/abhiTronix/vidgear}},
    year = {2019-2020}
  }

 

 

Copyright

Copyright © abhiTronix 2019-2020

This library is released under the Apache 2.0 License.

Comments
  • FPS Performance Issues using ScreenGear and WriteGear

    FPS Performance Issues using ScreenGear and WriteGear

    Hi, first off thanks for this library, it's been really interesting to explore.

    The issue I have is that I'm unable to get desireable FPS using the combination of ScreenGear and WriteGear. I want to record my screen at a reasonable FPS for playback (anything above 25 would be fine). I'm recording in 1080p.

    However the using the code from the usage example under WriteGear I find that I can only write at about 10 FPS. I was using the default of 25 FPS for WriteGear which resulted in my videos playing back as if they were being fast forwarded.

    Question

    I have a good computer as far as I'm aware and I'm writing to an SSD. Is this low performance a suprise? It appears the write step is taking the longest

    What is the correct way to ensure that recording FPS and video FPS are the same? I want real-time video playback in an app I'm writing so videos that don't match up 1:1 in time spent recording / time spent playing is a problem for me. My idea is to use a combination of cv2.waitKey to "slow down" the recording to match a targeted FPS which can then be passed to WriteGear.

    That doesn't solve my performance problems but would allow me to create video at a fixed FPS within my performance limit. I think the example in WriteGear usage doesn't do this and I've not found anything in the docs to assist but this feels like a major thing, so maybe I'm missing something obvious?

    I did some analysis by timing each step in the write loop. The below snippet was consistently the profile of where the time was spent.

    read time: 0.0005109310150146484 time spent in "frame = stream.read()" write time: 0.03965616226196289 time spent in "writer.write(frame)" total time: 0.04016709327697754

    As shown the write is taking the majority of the time. Is it essential the write is done in this loop? I could imagine a structure where we pass the frame to another thread with some enforcement of the ordering.

    Acknowledgment

    • [X] I have searched the issues for my issue and found nothing related or helpful.
    • [X] I have read the FAQs.
    • [x] I have read the Documentation.

    Context

    I'm writing a python app that records screen and performs some analysis on the video before adding timestamps. This is causing my videos to play back in ~2/3rds of the real duration and skew my timestamps.

    Your Environment

    • VidGear version: 0.2.3
    • Branch: Master
    • Python version: Python 3.9.7
    • PiP version: 21.3.1
    • Operating System and version: Windows 10

    Thanks again, Alex

    QUESTION :question: WAITING TO TEST :timer_clock: SOLVED :checkered_flag: 
    opened by aza547 49
  • How do I display two streams simultaneously?

    How do I display two streams simultaneously?

    Let's take the example code here that displays the webcam feed using OpenCV. Say I want two of these feeds to be displayed side by side - one for the webcam stream, and one for streaming another video stream (like a pre-downloaded mp4 video, etc). How would I do that? I'm guessing I'll need to have two async custom frame producers. But I tried it the following way:

    web.config["generator"] = my_frame_producer_1
    web.config["generator"] = my_frame_producer_2
    

    and one overlaps the other. So, I'm guessing there should be a way to give the location coordinates to display the stream. That should solve the overlap issue. How do I do that?

    QUESTION :question: SOLVED :checkered_flag: 
    opened by PrashantSaikia 42
  • video sending using multithreading

    video sending using multithreading

    In context, I transfer video from a camera on a raspberry pi 3, to a local computer. The local network is only used for this purpose so there is no congestion on the network, besides I am connected by cable, on the computer and on the raspberry, (LAN). The shipping is slow and I had an idea to increase the transfer using double wire delivery

    Question

    I have a question, to verify if it is possible or someone else has tried to do it.

    In context, I transfer video from a camera on a raspberry pi 3, to a local computer. The local network is only used for this purpose so there is no congestion on the network, besides I am connected by cable, on the computer and on the raspberry, (LAN). The video quality I transfer has a size of 1920 x 1080.

    Using the NetGear library I transfer the video correctly, but at an average speed of 3 FPS.

    For my purposes I need more video at a higher speed, but without reducing the quality of the video or resizing it.

    server = NetGear (address = '192.168.x.xxx', port = '5454', protocol = 'tcp', pattern = 1, receive_mode = False, logging = True, ** options) #Define netgear client at Server IP address .
    server2 = NetGear ...... different port
    

    Try to implement a communication using 2 threads, where in each thread you send a video frame to the computer so that in this way while sending a video frame you can also make another sending at the same time of a subsequent frame. In theory this could help me increase the amount of SPF.

    But what I have observed, is that internally even if you use threads, the video sending is only done one by one, even if you have two sending objects, one or the other will wait internally for the other to finish sending to send yours.

    for example, implement 3 threads to send video at the same time but with consecutive frames, executing the code for 10 seconds. Each thread could only send 10 frames, where in total for the ten seconds were 30, 3 FPS.

    Each thread is constantly checking on a corresponding video stack if there is a frame to send.

    while True:
        if len (queue1)> 0:
            server.send (frame)
    

    Acknowledgment

    • [*] A brief but descriptive Title of your issue.
    • [*] I have searched the issues for my issue and found nothing related or helpful.
    • [*] I have read the FAQ.
    • [*] I have read the Wiki.

    Context

    I mainly want to increase the amount of video frames I receive

    In context, I transfer video from a camera on a raspberry pi 3, to a local computer. The local network is only used for this purpose so there is no congestion on the network, besides I am connected by cable, on the computer and on the raspberry, (LAN). The video quality I transfer has a size of 1920 x 1080.

    Your Environment

    • VidGear version: 0.1.5
    • Branch:
    • Python version: 3.5
    • pip version: current version
    • Operating System and version: Ubuntu 16.04

    Optional

    multihilo

    BUG :bug: ENHANCEMENT :zap: QUESTION :question: SOLVED :checkered_flag: 
    opened by julio16101 36
  • How to record color video?

    How to record color video?

    Question

    I try the example in the document. The gray image can be recorded. The output video is fine. But when I comment the color convert code, the video seems corrupt.

    # import libraries
    from vidgear.gears import ScreenGear
    from vidgear.gears import WriteGear
    import cv2
    
    
    options = {'top': 40, 'left': 0, 'width': 100, 'height': 100} # define dimensions of screen w.r.t to given monitor to be captured
    
    output_params = {"-vcodec":"libx264", "-crf": 0, "-preset": "fast"} #define (Codec,CRF,preset) FFmpeg tweak parameters for writer
    
    
    stream = ScreenGear(monitor=1, logging=True, **options).start() #Open Live Screencast on current monitor 
    
    writer = WriteGear(output_filename = 'Output.mp4', compression_mode = True, logging = True, **output_params) #Define writer with output filename 'Output.mp4' 
    
    # infinite loop
    while True:
    	
    	frame = stream.read()
    	# read frames
    
    	# check if frame is None
    	if frame is None:
    		#if True break the infinite loop
    		break
    	
    
    	# {do something with frame here}
            # gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
    
    	# write a modified frame to writer
            writer.write(frame) 
           
            # Show output window
    	cv2.imshow("Output Frame", frame)
    
    	key = cv2.waitKey(1) & 0xFF
    	# check for 'q' key-press
    	if key == ord("q"):
    		#if 'q' key-pressed break out
    		break
    
    cv2.destroyAllWindows()
    # close output window
    
    stream.stop()
    # safely close video stream
    writer.close()
    # safely close writer
    
    ENHANCEMENT :zap: QUESTION :question: SOLVED :checkered_flag: 
    opened by Seraphli 35
  • live stream from youtube

    live stream from youtube

    Hello, I'm trying to read live stream from youtube but after 10 seconds the streaming blocks.

    I tried the following URL : https://www.youtube.com/watch?v=d29O7DT6NHQ - https://www.youtube.com/watch?v=1EiC9bvVGnk.

    I red your FAQ & Troubleshooting but I don't find a solution.

    I'm working with the last version of Python (3.8 64 bits) and the version of Camgear on Windows 10.

    Your code is very simple and works with simple youtube video and RSTP video without problem->

    # import libraries
    from vidgear.gears import CamGear
    import cv2
    stream = CamGear(source='https://www.youtube.com/watch?v=d29O7DT6NHQ', y_tube =True).start() # YouTube Video URL as input
    # infinite loop
    while True:
        frame = stream.read()
        # read frames
        # check if frame is None
        if frame is None:
            #if True break the infinite loop
            break
        # do something with frame here
        cv2.imshow("Output Frame", frame)
        # Show output window
        key = cv2.waitKey(1) & 0xFF
        # check for 'q' key-press
        if key == ord("q"):
            #if 'q' key-pressed break out
            break
    cv2.destroyAllWindows()
    # close output window
    stream.stop()
    # safely close video stream.
    
    BUG :bug: SOLVED :checkered_flag: EXTERNAL BUG :space_invader: 
    opened by Smart-Stadium 30
  • How to add audio to WriteGear class?

    How to add audio to WriteGear class?

    Many thanks for your VidGear code. In real time I am trying to process a webcam video input using Opencv (using Ubuntu) then write the output to a file using writegear (no audio at this point) and all works fine. The problem comes when I try and add the audio from the webcam to the output. I thought inserting something simple like -f alsa -ac 1 -i hw:0 so the ffmpeg command line looks like ffmpeg -y -f rawvideo -vcodec rawvideo -s 1280x720 -pix_fmt gray -i - -f alsa -ac 1 -i hw:0 -vcodec libx264 -crf 0 -preset fast output.mp4 at the point you build the ffmpeg string cmd (line 318 in writegear) would do the trick but that simply throws an ffmpeg error. However I structure the ffmpeg command I can't get ffmpeg to accept the command string. Is it possible to add audio to the writegear ffmpeg output?

    BUG :bug: ENHANCEMENT :zap: QUESTION :question: SOLVED :checkered_flag: 
    opened by mj43 28
  • CalledProcessError at /teaches/api/v1/admin/video-upload

    CalledProcessError at /teaches/api/v1/admin/video-upload

    Description

    django project after upload video and use streamgear occer this erorr CalledProcessError at /teaches/api/v1/admin/video-upload Command '['ffmpeg', '-y', '-hide_banner', '-i', '/usr/src/app/media/upload/2021/01/1609541608-vide-finnanc.mp4', '-vcodec', 'libx264', '-vf', 'format=yuv420p', '-aspect', '0', '-crf', '18', '-tune', 'zerolatency', '-preset', 'ultrafast', '-acodec', 'aac', '-movflags', '+faststart', '-map', '0', '-s:v:0', '0x5581', '-b:v:0', '0k', '-b:a:0', '96k', '-map', '0', '-s:v:1', '320x240', '-b:v:1', '500k', '-b:a:1', '96k', '-bf', '1', '-sc_threshold', '0', '-keyint_min', '50', '-g', '50', '-use_timeline', '1', '-use_template', '1', '-window_size', '5', '-adaptation_sets', 'id=0,streams=v id=1,streams=a', '-f', 'dash', '/usr/src/app/media/upload/1609541608-vide-finnanc.mpd']' returned non-zero exit status 1.

    code

    file = request.FILES.get('file')
        fs = FileSystemStorage()
        category = ''
        if 'category' in request.data.keys():
            category = request.data['category'] + '/'
    
        path = f"{settings.UPLOAD_URL}{category}{datetime.datetime.now().strftime('%Y/%m/%s')}"
        name, extension = os.path.splitext(file.name)
        if extension not in ['.mp4']:
            return Response({
                "detail": "invalid video file format"
            }, status=status.HTTP_422_UNPROCESSABLE_ENTITY)
    
        filename = fs.save(f"{path}-{slugify(name)}{extension}", file)
        uploaded_file_url = fs.url(filename)
    
        ''' 
            Encode Video
            encode upload video file
        '''
        # activate Single-Source Mode with valid video input
        stream_params = {
            "-video_source": f"{settings.MEDIA_ROOT}/{filename}",
            "-streams": [
                {"-resolution": "320x240", "-video_bitrate": "500k"},  # Stream3: 320x240 at 500kbs bitrate
            ],
        }
        # describe a suitable manifest-file location/name and assign params
        encodeUrl = f"media/upload/{filename.split('/')[-1].replace('.mp4', '')}.mpd"
        streamer = StreamGear(output=encodeUrl,format="dash", **stream_params)
        # trancode source
        streamer.transcode_source()
        # terminate
         streamer.terminate()` 
    

    stream gear log

    StreamGear :: CRITICAL :: StreamGear has been successfully configured for Single-Source Mode.
    
    StreamGear :: INFO :: Source Audio will be used for streams.
    
     
    
    StreamGear :: CRITICAL :: Transcoding streaming chunks. Please wait...
    
    Processing Frames: 0% 0/27 [00:00<?, ?frame/s]
    
    StreamGear :: ERROR :: StreamGear failed to initiate stream for this video source!
    

    Environment

    • VidGear version: 0.1.9
    • Python version: 3.8
    • PiP version: 20
    • Operating System and version: docker-python image
    BUG :bug: SOLVED :checkered_flag: 
    opened by esmaily 26
  • Live passthrough with audio

    Live passthrough with audio

    Question

    Would it be possible in future to process live streams with the help of VideoGear to stabilize it and output a stream with WriteGear which would have the audio from incoming source?

    Acknowledgment

    • [x] I have searched the issues for my issue and found nothing related or helpful.
    • [x] I have read the FAQs.
    • [x] I have read the Documentation.

    Context

    I just want to process the incoming stream and output a stabilized video with synced audio from same source.

    Here is the code I have now

    # Import libraries
    from vidgear.gears import VideoGear
    from vidgear.gears import WriteGear
    import cv2
    import signal
    
    # Formatting / additional parameters
    options = {
      "SMOOTHING_RADIUS": 20, # Smooth by 20 pixels
      "BORDER_SIZE": 0, # Set the border for cropping
      "CROP_N_ZOOM": False, # Crop and zoom
      "CAP_PROP_FRAME_WIDTH": 1280, # Width of the frames
      "CAP_PROP_FRAME_HEIGHT": 720, # Height of the frames
      "CAP_PROP_FPS": 30, # 30 FPS
      "THREADED_QUEUE_MODE": True # Threaded queue mode
    }
    
    # Open video source
    stream = VideoGear(
      source="rtmp://xyz.abc/def/ghi",
      backend=cv2.CAP_FFMPEG,
      stabilize=True,
      logging=True,
      **options
    ).start()
    
    # Set the output params for local rtmp stream
    output_params = {
      "-listen": "1",
      "-vcodec": "libx264",
      "-tune": "zerolatency",
      "-profile:v": "main",
      "-pix_fmt": "yuv420p",
      "-preset:v": "veryfast",
      "-g": 30,
      "-b:v": "4000k",
      "-maxrate": "10000k",
      "-bufsize": "10000k",
      "-f": "flv"
    }
    
    writer = WriteGear("rtmp://localhost:1935", logging=True, **output_params)
    
    # Set signal handler because KeyboardInterrupt doesn't fire in every situation it should.
    signal.signal(signal.SIGINT, signal.default_int_handler)
    
    while True:
      try:
        # Read frame from the stream
        frame = stream.read()
    
        # Skip if there's no frame
        if frame is None:
          break
    
        # Write frame to local stream
        writer.write(frame)
      except KeyboardInterrupt:
        # Gracefully shutdown when CTRL+C
        break
    
    # Stop everything and clear resources
    stream.stop()
    writer.close()
    

    Your Environment

    • VidGear version: 0.2.1
    • Branch: PyPi
    • Python version: 3.9.4
    • PiP version: 21.1
    • Operating System and version: Windows 10 20H2
    POSTPONED :hourglass: DOCS :scroll: PARTIALLY RESOLVED :hourglass: 
    opened by LosTigeros 25
  • [Bug]: Memory Leakage with YouTube video

    [Bug]: Memory Leakage with YouTube video

    Hi! These days I came across this issue, where it appears that the memory usage keeps increasing as I stream a video. In this example, it increases even more, but in a microserver setting, like launching this script in a REST-API server, there is a steady but small increase over time.

    In this scenario, I run the script with docker;

    # main.py
    
    from memory_profiler import profile
    from vidgear.gears import VideoGear
    from typing import Callable
    import logging
    import time
    import cv2
    
    
    fp = open("/workspace/memory_profiler.log","w+")
    
    
    class VideoStream:
    
        def __init__(
            self,
            stream_source: str,
            stream_resolution: str = "sd",
            stream_framerate: int = 4,
            stream_max_frames: int = float("inf"),
            stream_backend: int = cv2.CAP_GSTREAMER,
            func: Callable = None,
            reconnect_frequency: int = 3600,
            *args, **kwargs
        ):
    
            # stream params
            self.stream_source = stream_source
            self.stream_resolution = stream_resolution
            self.stream_framerate = stream_framerate
            self.stream_max_frames = stream_max_frames \
                if stream_max_frames not in [-1, None] else float("inf")
            self.stream_backend = stream_backend
            self.reconnect_frequency = reconnect_frequency
    
            self.stream = self.init_stream()
            self.func = func
    
            # utils
            self.n_frame = 0
            self.last_reconnection = time.time()
            # For YouTube video, its better to reduced the amount of requests
            self.stream_sleep = 0.05 if self.is_stream_mode(self.stream_source) else 0
    
        def get_stream_info(self):
            info = {
                "height": int(self.stream.stream.get(cv2.CAP_PROP_FRAME_HEIGHT)),
                "width": int(self.stream.stream.get(cv2.CAP_PROP_FRAME_WIDTH)),
                "total": int(self.stream.stream.get(cv2.CAP_PROP_FRAME_COUNT)),
                "fps": self.stream.stream.get(cv2.CAP_PROP_FPS),
            }
            return info
    
        @staticmethod
        def is_stream_mode(source):
            return False if str(source).isdigit() else True
    
        def init_stream(self):
    
            stream_mode = self.is_stream_mode(self.stream_source)
    
            if stream_mode:
                options = {
                    "STREAM_RESOLUTION": "best",
                    "STREAM_PARAMS": {"nocheckcertificate": True},
                }
    
            else:
                options = {"CAP_PROP_FPS": 30}
    
            stream = VideoGear(
                source=self.stream_source,
                backend=self.stream_backend,
                stream_mode=stream_mode,
                logging=False,
                **options
            )
            logging.info(f"Stream with source '{self.stream_source}' initialized.")
            return stream
    
        def start_stream(self):
            self.stream.start()
            logging.info(f"Stream with source '{self.stream_source}' started.")
    
        def stop_stream(self):
            self.stream.stop()
            logging.info(f"Stream with source '{self.stream_source}' stopped.")
    
        def stop(self):
            self.stop_stream()
    
        def fetch_frame(self):
            return self.stream.read()
    
        def generator(self):
            self.start_stream()
    
            total_frames = 0
            while True:
                frame = self.fetch_frame()
    
                if frame is None or self.n_frame >= self.stream_max_frames:
                    break
    
                if total_frames % (30 // self.stream_framerate) == 0:
                    inputs = {
                        "id": self.n_frame,
                        "image": cv2.imencode(".jpg", frame)[1].tobytes(),
                        "source": str(self.stream_source),
                        "timestamp": time.time()
                    }
                    yield self.func(**inputs) if self.func else inputs
                    self.n_frame += 1
    
                if self.stream_sleep:
                    time.sleep(self.stream_sleep)
                total_frames += 1
    
            self.stop_stream()
    
        def __iter__(self):
            yield from self.generator()
    
    
    @profile(stream=fp)
    def main():
    
        stream = {
            "name": "live1",
            "stream_source": "http://youtube.com/watch?v=y7QiNgui5Tg",
            "stream_framerate": 4,
            "stream_resolution": "best",
            "stream_max_frames": 100
        }
    
        videostreamer = VideoStream(**stream)
    
        for frame in videostreamer:
            print(frame["id"], end='\r')
    
    
    if __name__ == "__main__":
        main()
    
    # Dockerfile
    
    FROM python:3.8-slim
    
    # utils -------------------------------------------
    ENV PYTHONDONTWRITEBYTECODE 1
    ENV PYTHONUNBUFFERED 1
    ENV OPENCV_VERSION="4.5.1"
    ENV TZ Europe/Amsterdam
    RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
    
    # init virtualenv ---------------------------------
    ENV VIRTUAL_ENV=/opt/venv
    RUN python3 -m venv $VIRTUAL_ENV
    ENV PATH="$VIRTUAL_ENV/bin:$PATH"
    
    # install OpenCV ----------------------------------
    WORKDIR /opt/build
    RUN apt-get -qq update \
        && apt-get -qq install -y --no-install-recommends \
            build-essential \
            cmake \
            git \
            wget \
            unzip \
            yasm \
            pkg-config \
            libswscale-dev \
            libtbb2 \
            libtbb-dev \
            libjpeg-dev \
            libpng-dev \
            libtiff-dev \
            libopenjp2-7-dev \
            libavformat-dev \
            libpq-dev \
            libgstreamer1.0-0 \
            ffmpeg \
            gstreamer1.0-plugins-base \
            gstreamer1.0-plugins-good \
            gstreamer1.0-plugins-bad \
            gstreamer1.0-plugins-ugly \
            gstreamer1.0-libav \
            gstreamer1.0-tools \
            libgstreamer1.0-dev \
            libgstreamer-plugins-base1.0-dev \
            protobuf-compiler \
            libgtk2.0-dev \
            ocl-icd-opencl-dev \
        && pip install numpy \
        && wget -q https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip -O opencv.zip \
        && unzip -qq opencv.zip -d /opt \
        && rm -rf opencv.zip \
        && cmake \
            -D BUILD_TIFF=ON \
            -D BUILD_opencv_python2=OFF \
            -D BUILD_opencv_java=OFF \
            -D CMAKE_BUILD_TYPE=RELEASE \
            -D WITH_CUDA=OFF \
            -D WITH_OPENGL=ON \
            -D WITH_OPENCL=ON \
            -D WITH_TBB=ON \
            -D WITH_EIGEN=ON \
            -D WITH_V4L=ON \
            -D BUILD_TESTS=OFF \
            -D BUILD_PERF_TESTS=OFF \
            -D CMAKE_BUILD_TYPE=RELEASE \
            -D CMAKE_INSTALL_PREFIX=$(python -c "import sys; print(sys.prefix)") \
            -D PYTHON3_EXECUTABLE=$(which python3) \
            -D PYTHON3_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
            -D PYTHON3_PACKAGES_PATH=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
            -D WITH_GSTREAMER=ON \
            -D WITH_FFMPEG=ON \
            /opt/opencv-${OPENCV_VERSION} \
        && make -j$(nproc) \
        && make install \
        && rm -rf /opt/build/* \
        && rm -rf /opt/opencv-${OPENCV_VERSION} \
        && rm -rf /var/lib/apt/lists/* \
        && apt-get -qq autoremove \
        && apt-get -qq clean
    
    # install pip packages ----------------------------
    RUN pip3 install --upgrade pip \
        && pip3 install --no-cache-dir \
            vidgear[core]>=0.2.4
    
    RUN pip3 install memory_profiler
    
    # run.sh
    docker build . -t venv:latest
    docker run \
        -v $PWD:/workspace \
        venv:latest python3 /workspace/main.py
    
    QUESTION :question: SOLVED :checkered_flag: 
    opened by ioangatop 24
  • Wrong validation - ValueError: [WriteGear:ERROR] :: output_filename value:`/Users/*****/Documents/PythonEnv/1.mp4` is not valid/supported in Compression Mode!

    Wrong validation - ValueError: [WriteGear:ERROR] :: output_filename value:`/Users/*****/Documents/PythonEnv/1.mp4` is not valid/supported in Compression Mode!

    Description

    The WriteGear is checking for OS folder access and failing the process for no good reason, after bypassing the check all is working as expected.

    Acknowledgment

    Environment

    VidGear 0.2.0 Branch: PyPi Python 3.9.1 Pip 20.3.4 OS: Mac 10.14.6

    Expected Behavior

    The local video file should rendered/created using FFMPEG.

    Actual Behavior

    I got the following error (logging is True):

    Output file: /Users/**/Documents/PythonEnv/1.mp4 15:46:25 :: WriteGear :: WARNING :: The given path:/Users/******/Documents/PythonEnv/1.mp4 does not have write access permission. Skipped! 15:46:25 :: WriteGear :: DEBUG :: Compression Mode is enabled therefore checking for valid FFmpeg executables. 15:46:25 :: WriteGear :: DEBUG :: Output Parameters: {'-input_framerate': 29.97002997002997, '-vf': 'scale=3840x1080', '-c:v': 'libx264', '-crf': '1', '-maxrate': '20.0M', '-bufsize': '24M', '-pix_fmt': 'yuv420p'} 15:46:25 :: Helper :: DEBUG :: Final FFmpeg Path: ffmpeg 15:46:25 :: Helper :: DEBUG :: FFmpeg validity Test Passed! 15:46:25 :: Helper :: DEBUG :: Found valid FFmpeg Version: b'4.3.1' installed on this system 15:46:25 :: WriteGear :: DEBUG :: Found valid FFmpeg executables: ffmpeg. 15:46:26 :: Helper :: WARNING :: URL scheme /Users/*****/Documents/PythonEnv/1.mp4 is not supported by FFmpeg! Traceback (most recent call last): File "/Users/***/Documents/PythonEnv/./gyroflow/gyroflow.py", line 1519, in export_video self.stab.renderfile(start_time, stop_time, filename[0], out_size = out_size, File "/Users//Documents/PythonEnv/gyroflow/stabilizer.py", line 511, in renderfile out = WriteGear(output_filename=outpath, **output_params, logging=True) File "/Users/*******/Documents/PythonEnv/venv391/lib/python3.9/site-packages/vidgear/gears/writegear.py", line 246, in init raise ValueError( ValueError: [WriteGear:ERROR] :: output_filename value:/Users/******/Documents/PythonEnv/1.mp4 is not valid/supported in Compression Mode!

    Possible Fix

    In WriteGear.py: Line 126 : I changed: if ( self.__os_windows or os.access in os.supports_effective_ids ) and os.access(os.path.dirname(abs_path), os.W_OK): To if(True) and it all worked. Meaning the if expression is not working properly. My guess is that it is different on a PC vs Mac or that the Virtual Environment is impacting this 'if'

    Steps to reproduce

    (Write your steps here:)

    1. Download gyroFlow and all dependencies (VidGear included)
    2. Run Venv (Python Virtual Environment) with all the dependencies
    3. Try to stabilize a video
    BUG :bug: SOLVED :checkered_flag: 
    opened by nivim 23
  • Using ScreenGear with WebGear_RTC

    Using ScreenGear with WebGear_RTC

    How to add ScreenGear with WebGear_RTC

    Question

    I want to use ScreenGear to capture the screen and use WebGear_RTC to broadcast it to frontend.

    Here's my code.

    # import required libraries
    from av import VideoFrame
    from aiortc import VideoStreamTrack
    from aiortc.mediastreams import MediaStreamError
    from vidgear.gears import ScreenGear
    from vidgear.gears.asyncio import WebGear_RTC
    from vidgear.gears.asyncio.helper import reducer
    import cv2
    import uvicorn
    
    # various performance tweaks
    options = {
        "frame_size_reduction": 25,
        "enable_live_broadcast": True,
    }   
    
    # initialize WebGear_RTC app
    web = WebGear_RTC(logging=True, **options)
    
    # create your own Bare-Minimum Custom Media Server
    class Custom_RTCServer(VideoStreamTrack):
        """
        Custom Media Server using OpenCV, an inherit-class
        to aiortc's VideoStreamTrack.
        """
        def __init__(self, source=None):
    
            # don't forget this line!
            super().__init__()
    
            self.stream = ScreenGear(monitor=2, logging=True).start()
        
        async def recv(self):
            """
            A coroutine function that yields `av.frame.Frame`.
            """
            frame = self.stream.read()
            if not frame:
                return MediaStreamError
            
            # reducer frames size if you want more performance otherwise comment this line
            frame = await reducer(frame, percentage=30)  # reduce frame by 30%
            # contruct `av.frame.Frame` from `numpy.nd.array`
            av_frame = VideoFrame.from_ndarray(frame, format="bgr24")
            return av_frame
        
        def terminate(self):
            """
            Gracefully terminates VideoGear stream
            """
            # don't forget this function!!!
    
            # terminate
            if not (self.stream is None):
                # safely close video stream
                self.stream.stop()
                self.stream = None
    
    # assign your custom media server to config with adequate source (for e.g. foo.mp4)
    web.config["server"] = Custom_RTCServer()
    
    # run this app on Uvicorn server at address http://localhost:8000/
    uvicorn.run(web(), host="localhost", port=8000)
    
    # close app safely
    web.shutdown()
    
    

    But I'm getting error

    WebGear_RTC :: WARNING :: Given source is of NoneType!
    

    It's not working and going to the http://localhost:8000 doesn't stream my screen.

    Can you tell me what I'm doing wrong?

    Acknowledgment

    • [ x] I have searched the issues for my issue and found nothing related or helpful.
    • [ x] I have read the FAQs.
    • [ x] I have read the Documentation.

    Context

    I'm trying to create WebGear_RTC to share screen using ScreenGear

    Your Environment

    • VidGear version: 0.2.2
    • Branch: master
    • Python version: 3.9.5
    • PiP version: 20.3.4
    • Operating System and version: Linux
    INVALID :stop_sign: QUESTION :question: 
    opened by harshitsinghai77 21
  • [Bug]:

    [Bug]: "Audio source [...] is not valid, Skipped!", for a file that should be valid

    Description

    I have a valid .wav file on disk, and am supplying the correct path to StreamGear, but it does not recognize it as valid.

    I have gone down in debugging, and isolated the problematic piece of code here: https://github.com/abhiTronix/vidgear/blob/6e4eaf6e8f29f4145afabf96d3fc30c8b81f69fc/vidgear/gears/helper.py#L656-L665

    For my "problematic" file, here is the metadata's value:

    In [3]: metadata
    Out[3]: b"Guessed Channel Layout for Input Stream #0.0 : mono\r\nInput #0, wav, from 'C:\\Users\\guillaume\\PycharmProjects\\sandbox\\streaming_prototype\\tts-multi-lang.wav':\r\n  Metadata:\r\n    encoder         : Lavf58.76.100\r\n  Duration: 00:00:25.08, bitrate: 256 kb/s\r\n  Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 16000 Hz, mono, s16, 256 kb/s\r\nAt least one output file must be specified\r\n"
    

    As you may see, that metadata does contain a bitrate and a sample rate, which should be recognized.

    However, the values of audio_bitrate and audio_sample_rate both end up being []

    It seems that looking for fltp is preventing validate_audio from actually finding these values.

    If that fltp is truly a criteria for the validity of the audio, it would be nice to include a mention about this here in the documentation

    I would also appreciate help in figuring our an ffmpeg command to convert an input audio to the required format.

    Issue Checklist

    • [X] I have searched open or closed issues for my problem and found nothing related or helpful.
    • [X] I have read the Documentation and found nothing related to my problem.
    • [X] I've read the Issue Guidelines and wholeheartedly agree.

    Expected behaviour

    The output stream should use the provided audio

    Actual behaviour

    The output stream does not use the provided audio

    Steps to reproduce

    1. Create a sample audio file, for e.g. with this command: ffmpeg -f lavfi -i anoisesrc=d=20:c=pink:sample_rate=16000 -ar 16000 noise.wav
    2. Use any(?) input video file
    3. Attempt to use StreamGear with those two

    Terminal log output

    18:25:29 ::  StreamGear   :: WARNING  :: Audio source `[...]/noise.wav` is not valid, Skipped!
    

    Python Code

    from pathlib import Path
    
    from vidgear.gears import StreamGear, CamGear
    
    
    def main():
        test_video_path = "input.mp4"
        test_audio_path = "noise.wav"
        stream_destination = "output.m3u8"
    
        format_ = "hls" if Path(stream_destination).suffix == ".m3u8" else "dash"
        stream_params = {
            "-input_framerate": 25,
            "-livestream": True,
            "-audio": test_audio_path,
        }
        stream = CamGear(source=test_video_path).start()
        streamer = StreamGear(output=stream_destination, format=format_, logging=True, **stream_params)
    
        while True:
            frame = stream.read()
            if frame is None:
                break
            streamer.stream(frame)
        stream.stop()
        streamer.terminate()
    
    
    if __name__ == '__main__':
        main()
    

    VidGear Version

    0.2.6

    Python version

    3.9

    OpenCV version

    4.4.0.46

    Operating System version

    Microsoft Windows 10 Home, Version 10.0.19044 Build 19044

    Any other Relevant Information?

    No response

    BUG :bug: PRIORITY : CRITICAL :rotating_light: WORK IN PROGRESS :construction: 
    opened by GuillaumeTong 3
  • [Proposal]: Support `Picamera2`

    [Proposal]: Support `Picamera2`

    Issue guidelines

    Issue Checklist

    • [X] I have searched open or closed issues and found nothing related to my idea.
    • [X] I have read the Documentation and it doesn't mention anything about my idea.
    • [X] To my best knowledge, my idea wouldn't break something for other users.

    Describe your Idea

    With Bullseye, Raspberry Pi moved away from the legacy camera support to their own libcamera-fuelled picamera2. It aims at being a slot-in replacement for picamera. It is still possible to use the legacy picamera, but it's being deprecated and is slowly starting to break things.

    Although picamera2 is still in beta, I'd propose beginning to implement it.

    Use Cases

    Anyone using Raspberry Pi cameras, especially newer custom cameras (e.g. from Arducam).

    Any other Relevant Information?

    The picamera2repo: https://github.com/raspberrypi/picamera2 Documentation: https://datasheets.raspberrypi.com/camera/picamera2-manual.pdf

    I can begin slowly and create a pull request, hoping that it really is mostly a slot-in replacement. Would you prefer having an additional PiGear2 class inside pigear.py, or a new pigear2.py?

    ENHANCEMENT :zap: WORK IN PROGRESS :construction: PROPOSAL :envelope_with_arrow: 
    opened by roaldarbol 4
  • [Question]: Donot create/use templates(html files)

    [Question]: Donot create/use templates(html files)

    Issue guidelines

    Issue Checklist

    • [X] I have searched open or closed issues for my problem and found nothing related or helpful.
    • [X] I have read the Documentation and found nothing related to my problem.
    • [X] I have gone through the Bonus Examples and FAQs and found nothing related or helpful.

    Describe your Question

    How do I set the parameter so that vidgear doesn't require the HTML files.

    I just want to use the /video endpoint and disable automatic template creation.

    VidGear Version

    0.2.6

    Python version

    3.8

    Operating System version

    Ubuntu 20.04

    Any other Relevant Information?

    No response

    ENHANCEMENT :zap: WORK IN PROGRESS :construction: PROPOSAL :envelope_with_arrow: 
    opened by 4nuragk 2
  • [Proposal]: Please only print banner if I call/use vidgear, not at import

    [Proposal]: Please only print banner if I call/use vidgear, not at import

    Issue guidelines

    Issue Checklist

    • [X] I have searched open or closed issues and found nothing related to my idea.
    • [X] I have read the Documentation and it doesn't mention anything about my idea.
    • [X] To my best knowledge, my idea wouldn't break something for other users.

    Describe your Idea

    Please only print banner if I call/use vidgear, not at import.

    Currently I've moved the import to below an if guard

        if our_args.record:
            import vidgear.gears
    

    ... but lots of linters don't like this kind of construction.

    I'm happy to have a banner showing, but would prefer it only to show when I'm actually using/calling the library, not simply at import, please.

    Note that I have not read the issue guidelines, nor searched open and closed issues etc. I just ticked the boxes because it was mandated by this form. Please feel free to close this issue on that basis.

    Use Cases

    Means I don't need to add a guard around the vidgear import, in order not to get a banner when I'm not using it.

    Any other Relevant Information?

    No response

    ENHANCEMENT :zap: WORK IN PROGRESS :construction: PROPOSAL :envelope_with_arrow: 
    opened by hughperkins 3
  • [Proposal]: Improve ScreenGear capture rate using DXcam (Windows)

    [Proposal]: Improve ScreenGear capture rate using DXcam (Windows)

    Brief Description

    While mss and pil are capable of decent capture rates, the rate can be greatly improved using DXcam.

    DXcam uses the Windows Desktop Duplication API.

    Context

    Allowing faster capture rates would allow vidgear to capture video game input far more accurately. I was able to achieve capturing frames > 90 fps average as compared to ~30 fps using mss or Pillow.

    Your Current Environment

    • VidGear version: 0.2.5
    • Branch: PyPi
    • Python version: 3.9.6
    • Operating System and version: Win 11
    ENHANCEMENT :zap: WORK IN PROGRESS :construction: PROPOSAL :envelope_with_arrow: 
    opened by ReenigneArcher 8
  • OpenCV video decoding too slow for vidgear - ffmpeg might be better suited for decoding

    OpenCV video decoding too slow for vidgear - ffmpeg might be better suited for decoding

    Detailed Description

    I've ran some encode and decode benchmarks, and it's becoming fairly obvious, that VidGear (CamGear API) is currently unable to decode 1080p60 video on computers where, given certain settings, ffmpeg can encode 1080p60 in real time or slightly faster without hardware acceleration.

    Context

    Currently, it's impossible to pass 1080p60 H264 (only tested codec) video through VidGear on computers that should be able to decode 1080p60 video just fine. The idea would be to replace the OpenCV VideoStream API with something more performant, like ffmpeg, since ffmpeg is capable of outputting raw video into stdout.

    The CamGear API should not need to change from the developer's standpoint.

    Your Environment

    • VidGear version: 0.1.8
    • Branch: PyPI
    • Python version: 3.8.2
    • pip version: 19.2.3
    • Operating System and version: Win10Pro 1909

    Any Other Important Information

    Encode/Decode benchmarks for VidGear (encode is compressed, so ffmpeg):

    > poetry run sp-benchmark
    Results:
            Encode:
                    1080p: 71.34738617215714
                    900p: 94.22808977047293
                    720p: 137.51681644444432
                    480p: 388.3952044196786
                    360p: 506.7212349134308
                    240p: 1020.0560010744543
                    144p: 1860.4607896260777
            Decode:
                    1080p: 36.054442749368185
                    900p: 44.78923780306475
                    720p: 55.349642074620796
                    480p: 76.08067848749076
                    360p: 81.93545752827764
                    240p: 90.02970867849261
                    144p: 99.95882945711747
    

    ffmpeg decode benchmark (4k60):

    > ffmpeg -i .\streampipe\benchmark\resources\bbb_sunflower_2160p_60fps_normal.mp4 -f null -
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '.\streampipe\benchmark\resources\bbb_sunflower_2160p_60fps_normal.mp4':
      Duration: 00:10:34.53, start: 0.000000, bitrate: 8487 kb/s
        Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 3840x2160 [SAR 1:1 DAR 16:9], 8002 kb/s, 60 fps, 60 tbr, 60k tbn, 120 tbc (default)
        Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)
        Stream #0:2(und): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 320 kb/s (default)
    Stream mapping:
      Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native))
      Stream #0:2 -> #0:1 (ac3 (native) -> pcm_s16le (native))
    Press [q] to stop, [?] for help
    Output #0, null, to 'pipe:':
        Stream #0:0(und): Video: wrapped_avframe, yuv420p(progressive), 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 60 fps, 60 tbn, 60 tbc (default)
        Stream #0:1(und): Audio: pcm_s16le, 48000 Hz, 5.1(side), s16, 4608 kb/s (default)
    frame=38072 fps=152 q=-0.0 Lsize=N/A time=00:10:34.56 bitrate=N/A speed=2.53x
    video:19928kB audio:356706kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
    
    ENHANCEMENT :zap: WORK IN PROGRESS :construction: PROPOSAL :envelope_with_arrow: 
    opened by golyalpha 31
Releases(vidgear-0.2.6)
  • vidgear-0.2.6(Jul 5, 2022)

    📓 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 .gitignore to ignore pypi's build directory and egg-info files.
    • CI:
      • Switched to new Issue GitHub's form schema using YAMLs.

    Updates/Improvements ⚡️

    • Setup.py:
      • Replaced distutils.version.LooseVersion with pkg_resources.parse_version.
    • 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.
      • Redesigned and Rewritten Donation and Contribution section to README.md.
    • API:
      • Updated depreciated tostring() to tobytes() for the purposes for clarity in Python 3.2.
    • CI:
      • Added more paths and files to skip commits.

    Breaking Updates/Changes 💥

    • -input_framerate parameter now accepts any positive value for WriteGear and StreamGear APIs.

    Bug-fixes 🐛

    • API: Fixed -input_framerate less 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_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).
    • CI:
      • Fixed pinned version syntax bug in docs_deployer workflow.
      • Fixed typos in Github forms and its context.
    • 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
      • 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.
    Source code(tar.gz)
    Source code(zip)
    vidgear-0.2.6-py3-none-any.whl(109.25 KB)
    vidgear-0.2.6.tar.gz(121.68 KB)
  • vidgear-0.2.5(Feb 11, 2022)

    📓 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_filename parameter.
        • Added new special -gst_pipeline_mode attribute to its output_params dictionary parameter to enable this mode.
        • This feature provides flexible way to directly write video frames into custom GStreamer Pipeline with controlled bitrate.
      • Added new -ffpreheaders special attribute to WriteGear's output_params dictionary 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.
    • 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.
    • Maintenance:
      • 🌟 Added official support for Python-3.10 legacies. 🌟
      • Added float value support to THREAD_TIMEOUT optional 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 💥

    • :warning: 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.
    Source code(tar.gz)
    Source code(zip)
    vidgear-0.2.5-py3-none-any.whl(109.01 KB)
    vidgear-0.2.5.tar.gz(120.84 KB)
  • vidgear-0.2.4(Dec 5, 2021)

    📓 Complete Release Notes can be found here ↗️


    New Features ✨

    • CamGear:
      • Added a new YT_backend Internal Class with YT-DLP backend:
        • Implemented YT_backend a 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_metadata global parameter to CamGear for accessing video's metadata(such as duration, title, description) on-the-go.
        • ⚠️ Playlists are still unsupported.
    • WebGear_RTC:
      • Implemented a new easy way of defining Custom Streaming Class with suitable source(such as OpenCV):
        • 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.

    Updates/Improvements ⚡️

    • CamGear:
      • Added is_livestream global 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.
    • Setup.py:
      • Moved all API specific dependencies to extra_requires under the name "core". [PR #268 by @zpapakipos]
      • Added rule to replace GitHub heading links in description.
      • Updated extra_require dependencies.
      • Removed streamlink dependency.
      • Removed pafy dependency.

    Breaking Updates/Changes 💥

    • ⚠️ Installation command with pip has been changed in v0.2.4:
      • The legacy pip install vidgear command now installs critical bare-minimum dependencies only. Therefore in order to automatically install all the API specific dependencies as previous versions, use pip install vidgear[core] command instead.
    • CamGear:
      • ⚠️ Removed streamlink backend support from stream_mode in favor of more reliable CamGear's Internal YT-DLP backend class for extracting metadata from Streaming URLs.
        • CamGear will raise ValueError if streaming site URL is unsupported by yt-dlp backend.
        • CamGear will raise ValueError if yt-dlp isn't installed and stream_mode is enabled.
      • ⚠️ 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 its config global parameter.
      • ⚠️ WebGear_RTC API will now throws ValueError if source parameter is NoneType as well as custom_stream attribute is undefined.
    • Helper:
      • ⚠️ Removed restore_levelnames method.
      • ⚠️ Removed youtube_url_validator method.

    Bug-fixes 🐛

    • CamGear:
      • Fixed KeyError Bug for missing attributed in meta_data json in some streaming sites.
    • Helper:
      • Removed unused imports.

    Related Pull Requests 🔧

    • PR #268
    • PR #272
    • PR #274
    Source code(tar.gz)
    Source code(zip)
    vidgear-0.2.4-py3-none-any.whl(108.68 KB)
    vidgear-0.2.4.tar.gz(120.84 KB)
  • vidgear-0.2.3(Oct 27, 2021)

    📓 Complete Release Notes can be found here ↗️


    New Features ✨

    • CamGear:
      • Added support for 4K Streaming URLs.
    • Helper:
      • Implemented logging ColorFormatter string alignment.

    Updates/Improvements ⚡️

    • CamGear:
      • Replaced youtube-dl with yt-dlp as pafy backend for YouTube videos pipelining.
        • Implemented hack to trick pafy into assuming yt-dlp as youtube-dl.
        • Replaced youtube-dl dependency with yt-dlp.
        • Replaced youtube-dl imports with yt-dlp.
    • Helper:
      • Enabled logging for check_WriteAccess method.
    • Maintenance:
      • Added .gitignore for specifying intentionally untracked files to ignore
      • Added .gitattributes to manage how Git reads line endings.
      • Introduced python short-circuiting for handling logging logic in APIs.

    Breaking Updates/Changes 💥

    • check_WriteAccess will 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:
      • Fixed StreamGear Malformed URI Error with HLS Segments [PR #243 by @Vboivin]
        • Removed the extra '%' character from the naming convention for segment files.
        • Used internal stream_count dict variable to alter template for HLS segment filenames.
    • WriteGear:
      • Fixed bug in -disable_force_termination attribute logic which accidentally disables force termination.
    • WebGear_RTC:
      • Fixed name 'VideoStreamTrack' is not defined bug.
    • Setup.py:
      • Fixed TypeError bug.
      • Fixed invalid latest_version retrieval.
    • Helper:
      • Fixed check_WriteAccess failing to recognize correct permission for writing the output file on windows platform.
        • Implemented separate logic for Windows and *nix platforms.
      • Fixed bug in check_WriteAccess that throws OSError while handling URLs.

    Related Pull Requests 🔧

    • PR #249
    • PR #262
    Source code(tar.gz)
    Source code(zip)
    vidgear-0.2.3-py3-none-any.whl(108.69 KB)
    vidgear-0.2.3.tar.gz(120.58 KB)
  • vidgear-0.2.2(Sep 2, 2021)

    :notebook: Complete Release Notes can be found here :arrow_upper_right:

    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.
        • :warning: Bidirectional mode is only available with User-defined Custom Source(i.e. source=None)
        • :warning: NetGear_Async will throw RuntimeError if bidirectional mode is disabled at server or client but not both.
      • Added new disable_confirmation used to force disable termination confirmation from client in terminate_connection.
      • Added task_done() method after every get() call to gracefully terminate queues.
      • Added new secrets and string imports.
    • 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_jpeg and decode_jpeg methods to implement turbo-JPEG transcoding with simplejpeg.
        • 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_fastupsample attributes.
      • 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.
    • WebGear_RTC:
      • Added native support for middlewares:
        • Added new global middleware variable for easily defining Middlewares as list.
      • 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.
    • Helper:
      • New automated interpolation selection for gears:
        • Implemented retrieve_best_interpolation method to automatically select best available interpolation within OpenCV.
      • Implemented get_supported_demuxers method to get list of supported demuxers.
    • Setup.py:
      • Added new cython and msgpack dependency.
      • Added msgpack and msgpack_numpy to auto-install latest.

    Updates/Improvements ⚡️

    • VidGear Core:
      • New behavior to virtually isolate optional API specific dependencies by silencing ImportError on all VidGear's APIs import.
      • Implemented algorithm to cache all imports on startup but silence any ImportError on missing optional dependency.
      • :warning: Now ImportError will be raised only any certain API specific dependency is missing during given API's initialization.
    • StreamGear:
      • Replaced depreciated -min_seg_duration flag with -seg_duration.
      • Removed redundant -re flag from RTFM.
      • Improved Live-Streaming performance by disabling SegmentTimline
      • Improved DASH assets detection for removal by using filename prefixes.
    • NetGear:
      • Replaced np.newaxis with np.expand_dims.
      • Replaced random module with secrets while generating system ID.
      • Update array indexing with np.copy.
    • NetGear_Async:
      • Improved custom source handling.
      • Removed deprecated loop parameter from asyncio methods.
      • Re-implemented skip_loop parameter in close() method.
      • :warning: run_until_complete will not used if skip_loop is enabled.
      • :warning: skip_loop now will create asyncio task instead and will enable disable_confirmation by default.
      • Replaced create_task with ensure_future to ensure backward compatibility with python-3.6 legacies.
      • Simplified code for transceive_data method.
    • WebGear_RTC:
      • Improved handling of failed ICE connection.
      • Made is_running variable globally available for internal use.
    • Helper:
      • Added 4320p resolution support to dimensions_to_resolutions method.
      • Implemented new delete_file_safe to safely delete files at given path.
      • Replaced os.remove calls with delete_file_safe.
      • Added support for filename prefixes in delete_ext_safe method.
      • Improved and simplified create_blank_frame functions frame channels detection.
      • Added logging parameter to capPropId function to forcefully discard any error(if required).
    • Setup.py:
      • Added patch for numpy dependency, numpy recently 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 aiortc to auto-install latest version.
    • Asyncio:
      • Changed asyncio.sleep value to 0.
        • 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
    • 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 💥

    • :bomb: Virtually isolated all API specific dependencies, Now ImportError for API-specific dependencies will be raised only when any of them is missing at API's initialization.
    • :bomb: Renamed delete_safe to delete_ext_safe.
    • :bomb: Dropped support for frame_jpeg_quality, frame_jpeg_optimize, frame_jpeg_progressive attributes 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_TIMEOUT with event wait timout.
        • Improved backward compatibility of new additions.
    • NetGear:
      • Fixed Bidirectional Video-Frame Transfer broken with frame-compression:
        • Fixed return_data interfering with return JSON-data in receive mode.
        • Fixed logic.
      • Fixed color-subsampling interfering with colorspace.
      • Patched external simplejpeg bug. Issue: https://gitlab.com/jfolz/simplejpeg/-/issues/11
        • Added np.squeeze to drop grayscale frame's 3rd dimension on Client's end.
      • Fixed bug that cause server end frame dimensions differ from client's end when frame compression enabled.
    • 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 timeout parameter logic.
    • WebGear_RTC:
      • Fixed stream freezes after web-page reloading:
        • Implemented new algorithm to continue stream even when webpage is reloaded.
        • Inherit and modified next_timestamp VideoStreamTrack method for generating accurate timestamps.
        • Implemented reset_connections callable to reset all peer connections and recreate Video-Server timestamps. (Implemented by @kpetrykin)
        • Added close_connection endpoint in JavaScript to inform server page refreshing.(Thanks to @kpetrykin)
        • Added exclusive reset connection node /close_connection in routes.
        • Added reset() method to Video-Server class for manually resetting timestamp clock.
        • Added reset_enabled flag 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.
    • 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.
      • Bugfix related to OpenCV import:
        • Bug fixed for OpenCV import comparison test failing with Legacy versions and throwing ImportError.
      • Fixed bug with create_blank_frame that throws error with gray frames.
      • Implemented RSTP protocol validation as demuxer, since it's not a protocol but a demuxer.
      • Removed redundant logger_handler, mkdir_safe, retrieve_best_interpolation, capPropId helper functions from asyncio package. Relatively imported helper functions from non-asyncio package.
      • Removed unused aiohttp dependency.
      • Removed asctime formatting from logging.
    • 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 Modes.
      • Fixed bugs with audio-video mapping.
      • Fixed master playlist not generating in output.
      • Fixed improper -seg_duration value resulting in broken pipeline.
      • Fixed expected aspect ratio not calculated correctly for additional streams.
      • Fixed stream not terminating when provided input from external audio device.
      • Fixed bugs related to external audio not mapped correctly in HLS format.
      • Fixed OPUS audio fragments not supported with MP4 video in HLS.
      • Fixed unsupported high audio bit-rate bug.
    • Setup.py:
      • Fixed latest_version returning incorrect version for some PYPI packages.
      • Removed latest_version variable support from simplejpeg.
      • Fixed streamlink only supporting requests==2.25.1 on Windows.
      • Removed all redundant dependencies like colorama, aiofiles, aiohttp.
    • Setup.cfg:
      • Replaced dashes with underscores to remove warnings.

    Related Pull Requests 🔧

    • PR #210
    • PR #215
    • PR #222
    • PR #223
    • PR #227
    • PR #231
    • PR #233
    • PR #237
    • PR #239
    • PR #243
    Source code(tar.gz)
    Source code(zip)
    vidgear-0.2.2-py3-none-any.whl(108.11 KB)
    vidgear-0.2.2.tar.gz(120.05 KB)
  • vidgear-0.2.1(Apr 25, 2021)

    New Features ✨

    • [x] 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_VideoServer server 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.js and custom.css for custom responsive behavior.
      • Added WebRTC support to custom.js and ensured compatibility with WebGear_RTC.
      • Added example support for ICE framework and STUN protocol like WebRTC features to custom.js.
      • Added resize() function to custom.js to automatically adjust video & img tags for smaller screens.
      • Added WebGear_RTC support in main.py for easy access through terminal using --mode flag.
      • 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.
    • [x] CamGear API:
      • New Improved Pure-Python Multiple-Threaded Implementation:
        • Optimized Threaded-Queue-Mode Performance. (PR by @bml1g12)
        • Replaced regular queue.full checks followed by sleep with implicit sleep with blocking queue.put.
        • Replaced regular queue.empty checks followed by queue.
        • Replaced nowait_get with a blocking queue.get natural empty check.
        • Up-to 2x performance boost than previous implementations.
      • New THREAD_TIMEOUT attribute to prevent deadlocks:
        • Added support for THREAD_TIMEOUT attribute to its options parameter.
        • Updated CI Tests and docs.
    • [x] 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_vencoders Helper method to enumerate Supported Video Encoders.
        • Added common handler for -c:v and -vcodec flags.
    • [x] 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_jpeg and decode_jpeg methods to implement turbo-JPEG transcoding with simplejpeg.
        • 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_fastupsample attributes.
        • Enabled fast dct by default with JPEG frames at 90%.
        • Added Docs for JPEG Frame Compression.
    • [x] WebGear API:
      • New modular and flexible configuration for Custom Sources:
        • Implemented more convenient approach for handling custom source configuration.
        • Added new config global variable for this new behavior.
        • Now None-type source parameter 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.js and custom.css for 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_frames attribute 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.
    • [x] ScreenGear API:
      • Implemented Improved Pure-Python Multiple-Threaded like CamGear.
      • Added support for THREAD_TIMEOUT attribute to its options parameter.
    • [X] StreamGear API:
      • Enabled pseudo live-streaming flag re for live content.
    • [x] 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.
    • [x] Helper:
      • New GitHub Mirror with latest Auto-built FFmpeg Static Binaries:
        • Replaced new GitHub Mirror abhiTronix/FFmpeg-Builds in 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_frame method.
      • Added c_name parameter to generate_webdata and download_webdata to specify class.
      • A more robust Implementation of Downloading Artifacts:
        • Added a custom HTTP TimeoutHTTPAdapter Adapter 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 sessionwith block to exit properly even if there are unhandled exceptions.
        • Add a retry strategy to custom TimeoutHTTPAdapter Adapter with max 3 retries and sleep(backoff_factor=1) between failed requests.
      • Added create_blank_frame method to create bland frames with suitable text.
    • [x] [CI] Continuous Integration:
      • Added new fake frame generated for fake picamera class with numpy.
      • Added new create_bug parameter to fake picamera class for emulating various artificial bugs.
      • Added float/int instance check on time_delay for camgear and pigear.
      • Added EXIT_CODE to new timeout implementation for pytests to upload codecov report when no timeout.
      • Added auxiliary classes to fake picamera for 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 coreutils brew dependency.
      • Added handler for variable check on exit and codecov upload.
      • Added is_running flag to WebGear_RTC to exit safely.
    • [x] Setup:
      • New automated latest version retriever for packages:
        • Implemented new latest_version method to automatically retrieve latest version for packages.
        • Added Some Dependencies.
      • Added simplejpeg package for all platforms.

    Updates/Improvements 🔧

    • Added exception for RunTimeErrors in NetGear CI tests.
    • WriteGear: Critical file write access checking method:
      • Added new check_WriteAccess Helper method.
      • Implemented a new robust algorithm to check if given directory has write-access.
      • Removed old behavior which gives irregular results.
    • Helper: Maintenance Updates
      • Added workaround for Python bug.
      • Added safe_mkdir to check_WriteAccess to automatically create non-existential parent folder in path.
      • Extended check_WriteAccess Patch to StreamGear.
      • Simplified check_WriteAccess to 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_audio method.
    • 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.js and header.html files from theme.
      • Added blogpost link for detailed information on Stabilizer Working.
      • Updated mkdocs.yml and custom.css configuration.
      • 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.ref from yaml.
      • Updated OpenCV Bash Script for Linux envs.
      • Added timeout-minutes flag to github-actions workflow.
      • Added timeout flag to pytest.
      • Replaced Threaded Gears with OpenCV VideoCapture API.
      • Moved files and Removed redundant code.
      • Replaced grayscale frames with color frames for WebGear tests.
      • Updated pytest timeout value to 15mins.
      • Removed aiortc automated install on Windows platform within setup.py.
      • Added new timeout logic to continue to run on external timeout for GitHub Actions Workflows.
      • Removed unreliable old timeout solution from WebGear_RTC.
      • Removed timeout_decorator and asyncio_timeout dependencies for CI.
      • Removed WebGear_RTC API exception from codecov.
      • Implemented new fake picamera class to CI utils for emulating RPi Camera-Module Real-time capabilities.
      • Implemented new get_RTCPeer_payload method to receive WebGear_RTC peer payload.
      • Removed PiGear from Codecov exceptions.
      • Disable Frame Compression in few NetGear tests failing on frame matching.
      • Updated NetGear CI tests to support new attributes
      • Removed warnings and updated yaml
        • Added pytest.ini to address multiple warnings.
        • Updated azure workflow condition syntax.
      • Update mike settings for mkdocs versioning.
      • Updated codecov configurations.
      • Minor logging and docs updates.
      • Implemented pytest timeout for azure pipelines for macOS envs.
      • Added aiortc as external dependency in appveyor.yml.
      • Re-implemented WebGear_RTC improper offer-answer handshake in CI tests.
      • WebGear_RTC CI Updated with VideoTransformTrack to test stream play.
      • Implemented fake AttributeError for fake picamera class.
      • Updated PiGear CI tests to increment codecov.
      • Update Tests docs and other minor tweaks to increase overall coverage.
      • Enabled debugging and disabled exit 1 on error in azure pipeline.
      • Removed redundant benchmark tests.
    • Helper: Added missing RSTP URL scheme to is_valid_url method.
    • NetGear_Async: Added fix for uvloop only supporting python>=3.7 legacies.
    • Extended WebGear's Video-Handler scope to https.
    • CI: Remove all redundant 32-bit Tests from Appveyor:
      • Appveyor 32-bit Windows envs are actually running on 64-bit machines.
      • More information here: https://help.appveyor.com/discussions/questions/20637-is-it-possible-to-force-running-tests-on-both-32-bit-and-64-bit-windows
    • Setup: Removed latest_version behavior from some packages.
    • NetGear_Async: Revised logic for handling uvloop for all platforms and legacies.
    • Setup: Updated logic to install uvloop-"v0.14.0" for python-3.6 legacies.
    • Removed any redundant code from webgear.
    • StreamGear:
      • Replaced Ordinary dict with Ordered Dict to use move_to_end method.
      • Moved external audio input to output parameters dict.
      • Added additional imports.
      • Updated docs to reflect changes.
    • Numerous Updates to Readme and mkdocs.yml.
    • Updated font to FONT_HERSHEY_SCRIPT_COMPLEX and enabled logging in create_blank_frame.
    • Separated channels for downloading and storing theme files for WebGear and WebGear_RTC APIs.
    • Removed logging condition to always inform user in a event of FFmpeg binary download failure.
    • WebGear_RTC:
      • Improved auto internal termination.
      • More Performance updates through setCodecPreferences.
      • Moved default Video RTC video launcher to __offer.
    • NetGear_Async: Added timeout to client in CI tests.
    • Reimplemented and updated changelog.md.
    • Updated code comments.
    • Setup: Updated keywords and classifiers.
    • Bumped codecov.

    Breaking Updates/Changes 💥

    • [x] :warning: WriteGear will automatically switch video encoder to default if specified encoder not found.
    • [x] :warning: WriteGear will throw RuntimeError if no suitable default encoder found!
    • [x] :warning: Removed format specific OpenCV decoding and encoding support for NetGear.
    • [x] :warning: Dropped support for compression_format, compression_param attributes from NetGear.
    • [x] Non-existent parent folder in output_filename value will no longer be considered as invalid in StreamGear and WriteGear APIs.
    • [x] None-type source parameter value is allowed for WebGear and NetGear_Async for defining custom sources.

    Bug-fixes 🐛

    • CamGear: Fixed F821 undefined name 'queue' bug.
    • NetGear_Async: Fixed source parameter missing None as default value.
    • Fixed uvloops only supporting python>=3.7 in NetGear_Async.
    • Helper:
      • Fixed Zombie processes in check_output method due a hidden bug in python. For reference: https://bugs.python.org/issue37380
      • Fixed regex in validate_video method.
    • Docs:
      • Invalid site_url bug patched in mkdocs.yml
      • Remove redundant mike theme support and its files.
      • Fixed video not centered when DASH video in fullscreen mode with clappr.
      • Fixed Incompatible new mkdocs-docs theme.
      • Fixed missing hyperlinks.
    • CI:
      • Fixed NetGear Address bug
      • Fixed bugs related to termination in WebGear_RTC.
      • Fixed random CI test failures and code cleanup.
      • Fixed string formating bug in Helper.py.
      • Fixed F821 undefined name bugs in WebGear_RTC tests.
      • NetGear_Async Tests fixes.
      • Fixed F821 undefined name bugs.
      • Fixed typo bugs in main.py.
      • Fixed Relative import bug in PiGear.
      • Fixed regex bug in warning filter.
      • Fixed WebGear_RTC frozen threads on exit.
      • Fixed bugs in codecov bash uploader setting for azure pipelines.
      • Fixed False-positive picamera import due to improper sys.module settings.
      • Fixed Frozen Threads on exit in WebGear_RTC API.
      • Fixed deploy error in VidGear Docs Deployer workflow
      • Fixed low timeout bug.
      • Fixed bugs in PiGear tests.
      • Patched F821 undefined name bug.
    • StreamGear:
      • Fixed StreamGear throwing Picture size 0x0 is invalid bug with external audio.
      • Fixed default input framerate value getting discarded in Real-time Frame Mode.
      • Fixed internal list-formatting bug.
    • Fixed E999 SyntaxError bug in main.py.
    • Fixed Typo in bash script.
    • Fixed WebGear freeze on reloading bug.
    • Fixed anomalies in install_opencv bash script.
    • Helper: Bug Fixed in download_ffmpeg_binaries method.
    • Helper: Fixed OSError bug in check_WriteAccess method.
    • Helper: Fixed Input Audio stream bitrate test failing to detect audio-bitrate in certain videos with validate_audio method.
    • Fixed bugs in requests module's function arguments.
    • Fixed None-type stream bug in WebGear.
    • Fixed random crashes in WebGear.
    • Fixed numerous CI test bugs.
    • Fixed several typos.

    Pull Requests

    • PR #129
    • PR #130
    • PR #155
    • PR #207
    Source code(tar.gz)
    Source code(zip)
    vidgear-0.2.1-py3-none-any.whl(98.22 KB)
    vidgear-0.2.1.tar.gz(108.68 KB)
  • vidgear-0.2.0(Jan 1, 2021)

    New Features

    • [x] CamGear API:
      • Support for various Live-Video-Streaming services:
        • 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.
      • Re-implemented YouTube URLs Handler:
        • 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.
        • Implemented new get_supported_quality helper method for handling specified qualities
        • Fixed Live-Stream URLs not supported by OpenCV's Videocapture and its FFmpeg.
      • Added additional STREAM_QUALITY and STREAM_PARAMS attributes.
    • [x] ScreenGear API:
      • Multiple Backends Support:
        • Added new multiple backend support with new pyscreenshot python library.
        • Made pyscreenshot the default API for ScreenGear, replaces mss.
        • Added new backend parameter for this feature while retaining previous behavior.
        • Added native automated RGB to BGR conversion for default PIL backend.
        • Kept support for old mss for old compatibility and multi-screen support.
        • Added native dimensional support for multi-screen.
        • Added support all input from all multiple screens.
        • Updated ScreenGear Docs.
        • Updated ScreenGear CI tests.
    • [X] StreamGear API:
      • Changed default behaviour to support complete video transcoding.
      • Added -livestream attribute to support live-streaming.
      • Added additional parameters for -livestream attribute functionality.
      • Updated StreamGear Tests.
      • Updated StreamGear docs.
    • [x] Stabilizer Class:
      • New Robust Error Handling with Blank Frames:
        • Elegantly handles all crashes due to Empty/Blank/Dark frames.
        • Stabilizer throws Warning with this new behavior instead of crashing.
        • Updated CI test for this feature.
    • [x] Docs:
      • Automated Docs Versioning:
        • Implemented Docs versioning through mike API.
        • Separate new workflow steps to handle different versions.
        • Updated docs deploy worflow to support release and dev builds.
        • Added automatic version extraction from github events.
        • Added version-select.js and version-select.css files.
      • Toggleable Dark-White Docs Support:
        • Toggle-button to easily switch dark, white and preferred theme.
        • New Updated Assets for dark backgrounds
        • New css, js files/content to implement this behavior.
        • New material icons for button.
        • Updated scheme to slate in mkdocs.yml.
      • New Theme and assets:
        • New purple theme with dark-purple accent color.
        • New images assets with updated transparent background.
        • Support for both dark and white theme.
        • Increased rebufferingGoal for dash videos.
        • New updated custom 404 page for docs.
      • Issue and PR automated-bots changes
        • New need_info.yml YAML Workflow.
        • New needs-more-info.yml Request-Info template.
        • Replaced Request-Info templates.
        • Improved PR and Issue welcome formatting.
      • Added custom HTML pages.
      • Added show_root_heading flag to disable headings in References.
      • Added new inserAfter function to version-select.js.
      • Adjusted hue for dark-theme for better contrast.
      • New usage examples and FAQs.
      • Added gitmoji for commits.
    • [x] Continuous Integration:
      • Maintenance Updates:
        • Added support for new VIDGEAR_LOGFILE environment variable in Travis CI.
        • Added missing CI tests.
        • Added logging for helper functions.
      • Azure-Pipeline workflow for MacOS envs
        • Added Azure-Pipeline Workflow for testing MacOS environment.
        • Added codecov support.
      • GitHub Actions workflow for Linux envs
        • Added GitHub Action work-flow for testing Linux environment.
      • New YAML to implement GitHub Action workflow for python 3.6, 3.7, 3,8 & 3.9 matrices.
      • Added Upload coverage to Codecov GitHub Action workflow.
      • New codecov-bash uploader for Azure Pipelines.
    • [x] Logging:
      • Added file support
        • 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 restore_levelnames auxiliary method for restoring logging levelnames.
    • [x] Added auto version extraction from package version.py in setup.py.

    Updates/Improvements

    • [x] Added missing Lazy-pirate auto-reconnection support for Multi-Servers and Multi-Clients Mode in NetGear API.
    • [x] Added new FFmpeg test path to Bash-Script and updated README broken links.
    • [x] Asset Cleanup:
      • Removed all third-party javascripts from projects.
      • Linked all third-party javascript directly.
      • Cleaned up necessary code from CSS and JS files.
      • Removed any copyrighted material or links.
    • [x] Rewritten Docs from scratch:
      • Improved complete docs formatting.
      • Simplified language for easier understanding.
      • Fixed mkdocstrings showing root headings.
      • Included all APIs methods to mkdocstrings docs.
      • Removed unnecessary information from docs.
      • Corrected Spelling and typos.
      • Fixed context and grammar.
      • Removed motivation.md.
      • Renamed many terms.
      • Fixed hyper-links.
      • Reformatted missing or improper information.
      • Fixed context and spellings in Docs files.
      • Simplified language for easy understanding.
      • Updated image sizes for better visibility.
    • [x] Bash Script: Updated to Latest OpenCV Binaries version and related changes
    • [x] Docs: Moved version-selector to header and changed default to alias.
    • [x] Docs: Updated deploy_docs.yml for releasing dev, stable, and release versions.
    • [x] Re-implemented overridden material theme.
    • [x] Updated docs with all new additions and examples.
    • [x] CamGear: CI Stream Mode test updated.
    • [x] Updated ReadMe.md badges.
    • [x] Updated CI tests.
    • [x] Updated setup.py with new features.
    • [x] Updated contributing.md and ReadMe.md.
    • [x] Updated OpenCV version to 4.5.1-dev in bash scripts
    • [x] Updated changelog.md.
    • [x] Moved WebGear API to Streaming Gears.
    • [x] Bumped Codecov.
    • [x] UI changes to version-select.js
    • [x] Docs: Retitle the versions and mkdocs.yml formatting updated.
    • [x] Docs: Version Selector UI reworked and other minor changes.

    Breaking Updates/Changes

    • [x] :warning: y_tube parameter renamed as stream_mode in CamGear API!
    • [x] :warning: Removed Travis support and travis.yml deleted.

    Bug-fixes

    • [x] Fixed StreamGear API Limited Segments Bug
    • [x] Fixed Missing links in docs and bump up version.
    • [x] CI: Fixed Appveyor need newer VM image to support Python 3.9.x matrix.
    • [x] ScreenGear BugFix: Fixed Error Handling and updated CI Tests.
    • [x] Fixed improper mkdocs.yml variables.
    • [x] Fixed GStreamer plugin support in bash scripts.
    • [x] Fixed typos in YAMLs and docs.
    • [x] Docs: Fixed Docs Deployer YAML bug for CI envs.
    • [x] Fixed wrong import in YAML.
    • [x] Fixed visible hyperlink on hover in dark-toggle button.
    • [x] Docs: Deployer YAML bug fixed.
    • [x] Docs YAML: issue jimporter/mike#33 patched and fixed fetch-depth=0.
    • [x] Docs: version-select.js bug fixed.
    • [x] Docs: UI Bugs Fixed.
    • [x] CI: Codecov bugfixes.
    • [x] Azure-Pipelines Codecov BugFixes.
    • [x] Fixed version.json not detecting properly in version-select.js.
    • [x] Fixed images not centered inside
      tag.
    • [x] Fixed Asset Colors.
    • [x] Fixed failing CI tests.
    • [x] Fixed Several logging bugs.

    Pull Requests

    • PR #164
    • PR #170
    • PR #173
    • PR #181
    • PR #183
    • PR #184
    Source code(tar.gz)
    Source code(zip)
    vidgear-0.2.0-py3-none-any.whl(88.06 KB)
    vidgear-0.2.0.tar.gz(99.00 KB)
  • vidgear-0.1.9(Sep 3, 2020)

    New Features

    • StreamGear API:
      • [X] New API that automates transcoding workflow for generating Ultra-Low Latency, High-Quality, Dynamic & Adaptive Streaming Formats.
      • [X] Implemented multi-platform , standalone, highly extensible and flexible wrapper around FFmpeg for generating chunked-encoded media segments of the media, and easily accessing almost all of its parameters.
      • [X] API automatically transcodes videos/audio files & real-time frames into a sequence of multiple smaller chunks/segments and also creates a Manifest file.
      • [X] Added initial support for MPEG-DASH (Dynamic Adaptive Streaming over HTTP, ISO/IEC 23009-1).
      • [X] Constructed default behavior in StreamGear, for auto-creating a Primary Stream of same resolution and framerate as source.
      • [X] Added TQDM progress bar in non-debugged output for visual representation of internal processes.
      • [X] Implemented several internal methods for preprocessing FFmpeg and internal parameters for producing streams.
      • [X] Several standalone internal checks to ensure robust performance.
      • [X] New terminate() function to terminate StremGear Safely.
      • [X] New StreamGear Dual Modes of Operation:
        • Implemented Single-Source and Real-time Frames like independent Transcoding Modes.
        • Linked -video_source attribute for activating these modes
        • Single-Source Mode, transcodes entire video/audio file (as opposed to frames by frame) into a sequence of multiple smaller segments for streaming
        • Real-time Frames Mode, directly transcodes video-frames (as opposed to a entire file), into a sequence of multiple smaller segments for streaming
        • Added separate functions, stream() for Real-time Frame Mode and transcode_source() for Single-Source Mode for easy transcoding.
        • Included auto-colorspace detection and RGB Mode like features (extracted from WriteGear), into StreamGear.
      • [X] New StreamGear Parameters:
        • Developed several new parameters such as:
          • output: handles assets directory
          • formats: handles adaptive HTTP streaming format.
          • custom_ffmpeg: handles custom FFmpeg location.
          • stream_params: handles internal and FFmpeg parameter seamlessly.
          • logging: turns logging on or off.
        • New stream_params parameter allows us to exploit almost all FFmpeg parameters and flexibly change its internal settings, and seamlessly generating high-quality streams with its attributes:
          • -streams (list of dictionaries) for building additional streams with -resolution, -video_bitrate & -framerate like sub-attributes.
          • -audio for specifying external audio.
          • -video_source for specifying Single-Source Mode source.
          • -input_framerate for handling input framerate in Real-time Frames Mode.
          • -bpp attribute for handling bits-per-pixels used to auto-calculate video-bitrate.
          • -gop to manually specify GOP length.
          • -ffmpeg_download_path to handle custom FFmpeg download path on windows.
          • -clear_prev_assets to remove any previous copies of SteamGear Assets.
      • [X] New StreamGear docs, MPEG-DASH demo, and recommended DASH players list:
        • Added new StreamGear docs, usage examples, parameters, references, new FAQs.
        • Added Several StreamGear usage examples w.r.t Mode of Operation.
        • Implemented Clappr based on Shaka-Player, as Demo Player.
        • Added Adaptive-dimensional behavior for Demo-player, purely in css.
        • Hosted StreamGear generated DASH chunks on GitHub and served with raw.githack.com.
        • Introduced variable quality level-selector plugin for Clapper Player.
        • Provide various required javascripts and implemented additional functionality for player in extra.js.
        • Recommended tested Online, Command-line and GUI Adaptive Stream players.
        • Implemented separate FFmpeg installation doc for StreamGear API.
        • Reduced rebufferingGoal for faster response.
      • [X] New StreamGear CI tests:
        • Added IO and API initialization CI tests for its Modes.
        • Added various mode Streaming check CI tests.
    • NetGear_Async API:
      • [X] Added new send_terminate_signal internal method.
      • [X] Added WindowsSelectorEventLoopPolicy() for windows 3.8+ envs.
      • [X] Moved Client auto-termination to separate method.
      • [X] Implemented graceful termination with signal API on UNIX machines.
      • [X] Added new timeout attribute for controlling Timeout in Connections.
      • [X] Added missing termination optimizer (linger=0) flag.
      • [X] Several ZMQ Optimizer Flags added to boost performance.
    • WriteGear API:
      • [X] Added support for adding duplicate FFmpeg parameters to output_params:
        • Added new -clones attribute in output_params parameter for handing this behavior..
        • Support to pass FFmpeg parameters as list, while maintaining the exact order it was specified.
        • Built support for zmq.REQ/zmq.REP and zmq.PUB/zmq.SUB patterns in this mode.
        • Added new CI tests debugging this behavior.
        • Updated docs accordingly.
      • [X] Added support for Networks URLs in Compression Mode:
        • output_filename parameter supports Networks URLs in compression modes only
        • Added automated handling of non path/file Networks URLs as input.
        • Implemented new is_valid_url helper method to easily validate assigned URLs value.
        • Validates whether the given URL value has scheme/protocol supported by assigned/installed ffmpeg or not.
        • WriteGear will throw ValueError if -output_filename is not supported.
        • Added related CI tests and docs.
      • [X] Added disable_force_termination attribute in WriteGear to disable force-termination.
    • NetGear API:
      • [X] Added option to completely disable Native Frame-Compression:
        • Checks if any Incorrect/Invalid value is assigned on compression_format attribute.
        • Completely disables Native Frame-Compression.
        • Updated docs accordingly.
    • CamGear API:
      • [X] Added new and robust regex for identifying YouTube URLs.
      • [X] Moved youtube_url_validator to Helper.
    • New helper.py methods:
      • [X] Added validate_video function to validate video_source.
      • [X] Added extract_time Extract time from give string value.
      • [X] Added get_video_bitrate to caliculate video birate from resolution, framerate, bits-per-pixels values.
      • [X] Added delete_safe to safely delete files of given extension.
      • [X] Added validate_audio to validate audio source.
      • [X] Added new Helper CI tests.
        • Added new check_valid_mpd function to test MPD files validity.
        • Added mpegdash library to CI requirements.
    • Deployed New Docs Upgrades:
      • [X] Added new assets like images, gifs, custom scripts, javascripts fonts etc. for achieving better visual graphics in docs.
      • [X] Added clappr.min.js, dash-shaka-playback.js, clappr-level-selector.min.js third-party javascripts locally.
      • [X] Extended Overview docs Hyperlinks to include all major sub-pages (such as Usage Examples, Reference, FAQs etc.).
      • [X] Replaced GIF with interactive MPEG-DASH Video Example in Stabilizer Docs.
      • [X] Added new pymdownx.keys to replace [Ctrl+C]/[⌘+C] formats.
      • [X] Added new custom.css stylescripts variables for fluid animations in docs.
      • [X] Overridden announce bar and added donation button.
      • [X] Lossless WEBP compressed all PNG assets for faster loading.
      • [X] Enabled lazy-loading for GIFS and Images for performance.
      • [X] Reimplemented Admonitions contexts and added new ones.
      • [X] Added StreamGear and its different modes Docs Assets.
      • [X] Added patch for images & unicodes for PiP flavored markdown in setup.py.
    • Added Request Info and Welcome GitHub Apps to automate PR and issue workflow
      • [X] Added new config.yml for customizations.
      • [X] Added various suitable configurations.
    • Added new -clones attribute to handle FFmpeg parameter clones in StreamGear and WriteGear API.
    • Added new Video-only and Audio-Only sources in bash script.
    • Added new paths in bash script for storing StreamGear & WriteGear assets temporarily.

    Updates/Improvements

    • [X] Added patch for NotImplementedError in NetGear_Async API on Windows 3.8+ envs.
    • [X] Check for valid output file extension according to format selected in StreamGear.
    • [X] Completed migration to travis.com.
    • [X] Created new temp_write temp directory for WriteGear Assets in bash script.
    • [X] Deleted old Redundant assets and added new ones.
    • [X] Employed isort library to sort and group imports in Vidgear APIs.
    • [X] Enabled exception for list, tuple, int, float in WriteGear API's output_params dict.
    • [X] Enabled missing support for frame-compression in its primary Receive Mode.
    • [X] Enforced pixel formats for streams.
    • [X] Improved check for valid system path detection in WriteGear API.
    • [X] Overrided pytest-asyncio fixture in NetGear_Async API.
    • [X] Quoted Gear Headline for understanding each gear easily.
    • [X] Re-Positioned Gear's banner images in overview for better readability.
    • [X] Reduced redundant try-except blocks in NetGear Async.
    • [X] Reformatted and Simplified Docs context.
    • [X] Reimplemented return_testvideo_path CI function with variable streams.
    • [X] Reimplemented skip_loop in NetGear_Async to fix asyncio.CancelledError.
    • [X] Reimplemented buggy audio handler in StreamGear.
    • [X] Reimplemented images with <figure> and <figurecaption> like tags.
    • [X] Removed Python < 3.8 condition from all CI tests.
    • [X] Removed or Grouped redundant code for increasing codecov.
    • [X] Removed redundant code and simplified algorithmic complexities in Gears.
    • [X] Replaced ;nbsp with ;thinsp and ;emsp.
    • [X] Replaced IOError with more reliable RuntimeError in StreamGear Pipelines.
    • [X] Replaced del with pop in dicts.
    • [X] Replaced all Netgear CI tests with more reliable try-except-final blocks.
    • [X] Replaced simple lists with pymdownx.tasklist.
    • [X] Replaced subprocess call() with run() for better error handling in execute_ffmpeg_cmd function.
    • [X] Resized over-sized docs images.
    • [X] Simplified delete_safe Helper function.
    • [X] Simplified default audio-bitrate logic in StreamGear
    • [X] Updated CI tests and cleared redundant code from NetGear_Async API.
    • [X] Updated CI with new tests and Bumped Codecov.
    • [X] Updated Issue and PR templates.
    • [X] Updated Licenses for new files and shrink images dimensions.
    • [X] Updated Missing Helpful tips and increased logging.
    • [X] Updated PR guidelines for more clarity.
    • [X] Updated WebGear examples addresses from 0.0.0.0 to localhost.
    • [X] Updated WriteGear and StreamGear CI tests for not supporting temp directory.
    • [X] Updated README.md and changelog.md with new changes.
    • [X] Updated check_output and added force_retrieve_stderr support to **kwargs to extract stderr output even on FFmpeg error.
    • [X] Updated dicts2args to support internal repeated coreX FFmpeg parameters for StreamGear.
    • [X] Updated mkdocs.yml, changelog.md and README.md with latest changes.
    • [X] Updated validate_audio Helper function will now retrieve audio-bitrate for validation.
    • [X] Updated buggy mpegdash dependency with custom dev fork for Windows machines.
    • [X] Updated core parameters for audio handling.
    • [X] Updated logging for debugging selected eventloops in NetGear_Async API.
    • [X] Updated termination linger to zero at Server's end.

    Breaking Updates/Changes

    • [X] :warning: Changed Webgear API default address to localhost for cross-compatibility between different platforms.
    • [X] In Netgear_Async API, source value can now be NoneType for a custom frame-generator at Server-end only.
    • [X] Temp (such as /tmp in linux) is now not a valid directory for WriteGear & StreamGear API outputs.
    • [X] Moved vidgear docs assets (i.e images, gifs, javascripts and stylescripts) to override directory.

    Bug-fixes

    • [X] Added workaround for system path not handle correctly.
    • [X] Fixed Bug: URL Audio format not being handled properly.
    • [X] Fixed Critical Bug in NetGear_Async throwing ValueError with None-type Source.
    • [X] Fixed Critical StreamGear Bug: FFmpeg pipeline terminating prematurely in Single-Source Mode.
    • [X] Fixed Critical external audio handler bug: moved audio-input to input_parameters.
    • [X] Fixed Frozen-threads bug in CI tests.
    • [X] Fixed Mkdocs only accepting Relative paths.
    • [X] Fixed OSError in WriteGear's compression mode.
    • [X] Fixed StreamGear CI bugs for Windows and CI envs.
    • [X] Fixed Typos and Indentation bugs in NetGear API.
    • [X] Fixed ZMQ throwing error on termination if all max-tries exhausted.
    • [X] Fixed NameError bug in NetGear API.
    • [X] Fixed NameError bugs in StreamGear CI.
    • [X] Fixed NameError in CI functions and tests.
    • [X] Fixed TimeoutError bug in NetGear_Async CI tests.
    • [X] Fixed get_valid_ffmpeg_path throwing TypeError with non-string values.
    • [X] Fixed broken links in docs.
    • [X] Fixed critical duplicate logging bug.
    • [X] Fixed default gop value not handle correctly.
    • [X] Fixed handling of incorrect paths detection.
    • [X] Fixed incorrect definitions in NetGear_Async.
    • [X] Fixed left-over attribute bug in WriteGear.
    • [X] Fixed logic and indentation bugs in CI tests.
    • [X] Fixed logic for handling output parameters in WriteGear API.
    • [X] Fixed missing definitions and logic bug in StreamGear.
    • [X] Fixed missing import and incorrect CI definitions.
    • [X] Fixed missing source dimensions from extract_resolutions output in StreamGear API.
    • [X] Fixed missing support for compression parameters in Multi-Clients Mode.
    • [X] Fixed round off error in FPS.
    • [X] Fixed several CI bugs and updated extract_resolutions method.
    • [X] Fixed several bugs from CI Bidirectional Mode tests.
    • [X] Fixed several typos in docs usage examples.
    • [X] Fixed various AttributeError with wrong attribute names and definition in CI Helper functions.
    • [X] Fixed wrong and missing definitions in docs.
    • [X] Fixed wrong logic for extracting OpenCV frames.
    • [X] Fixed wrong type bug in StreamGear API.
    • [X] Fixed wrong type error bug in WriteGear API.
    • [X] Fixed wrong variable assignments bug in WriteGear API.
    • [X] Fixes to CLI tests and missing docs imports.
    • [X] Many minor typos and wrong definitions.

    Pull Requests

    • PR #129
    • PR #130
    • PR #155
    • PR #157
    Source code(tar.gz)
    Source code(zip)
    vidgear-0.1.9-py3-none-any.whl(81.60 KB)
    vidgear-0.1.9.tar.gz(89.96 KB)
  • vidgear-0.1.8(Jun 12, 2020)

    New Features

    • Multiple Clients support in NetGear API:

      • [X] Implemented support for handling any number of Clients simultaneously with a single Server in this mode.
      • [X] Added new multiclient_mode attribute for enabling this mode easily.
      • [X] Built support for zmq.REQ/zmq.REP and zmq.PUB/zmq.SUB patterns in this mode.
      • [X] Implemented ability to receive data from all Client(s) along with frames with zmq.REQ/zmq.REP pattern only.
      • [X] Updated related CI tests
    • Support for robust Lazy Pirate pattern(auto-reconnection) in NetGear API for both server and client ends:

      • [X] Implemented a algorithm where NetGear rather than doing a blocking receive, will now:
        • Poll the socket and receive from it only when it's sure a reply has arrived.
        • Attempt to reconnect, if no reply has arrived within a timeout period.
        • Abandon the connection if there is still no reply after several requests.
      • [X] Implemented its default support for REQ/REP and PAIR messaging patterns internally.
      • [X] Added new max_retries and request_timeout(in seconds) for handling polling.
      • [X] Added DONTWAIT flag for interruption-free data receiving.
      • [X] Both Server and Client can now reconnect even after a premature termination.
    • Performance Updates for NetGear API:

      • [X] Added default Frame Compression support for Bidirectional frame transmission in Bidirectional mode.
      • [X] Added support for Reducer() function in Helper.py to aid reducing frame-size on-the-go for more performance.
      • [X] Added small delay in recv() function at client's end to reduce system load.
      • [X] Reworked and Optimized NetGear termination, and also removed/changed redundant definitions and flags.
    • Docs Migration to Mkdocs:

      • [X] Implemented a beautiful, static documentation site based on MkDocs which will then be hosted on GitHub Pages.
      • [X] Crafted base mkdocs with third-party elegant & simplistic mkdocs-material theme.
      • [X] Implemented new mkdocs.yml for Mkdocs with relevant data.
      • [X] Added new docs folder to handle markdown pages and its assets.
      • [X] Added new Markdown pages(.md) to docs folder, which are carefully crafted documents - based on previous Wiki's docs, and some completely new additions.
      • [X] Added navigation under tabs for easily accessing each document.
      • [X] New Assets:
      • [X] Added Required Plugins and Extensions:
        • Added support for all pymarkdown-extensions.
        • Added support for some important admonition, attr_list, codehilite, def_list, footnotes, meta, and toc like Mkdocs extensions.
        • Enabled search, minify and git-revision-date-localized plugins support.
        • Added various VidGear's social links to yaml.
        • Added support for en (English) language.
      • [X] Auto-Build API Reference with mkdocstrings:
        • Added support for mkdocstrings plugin for auto-building each VidGear's API references.
        • Added python handler for parsing python source-code to mkdocstrings.
      • [X] Auto-Deploy Docs with Github Actions:
        • Implemented Automated Docs Deployment on gh-pages through GitHub Actions workflow.
        • Added new workflow yaml with minimal configuration for automated docs deployment.
        • Added all required python dependencies and environment for this workflow.
        • Added master branch on Ubuntu machine to build matrix.

    Updates/Improvements

    • [X] Added in-built support for bidirectional frames(NDarray) transfer in Bidirectional mode.
    • [X] Added support for User-Defined compression params in Bidirectional frames transfer.
    • [X] Added workaround for address already in use bug at client's end.
    • [X] Unified Bidirectional and Multi-Clients mode for client's return data transmission.
    • [X] Replaced ValueError with more suitable RuntimeError.
    • [X] Updated logging for better readability.
    • [X] Added CI test for Multi-Clients mode.
    • [X] Reformatted and grouped imports in VidGear.
    • [X] Added Reducer Helper function CI test.
    • [X] Added Reliability tests for both Server and Client end.
    • [X] Disabled reliable reconnection for Multi-Clients mode.
    • [X] Replaced os.devnull with suprocess's inbuilt function.
    • [X] Updated README.md, Issue and PR templates with new information and updates.
    • [X] Moved changelog.md to /docs and updated contribution guidelines.
    • [X] Improved source-code docs for compatibility with mkdocstrings.
    • [X] Added additional dependency mkdocs-exclude, for excluding files from Mkdocs builds.
    • [X] Updated license and compressed images/diagrams.
    • [X] Added new CI tests and Bumped Codecov.
    • [X] Changed YouTube video URL for CI tests to Creative Commons(CC) video.
    • [X] Removed redundant code.

    Breaking Updates/Changes

    ⚠️ VidGear Docs moved to GitHub Pages, Now Available at https://abhitronix.github.io/vidgear.

    • [X] Removed filter attribute from options parameter in NetGear API.
    • [X] Removed force_terminate parameter support from NetGear API.
    • [X] Disabled additional data of datatype numpy.ndarray for Server end in Bidirectional Mode.

    Bug-fixes

    • [X] Fixed 'NoneType' object is not subscriptable bug.
    • [X] Fixed bugs related to delayed termination in NetGear API.
    • [X] Reduced default request_timeout value to 4 and also lowered cut-off limit for the same.
    • [X] Removed redundant ZMQ context termination and similar variables.
    • [X] Added missing VidGear installation in workflow.
    • [X] Excluded conflicting assets README.md from Mkdocs builds.
    • [X] Fixed pattern value check bypassed if wrong value is assigned.
    • [X] Fixed incorrect handling of additional data transferred in synchronous mode at both Server and Client end.
    • [X] Replaced Netgear CI test with more reliable try-except-final blocks.
    • [X] Updated termination linger to zero at Server's end.
    • [X] Fixed NameError bug in NetGear API.
    • [X] Fixed missing support for compression parameters in Multi-Clients Mode.
    • [X] Fixed ZMQ throwing error on termination if all max-tries exhausted.
    • [X] Enabled missing support for frame compression in its primary receive mode.
    • [X] Fixed several bugs from CI Bidirectional Mode tests.
    • [X] Removed or Grouped redundant code for increasing codecov.
    • [X] Fixed Mkdocs only accepting Relative paths.
    • [X] Fixed broken links in docs.
    • [X] Fixed round off error in FPS.
    • [X] Many small typos and bugs fixes.

    Pull Requests

    • PR #129
    • PR #130
    Source code(tar.gz)
    Source code(zip)
    vidgear-0.1.8-py3-none-any.whl(69.57 KB)
    vidgear-0.1.8.tar.gz(75.09 KB)
  • vidgear-0.1.7(Apr 29, 2020)

    New Features:

    • WebGear API:

      • Added a robust Live Video Server API that can transfer live video frames to any web browser on the network in real-time.
      • Implemented a flexible asyncio wrapper around starlette ASGI Application Server.
      • Added seamless access to various starlette's Response classes, Routing tables, Static Files, Template engine(with Jinja2), etc.
      • Added a special internal access to VideoGear API and all its parameters.
      • Implemented a new Auto-Generation Work-flow to generate/download & thereby validate WebGear API data files from its GitHub server automatically.
      • Added on-the-go dictionary parameter in WebGear to tweak performance, Route Tables and other internal properties easily.
      • Added new simple & elegant default Bootstrap Cover Template for WebGear Server.
      • Added __main__.py to directly run WebGear Server through the terminal.
      • Added new gif and related docs for WebGear API.
      • Added and Updated various CI tests for this API.
    • NetGear_Async API

      • Designed NetGear_Async asynchronous network API built upon ZeroMQ's asyncio API.
      • Implemented support for state-of-the-art asyncio event loop uvloop at its backend.
      • Achieved Unmatchable high-speed and lag-free video streaming over the network with minimal resource constraint.
      • Added exclusive internal wrapper around VideoGear API for this API.
      • Implemented complete server-client handling and options to use variable protocols/patterns for this API.
      • Implemented support for all four ZeroMQ messaging patterns: i.e zmq.PAIR, zmq.REQ/zmq.REP, zmq.PUB/zmq.SUB, and zmq.PUSH/zmq.PULL.
      • Implemented initial support for tcp and ipc protocols.
      • Added new Coverage CI tests for NetGear_Async Network Gear.
      • Added new Benchmark tests for benchmarking NetGear_Async against NetGear.
    • Asynchronous I/O Enhancements

      • Added asyncio package to vidgear for handling asynchronous APIs.
      • Moved WebGear API(webgear.py) to asyncio and created separate asyncio helper.py for it.
      • Various Performance tweaks for Asyncio APIs with concurrency within a single thread.
      • Moved __main__.py to asyncio for easier access to WebGear API through the terminal.
      • Updated setup.py with new dependencies and separated asyncio dependencies.
    • General Enhancements:

      • Added new highly-precise Threaded FPS class for accurate benchmarking with time.perf_counter python module.
      • Added a new Gitter community channel.
      • Added a new Reducer function to reduce the frame size on-the-go.
      • Add Flake8 tests to Travis CI to find undefined names. (PR by @cclauss)
      • Added a new unified logging handler helper function for vidgear.

    Updates/Improvements:

    • Re-implemented and simplified logic for NetGear Async server-end.
    • Added new dependencies for upcoming asyncio updates to setup.py.
    • Added retry function and replaced wget with curl for Linux test envs.
    • Bumped OpenCV to latest 4.2.0-dev for Linux test envs.
    • Updated YAML files to reflect new changes to different CI envs.
    • Separated each API logger with a common helper method to avoid multiple copies.
    • Limited Importing OpenCV API version check's scope to helper.py only.
    • Implemented case for incorrect color_space value in ScreenGear API.
    • Removed old conflicting logging formatter with a common method and expanded logging.
    • Improved and added shutdown function for safely stopping frame producer threads in WebGear API.
    • Re-implemented and simplified all CI tests with maximum code-coverage in mind.
    • Replaced old mkdir function with new mkdir_safe helper function for creating directories safely.
    • Updated ReadMe.md with updated diagrams, gifs and information.
    • Improve, structured and Simplified the Contribution Guidelines.
    • Bundled CI requirements in a single command.(Suggested by @cclauss)
    • Replaced line endings CRLF with LF endings.
    • Added dos2unix for Travis OSX envs.
    • Bumped Codecov to maximum.

    Breaking Updates / Improvements / Changes

    • :warning: Dropped support for Python 3.5 and below legacies. (See issue #99)
    • Dropped and replaced Python 3.5 matrices with new Python 3.8 matrices in all CI environments.
    • Implemented PEP-8 Styled Black formatting throughout the source-code.
    • Limited protocols support to tcp and ipc only, in NetGear API.

    Fixes:

    • Fixed Major NetGear_Async bug where __address and __port are not set in async mode.(PR by @otter-in-a-suit)
    • Fixed Major PiGear Color-space Conversion logic bug.
    • Workaround for CAP_IMAGES: error in YouTube Mode.
    • Replaced incorrect terminate() with join() in PiGear.
    • Removed uvloop for windows as still NOT yet supported.
    • Refactored Asynchronous Package name async to asyncio, since it is used as Keyword in python>=3.7*(raises SyntaxError)*.
    • Fixed unfinished close of event loops bug in WebGear API.
    • Fixed NameError in helper.py.
    • Added fix for OpenCV installer failure on Linux test envs.
    • Fixed undefined NameError in helper.py context. (@cclauss)
    • Fixed incorrect logic while pulling frames from ScreenGear API.
    • Fixed missing functions in __main__.py.
    • Fixed Typos and definitions in docs.
    • Added missing camera_num parameter to VideoGear.
    • Added OpenSSL's [SSL: CERTIFICATE_VERIFY_FAILED] bug workaround for macOS envs.
    • Removed download_url meta from setup.py.
    • Removed PiGear from CI completely due to hardware emulation limitation.
    • Removed VideoCapture benchmark tests for macOS envs.
    • Removed trivial __main__.py from codecov.
    • Removed several redundant try-catch loops.
    • Renamed youtube_url_validation as youtube_url_validator.
    • Several minor wrong/duplicate variable definitions and various bugs fixed.
    • Fixed, Improved & removed many Redundant CI tests for various APIs.

    Pull requests(PR) involved:

    • PR #88
    • PR #91
    • PR #93
    • PR #95
    • PR #98
    • PR #101
    • PR #114
    • PR #118
    • PR #124

    :warning: PyPi Release does NOT contain Tests and Scripts!

    Source code(tar.gz)
    Source code(zip)
    vidgear-0.1.7-py3-none-any.whl(74.85 KB)
    vidgear-0.1.7.tar.gz(84.58 KB)
  • vidgear-0.1.7-a0(Jan 6, 2020)

  • vidgear-0.1.6(Dec 31, 2019)

    New Features:

    • NetGear API:

      • Added powerful ZMQ Authentication & Data Encryption features for NetGear API:
        • Added exclusive secure_mode param for enabling it.
        • Added support for the two most powerful Stonehouse & Ironhouse ZMQ security mechanisms.
        • Added smart auth-certificates/key generation and validation features
      • Implemented Robust Multi-Server support for NetGear API:
        • Enables Multiple Server messaging support with a single client.
        • Added exclusive multiserver_mode param for enabling it.
        • Added support for REQ/REP & PUB/SUB patterns for this mode.
        • Added ability to send additional data of any datatype along with the frame in realtime in this mode.
      • Introducing exclusive Bi-Directional Mode for bidirectional data transmission:
        • Added new return_data parameter to recv() function.
        • Added new bidirectional_mode attribute for enabling this mode.
        • Added support for PAIR & REQ/REP patterns for this mode
        • Added support for sending data of any python datatype.
        • Added support for message parameter for non-exclusive primary modes for this mode.
      • Implemented compression support with on-the-fly flexible frame encoding for the Server-end:
        • Added initial support for JPEG, PNG & BMP encoding formats
        • Added exclusive options attribute compression_format & compression_param to tweak this feature
        • Client-end will now decode frame automatically based on the encoding as well as support decoding flags
      • Added force_terminate attribute flag for handling force socket termination at the Server-end if there's latency in the network.
      • Implemented new Publish/Subscribe(zmq.PUB/zmq.SUB) pattern for seamless Live Streaming in NetGear API.
    • PiGear API:

      • Added new threaded internal timing function for PiGear to handle any hardware failures/frozen threads.
      • PiGear will not exit safely with SystemError if Picamera ribbon cable is pulled out to save resources.
      • Added support for new user-defined HWFAILURE_TIMEOUT options attributes to alter timeout.
    • VideoGear API:

      • Added framerate global variable and removed redundant function.
      • Added CROP_N_ZOOM attribute in Videogear API for supporting Crop and Zoom stabilizer feature.
    • WriteGear API: Added new execute_ffmpeg_cmd function to pass a custom command to its FFmpeg pipeline.

    • Stabilizer class:

      • Added new Crop and Zoom feature.
        • Added crop_n_zoom param for enabling this feature.
      • Updated docs.
    • CLI & Tests updates:

      • Replaced python 3.5 matrices with the latest python 3.8 matrices in the Linux environment.
      • Added full support for Codecov in all CLI environments.
      • Updated OpenCV to v4.2.0-pre(master branch).
      • Added various Netgear API tests.
      • Added initial Screengear API test.
      • More test RTSP feeds added with better error handling in the CamGear network test.
      • Added tests for ZMQ authentication certificate generation.
      • Added badge and Minor doc updates.
    • Added VidGear's official native support for macOS environments.

    Updates/Improvements:

    • Replace print logging commands with python's logging module completely.
    • Implemented encapsulation for class functions and variables on all gears.
    • Updated support for screencasting from multiple/all monitors in ScreenGear API.
    • Updated ScreenGear API to use Threaded Queue Mode by default, thereby removed redundant THREADED_QUEUE_MODE param.
    • Updated bash script path to download test dataset in $TMPDIR rather than $HOME directory for downloading test data.
    • Implemented better error handling of colorspace in various videocapture APIs.
    • Updated bash scripts, Moved FFmpeg static binaries to github.com.
    • Updated bash scripts, Added additional flag to support un-secure apt sources.
    • CamGear API will now throw RuntimeError if the source provided is invalid.
    • Updated threaded Queue mode in CamGear API for more robust performance.
    • Added new camera_num to support multiple Picameras.
    • Moved thread exceptions to the main thread and then re-raised.
    • Added alternate GitHub mirror for FFmpeg static binaries auto-installation on windows oses.
    • Added colorlog python module for presentable colored logging.
    • Replaced traceback with sys.exc_info.
    • Overall APIs Code and Docs optimizations.
    • Updated Code Readability and Wiki Docs.
    • Updated ReadMe & Changelog with the latest changes.
    • Updated Travis CLI Tests with support for the macOS environment.
    • Reformatted & implemented necessary macOS related changes and dependencies in travis.yml.

    Breaking Updates / Improvements / Changes

    • :warning: Python 2.7 legacy support dropped completely.
    • :warning: Source-code Relicensed to Apache 2.0 License.
    • Python 3+ are only supported legacies for installing Vidgear v0.1.6 and above.
    • Python 2.7 and 3.4 legacies support dropped from VidGear CLI tests.

    Fixes

    • Reimplemented Pub/Sub pattern for smoother performance on various networks.
    • Fixed Assertion error in CamGear API during colorspace manipulation.
    • Fixed random freezing in Secure Mode and several related performance updates
    • Fixed multiserver_mode not working properly over some networks.
    • Fixed assigned Port address ignored bug (commit 073bca1).
    • Fixed several wrong definition bugs from NetGear API(commit 8f7153c).
    • Fixed unreliable dataset video URL(rehosted file on github.com).
    • Disabled overwrite_cert for client-end in NetGear API.
    • Disabled Universal Python wheel builds in setup.cfgfile.
    • Removed duplicate code to import MSS(@BoboTiG) from ScreenGear API.
    • Eliminated unused redundant code blocks from the library.
    • Fixed Code indentation in setup.py and updated new release information.
    • Fixed code definitions & Typos.
    • Fixed several bugs related to secure_mode & multiserver_mode Modes.
    • Fixed various macOS environment bugs.

    Pull requests(PR) involved:

    • PR #39
    • PR #42
    • PR #44
    • PR #52
    • PR #55
    • PR #62
    • PR #67
    • PR #72
    • PR #77
    • PR #78
    • PR #82
    • PR #84

    :warning: PyPi Release does NOT contain Tests and Scripts!

    Source code(tar.gz)
    Source code(zip)
    vidgear-0.1.6-py3-none-any.whl(54.35 KB)
    vidgear-0.1.6.tar.gz(64.08 KB)
  • vidgear-0.1.5(Jul 24, 2019)

    New Features:

    • Added new ScreenGear API, supports Live ScreenCasting.
    • Added new NetGear API, aids real-time frame transfer through messaging(ZmQ) over network.
    • Added new new Stabilizer Class, for minimum latency Video Stabilization with OpenCV.
    • Added Option to use VidGear API's standalone.
    • Added Option to use VideoGear API as internal wrapper around Stabilizer Class.
    • Added new parameter stabilize to VidGear API, to enable or disable Video Stabilization.
    • Added support for **option dict attributes to update VidGear's video stabilizer parameters directly.
    • Added brand new VidGear logo and functional block diagram (.svg) in readme.md
    • Added new pictures and GIFs for improving readme.md readability
    • Added new contributing.md and changelog.md for reference.
    • Added collections.deque import in Threaded Queue Mode for performance consideration
    • Added new install_opencv.sh bash scripts for Travis cli, to handle OpenCV installation.
    • Added new Project Issue & PR Templates
    • Added new Sponsor Button(FUNDING.yml)

    Updates/Improvements:

    • Updated New dependencies: mss, pyzmq and rejected redundant ones.
    • Revamped and refreshed look for readme.md and added new badges.
    • Updated Releases Documentation completely.
    • Updated CLI tests for new changes
    • Updated Code Documentation.
    • Updated bash scripts and removed redundant information
    • Updated Youtube video URL in tests
    • Completely Reformatted and Updated Wiki Docs with new changes.

    Breaking Updates / Improvements / Changes

    • Implemented experimental Threaded Queue Mode(a.k.a Blocking Mode) for fast, synchronized, error-free multi-threading.
    • Renamed bash script pre-install.sh to prepare_dataset.sh - downloads opensourced test datasets and static FFmpeg binaries for debugging.
    • Changed script folder location to bash/script.
    • Python 3.4 removed from Travis CLI tests.

    Fixes

    • Temporarily fixed Travis CLI bug: Replaced opencv-contrib-python with OpenCV built from scratch as dependency.
    • Fixed CLI Timeout Bug: Disable Threaded Queue Mode for CLI Tests
    • Fixes sys.stderr.close() throws ValueError bug: Replaced sys.close() with DEVNULL.close()
    • Fixed Youtube Live Stream bug that return NonType frames in CamGear API.
    • Fixed NoneType frames bug in PiGear class on initialization.
    • Fixed Wrong function definitions
    • Removed /xe2 unicode bug from Stabilizer class.
    • Fixed **output_params KeyError bug in WriteGear API
    • Fixed subprocess not closing properly on exit in WriteGear API.
    • Fixed bugs in ScreenGear: Non-negative monitor values
    • Fixed missing import, typos, wrong variable definitions
    • Removed redundant hack from setup.py
    • Fixed Minor YouTube playback Test CLI Bug
    • Fixed new Twitter Intent
    • Fixed bug in bash script that not working properly due to changes at server end.

    Pull requests(PR) involved:

    • PR #17
    • PR #21
    • PR #22
    • PR #27
    • PR #31
    • PR #32
    • PR #33
    • PR #34
    Source code(tar.gz)
    Source code(zip)
    vidgear-0.1.5-py2.py3-none-any.whl(44.31 KB)
    vidgear-0.1.5.tar.gz(40.71 KB)
  • videgear-0.1.4(May 11, 2019)

    New Features:

    • Added WriteGear API: for enabling lossless video encoding and compression(built around FFmpeg and OpenCV Video Writer)
    • Added YouTube direct Video Pipelining to OpenCV(YouTube Mode) in CamGear API
    • Added new y_tube to access YouTube Mode in CamGear API.
    • Added flexible Output file Compression control capabilities in compression-mode(WriteGear).
    • Added -output_dimensions special parameter to WriteGear API.
    • Added new helper.py to handle special helper functions.
    • Added feature to auto-download and configure FFmpeg Static binaries(if not found) on Windows platforms.
    • Added -input_framerate special parameter to WriteGear class to change/control output constant framerate in compression mode(WriteGear).
    • Added new Direct Video colorspace Conversion capabilities in CamGear and PiGear API.
    • Added new framerate class variable for CamGear API, to retrieve input framerate.
    • Added new parameter backend - changes the backend of CamGear's API
    • Added automatic required prerequisites installation ability, when installation from source.
    • Added Travis CLI Complete Integration for Linux-based Testing for VidGear.
    • Added and configured travis.yml
    • Added Appveyor CLI Complete Integration for Windows-based Testing in VidGear.
    • Added and configured new appveyor.yml
    • Added new bash script Pre-install.sh to download opensourced test datasets and static FFmpeg binaries for debugging.
    • Added several new Tests(including Benchmarking Tests) for each API for testing with pytest.
    • Added Say Thank you! badge to readme.

    Updates/Improvements:

    • Removed redundant dependencies
    • Updated youtube-dl as a dependency, as required by pafy's backend.
    • Updated common VideoGear API with new parameter.
    • Update robust algorithm to auto-detect FFmpeg executables and test them, if failed, auto fallback to OpenCV's VideoWriter API.
    • Improved system previously installed OpenCV detection in setup.py.
    • Updated setup.py with hack to remove bullets from pypi description.
    • Updated Code Documentation
    • Reformatted & Modernized readme.md with new badges.
    • Reformatted and Updated Wiki Docs.

    Breaking Updates / Improvements / Changes

    • Bugs Patched: Removed unnecessary -height and -width parameter from CamGear API.
    • Replaced dependency opencv-python with opencv-contrib-python completely

    Fixes

    • Windows Cross-Platform fix: replaced dependency os with platform in setup.py.
    • Fixed Bug: Arises due to spaces in input **options/**output_param dictionary keys.
    • Fixed several wrong/missing variable & function definitions.
    • Fixed code uneven indentation.
    • Fixed several typos in docs.

    Pull requests(PR) involved:

    • PR #7
    • PR #8
    • PR #10
    • PR #12

    :warning: PyPi Release does NOT contain Tests and Scripts!

    Source code(tar.gz)
    Source code(zip)
    vidgear-0.1.4-py2.py3-none-any.whl(24.55 KB)
    vidgear-0.1.4.tar.gz(19.06 KB)
  • videgear-0.1.3(Apr 7, 2019)

  • videgear-0.1.2(Mar 27, 2019)

    New Features:

    • Added easy Source manipulation feature in CamGear API, to control features like resolution, brightness, framerate etc.
    • Added new **option parameter to CamGear API, provides the flexibility to manipulate input stream directly.
    • Added new parameters for Camgear API for time delay and logging.
    • Added new Logo to readme.md
    • Added new Wiki Documentation.

    Updates/Improvements:

    • Reformatted readme.md.
    • Updated Wiki Docs with new changes.

    Fixes:

    • Improved Error Handling in CamGear & PiGear API.
    • Fixed minor typos in docs.

    Pull requests(PR) Involved:

    • PR #4

    Tip :bulb: Go through each PR to see what has changed and when!

    Source code(tar.gz)
    Source code(zip)
    vidgear-0.1.2-py2.py3-none-any.whl(8.21 KB)
    vidgear-0.1.2.tar.gz(5.92 KB)
  • videgear-0.1.1(Mar 24, 2019)

  • videgear-0.1.0(Mar 17, 2019)

Owner
Abhishek Thakur
Don't be a deadlock!
Abhishek Thakur
Wonkey - an open source programming language for the creation of cross-platform video games

Wonkey Programming Language Wonkey is an open source programming language for the creation of cross-platform video games, highly inspired by the “Blit

Wonkey Coders 110 Nov 9, 2022
Cross-platform command-line AV1 / VP9 / HEVC / H264 encoding framework with per scene quality encoding

Av1an A cross-platform framework to streamline encoding Easy, Fast, Efficient and Feature Rich An easy way to start using AV1 / HEVC / H264 / VP9 / VP

Zen 947 Jan 1, 2023
video streaming userbot (vsu) based on pytgcalls for streaming video trought the telegram video chat group.

VIDEO STREAM USERBOT ✨ an another telegram userbot for streaming video trought the telegram video chat. Environmental Variables ?? API_ID : Get this v

levina 6 Oct 17, 2021
Ffmpeg videostream - High speed video frame access in Python, using FFmpeg and FFshow

FFmpeg VideoStream High speed video frame access in Python, using FFmpeg and FFshow This script requires: Karl Kroening's 'ffmpeg-python' library. (ht

null 3 Sep 29, 2022
Video processing routines for SciPy

scikit-video Video Processing SciKit BETA Video processing algorithms, including I/O, quality metrics, temporal filtering, motion/object detection, mo

Alex Izvorski 119 Dec 27, 2022
A platform which give you info about the newest video on a channel

youtube A platform which give you info about the newest video on a channel. This uses web scraping, a better implementation will be to use the API. BR

Custom components for Home Assistant 36 Sep 29, 2022
Vigia-youtube - The YouTube Watch bot is able to monitor channels on Google's video platform

Vigia do YouTube O bot Vigia do YouTube é capaz de monitorar canais na plataform

Alessandro Feitosa Jr 10 Oct 3, 2022
MoviePy is a Python library for video editing, can read and write all the most common audio and video formats

MoviePy is a Python library for video editing: cutting, concatenations, title insertions, video compositing (a.k.a. non-linear editing), video processing, and creation of custom effects. See the gallery for some examples of use.

null 10k Jan 8, 2023
A youtube video link or id to video thumbnail python package.

Youtube-Video-Thumbnail A youtube video link or id to video thumbnail python package. Made with Python3

Fayas Noushad 10 Oct 21, 2022
Streamlink is a CLI utility which pipes video streams from various services into a video player

Streamlink is a CLI utility which pipes video streams from various services into a video player

null 8.2k Dec 26, 2022
Text2Video's purpose is to help people create videos quickly and easily by simply typing out the video’s script and a description of images to include in the video.

Text2Video Text2Video's purpose is to help people create videos quickly and easily by simply typing out the video’s script and a description of images

Josh Chen 19 Nov 22, 2022
Filtering user-generated video content(SberZvukTechDays)Filtering user-generated video content(SberZvukTechDays)

Filtering user-generated video content(SberZvukTechDays) Table of contents General info Team members Technologies Setup Result General info This is a

Roman 6 Apr 6, 2022
Extracting frames from video and create video using frames

Extracting frames from video and create video using frames This program uses opencv library to extract the frames from video and create video from ext

null 1 Nov 19, 2021
Telegram Video Chat Video Streaming bot 🇱🇰

?? Get SESSION_NAME from below: Pyrogram ?? Preview ✨ Features Music & Video stream support MultiChat support Playlist & Queue support Skip, Pause, Re

DOOZY YEZ 5 Jun 26, 2022
Play Video & Music on Telegram Group Video Chat

?? DEMONGIRL ?? ʜᴇʟʟᴏ ❤️ ???? Join us ᴠɪᴅᴇᴏ sᴛʀᴇᴀᴍ ɪs ᴀɴ ᴀᴅᴠᴀɴᴄᴇᴅ ᴛᴇʟᴇʀᴀᴍ ʙᴏᴛ ᴛʜᴀᴛ's ᴀʟʟᴏᴡ ʏᴏᴜ ᴛᴏ ᴘʟᴀʏ ᴠɪᴅᴇᴏ & ᴍᴜsɪᴄ ᴏɴ ᴛᴇʟᴇɢʀᴀᴍ ɢʀᴏᴜᴘ ᴠɪᴅᴇᴏ ᴄʜᴀᴛ ?? ɢ

Jonathan 5 Dec 31, 2021
Takes a video as an input and creates a video which is suitable to upload on Youtube Shorts and Tik Tok (1080x1920 resolution).

Shorts-Tik-Tok-Creator Takes a video as an input and creates a video which is suitable to upload on Youtube Shorts and Tik Tok (1080x1920 resolution).

Arber Hakaj 5 Nov 9, 2022
Turn any live video stream or locally stored video into a dataset of interesting samples for ML training, or any other type of analysis.

Sieve Video Data Collection Example Find samples that are interesting within hours of raw video, for free and completely automatically using Sieve API

Sieve 72 Aug 1, 2022
Video-to-GIF-Converter - A small code snippet that can be used to convert any video to a gif

Video to GIF Converter Project Description: This is a small code snippet that ca

Hassan Shahzad 3 Jun 22, 2022
Video-stream - A telegram video stream bot repo

This is a Telegram Video stream Bot. Binary Tech ?? Features stream videos downl

silentz lk 1 Feb 2, 2022