Skip to content

Commit

Permalink
prep for next release
Browse files Browse the repository at this point in the history
  • Loading branch information
letmaik committed Mar 22, 2021
1 parent 76de0c9 commit c1650ce
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
## [0.6.0] - 2012-03-22
### Added
- Support for device selection on Linux: `Camera(..., device="/dev/video0")`. On Windows/macOS there is only a single valid device `"OBS Virtual Camera"` when using the built-in backends.
- Support for common pixel formats: RGB (default), BGR (useful for OpenCV), GRAY, I420, NV12, YUYV, UYVY.
- New properties `Camera.fmt` (input format) and `Camera.native_fmt` (native format).

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ with pyvirtualcam.Camera(width=1280, height=720, fps=20) as cam:
cam.sleep_until_next_frame()
```

For more examples, including using different pixel formats like BGR, check out the [`samples/`](samples) folder.
For more examples, including using different pixel formats like BGR, or selecting a specific camera device on Linux, check out the [`samples/`](samples) folder.

## Installation

Expand Down Expand Up @@ -64,7 +64,7 @@ sudo modprobe v4l2loopback devices=1

For further information, see the [v4l2loopback documentation](https://github.com/umlaeute/v4l2loopback).

pyvirtualcam uses the first available v4l2loopback virtual camera it finds.
If the `device` keyword argument is not given, then pyvirtualcam uses the first available v4l2loopback virtual camera it finds.
The camera device name can be accessed with `cam.device`.

## Build from source
Expand Down
2 changes: 1 addition & 1 deletion pyvirtualcam/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.0"
__version__ = "0.6.0"
7 changes: 6 additions & 1 deletion samples/video.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# This script plays back a video file on the virtual camera.
# It also shows how to:
# - select a specific camera device
# - use BGR as pixel format

import argparse
import pyvirtualcam
Expand All @@ -8,6 +11,7 @@
parser = argparse.ArgumentParser()
parser.add_argument("video_path", help="path to input video file")
parser.add_argument("--fps", action="store_true", help="output fps every second")
parser.add_argument("--device", help="virtual camera device, e.g. /dev/video0 (optional)")
args = parser.parse_args()

video = cv2.VideoCapture(args.video_path)
Expand All @@ -18,7 +22,8 @@
height = int(video.get(cv2.CAP_PROP_FRAME_HEIGHT))
fps = video.get(cv2.CAP_PROP_FPS)

with pyvirtualcam.Camera(width, height, fps, fmt=PixelFormat.BGR, print_fps=args.fps) as cam:
with pyvirtualcam.Camera(width, height, fps, fmt=PixelFormat.BGR,
device=args.device, print_fps=args.fps) as cam:
print(f'Virtual cam started: {cam.device} ({cam.width}x{cam.height} @ {cam.fps}fps)')
count = 0
while True:
Expand Down
1 change: 1 addition & 0 deletions samples/webcam_filter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This scripts uses OpenCV to capture webcam output, applies a filter,
# and sends it to the virtual camera.
# It also shows how to use BGR as pixel format.

import argparse
import cv2
Expand Down

0 comments on commit c1650ce

Please sign in to comment.