Skip to main content

Live camera viewer with realtime flip controls and camera switching

Project description

camera-flip

A small command-line camera viewer for flipping a live camera feed horizontally or vertically in real time.

camera-flip is useful when you want a quick local camera preview with keyboard controls for mirroring, rotating by flips, resetting the view, and switching between camera devices.

Features

  • Live camera preview using OpenCV
  • Horizontal flip toggle
  • Vertical flip toggle
  • Reset flips instantly
  • Switch between camera indexes 0 through 9
  • Heads-up display showing the active camera
  • Safe fallback screen when a camera is unavailable
  • Installable as a command-line tool

Installation

Install from GitHub

python -m pip install "git+https://github.com/PedroLopes/camera-flip.git"

After installation, run:

camera-flip

Install locally for development

From the root of this repository:

python -m pip install -e .

Then run:

camera-flip

Usage

Start with the default camera:

camera-flip

Start with a specific camera index:

camera-flip --camera 1

Short option:

camera-flip -c 1

Keyboard controls

Key Action
0-9 Switch to camera index
h Toggle horizontal flip
v Toggle vertical flip
r Reset flips
q Quit

Project structure

camera-flip/
├── pyproject.toml
├── README.md
└── src/
    └── camera_flip/
        ├── __init__.py
        └── cli.py

Packaging configuration

This project uses pyproject.toml and exposes a command named camera-flip.

[build-system]
requires = ["setuptools>=77.0.3"]
build-backend = "setuptools.build_meta"

[project]
name = "camera-flip"
version = "0.1.0"
description = "Live camera viewer with realtime flip controls and camera switching"
readme = "README.md"
requires-python = ">=3.9"
dependencies = [
    "opencv-python>=4",
    "numpy>=1.23"
]

[project.scripts]
camera-flip = "camera_flip.cli:main"

Requirements

  • Python 3.9 or newer
  • A working webcam or external camera
  • OpenCV, installed automatically through opencv-python
  • NumPy, installed automatically through numpy

macOS camera permissions

On macOS, the first run may require camera permission. If the camera window opens but no image appears, check:

System Settings → Privacy & Security → Camera

Make sure your terminal app, IDE, or Python launcher has permission to access the camera.

Troubleshooting

camera-flip: command not found

Make sure the package installed successfully:

python -m pip install -e .

If you installed inside a virtual environment, activate that environment before running the command.

Camera does not open

Try another camera index:

camera-flip --camera 1
camera-flip --camera 2

You can also switch cameras while the app is running by pressing number keys 0 through 9.

OpenCV install issues

Upgrade pip first:

python -m pip install --upgrade pip

Then reinstall:

python -m pip install -e .

Window does not respond to keys

Make sure the camera window is focused. Click the OpenCV window, then press h, v, r, number keys, or q.

Development

Clone the repository:

git clone https://github.com/YOUR_USERNAME/camera-flip.git
cd camera-flip

Install in editable mode:

python -m pip install -e .

Run the command:

camera-flip

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

camera_flip-0.1.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

camera_flip-0.1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file camera_flip-0.1.0.tar.gz.

File metadata

  • Download URL: camera_flip-0.1.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for camera_flip-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fd881f5c350ed141f8ee76d84f08171230c4147ba36ba3dda637d4155e5210b8
MD5 8fe4c69bff9ee4915c2c20ecd880e076
BLAKE2b-256 458d64c64e9b3e2129852c3eb20ac64fc161c50100d0823574f349f1bb8a32f8

See more details on using hashes here.

File details

Details for the file camera_flip-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: camera_flip-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for camera_flip-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3bb8bfe0217bf39a71a10e16867eef9cf776a06665149d918fa5909bcf93d51e
MD5 f81eb749b503c6eddcd415bdc83b7b01
BLAKE2b-256 21a6709b1de8a2f38a1692cb9e87ceb6a71e5879fe80da77cebcb14e88bdfdfb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page