Skip to content

Commit c1650ce

Browse files
committed
prep for next release
1 parent 76de0c9 commit c1650ce

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## Unreleased
7+
## [0.6.0] - 2012-03-22
88
### Added
9+
- 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.
910
- Support for common pixel formats: RGB (default), BGR (useful for OpenCV), GRAY, I420, NV12, YUYV, UYVY.
1011
- New properties `Camera.fmt` (input format) and `Camera.native_fmt` (native format).
1112

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ with pyvirtualcam.Camera(width=1280, height=720, fps=20) as cam:
1717
cam.sleep_until_next_frame()
1818
```
1919

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

2222
## Installation
2323

@@ -64,7 +64,7 @@ sudo modprobe v4l2loopback devices=1
6464

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

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

7070
## Build from source

pyvirtualcam/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.5.0"
1+
__version__ = "0.6.0"

samples/video.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# This script plays back a video file on the virtual camera.
2+
# It also shows how to:
3+
# - select a specific camera device
4+
# - use BGR as pixel format
25

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

1317
video = cv2.VideoCapture(args.video_path)
@@ -18,7 +22,8 @@
1822
height = int(video.get(cv2.CAP_PROP_FRAME_HEIGHT))
1923
fps = video.get(cv2.CAP_PROP_FPS)
2024

21-
with pyvirtualcam.Camera(width, height, fps, fmt=PixelFormat.BGR, print_fps=args.fps) as cam:
25+
with pyvirtualcam.Camera(width, height, fps, fmt=PixelFormat.BGR,
26+
device=args.device, print_fps=args.fps) as cam:
2227
print(f'Virtual cam started: {cam.device} ({cam.width}x{cam.height} @ {cam.fps}fps)')
2328
count = 0
2429
while True:

samples/webcam_filter.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# This scripts uses OpenCV to capture webcam output, applies a filter,
22
# and sends it to the virtual camera.
3+
# It also shows how to use BGR as pixel format.
34

45
import argparse
56
import cv2

0 commit comments

Comments
 (0)