Skip to content

tosih/fuji-webcam2-linux

Repository files navigation

Fuji X-T2 Webcam for Linux

A simple GTK application and bash script to use your Fuji X-T2 camera as a webcam on Ubuntu Linux using gphoto2 and v4l2loopback.

Features

  • 🎥 Stream video from Fuji X-T2 to /dev/video2
  • 🖥️ Easy-to-use GTK GUI with start/stop controls
  • 📊 Real-time status updates and log output
  • 🔧 Automatic dependency installation
  • 📹 Works with Google Meet, Zoom, and other video applications
  • 💻 Command-line bash script option also available

Screenshots

The GTK app provides:

  • Start/Stop buttons for easy control
  • Status indicators showing camera detection and streaming state
  • Live log output showing all operations
  • Automatic setup of required kernel modules

Requirements

  • Ubuntu Linux (tested on Ubuntu with kernel 6.14)
  • Fuji X-T2 camera
  • USB cable
  • Python 3 with GTK 3 (installed automatically)
  • gphoto2, ffmpeg, v4l-utils (installed automatically)
  • v4l2loopback-dkms (installed automatically)

Installation

Option 1: GTK App (Recommended)

  1. Clone this repository:

    git clone https://github.com/yourusername/fuji-webcam2-linux.git
    cd fuji-webcam2-linux
  2. Run the installation script:

    ./install.sh
  3. Launch the app:

    • From your application menu (search for "Fuji X-T2 Webcam")
    • Or run directly: ./fuji-webcam-gtk.py

Option 2: Bash Script

If you prefer a command-line interface:

./enable-fuji-webcam.sh

Usage

Using the GTK App

  1. Connect your Fuji X-T2 camera via USB

  2. Set camera USB mode to PC AUTO or USB TETHER

    • Menu → Connection Setting → USB Mode → PC AUTO
  3. Launch the Fuji X-T2 Webcam app

  4. Click Start Webcam

  5. The app will:

    • Check and install dependencies (requires sudo password)
    • Set up the v4l2loopback module
    • Detect your camera (with retry prompts if not found)
    • Start streaming video
  6. Your camera will appear as /dev/video2 in video applications

  7. Click Stop Webcam when done

Using the Bash Script

  1. Connect and configure your camera (same as above)
  2. Run ./enable-fuji-webcam.sh
  3. Follow the prompts
  4. Press Ctrl+C to stop streaming

Camera Setup

On your Fuji X-T2:

  1. Go to Menu
  2. Navigate to Connection Setting
  3. Select USB Mode
  4. Choose PC AUTO or USB TETHER
  5. Connect the camera via USB and power it on

Troubleshooting

Camera Not Detected

  • Ensure camera is powered on
  • Check USB cable connection (try a different cable or port)
  • Verify USB mode is set to PC AUTO or USB TETHER
  • Check if camera is recognized: gphoto2 --auto-detect

Video Device Not Available

  • Verify v4l2loopback is loaded: lsmod | grep v4l2loopback
  • Check video device exists: ls -l /dev/video2
  • Try unloading and reloading the module:
    sudo modprobe -r v4l2loopback
    sudo modprobe v4l2loopback devices=1 video_nr=2 card_label="Fuji X-T2" exclusive_caps=1

Stream Fails to Start

  • Kill interfering processes:
    sudo pkill -f gvfs-gphoto2
    sudo pkill -f gphoto2
  • Restart the application

How It Works

The application uses:

  • gphoto2 to capture video from the camera via USB
  • ffmpeg to convert the video stream to the correct format (yuyv422)
  • v4l2loopback to create a virtual video device at /dev/video2

The video pipeline:

Fuji X-T2 → gphoto2 → ffmpeg → v4l2loopback → /dev/video2

Files

  • fuji-webcam-gtk.py - GTK application
  • enable-fuji-webcam.sh - Bash script alternative
  • fuji-webcam.desktop - Desktop entry for application menu
  • install.sh - Installation script

Tested On

  • Ubuntu Linux 6.14.0-32-generic
  • Fuji X-T2 camera

Should work on other Debian-based distributions and possibly other Fujifilm cameras (X-T3, X-T4, etc.) with minor modifications.

License

MIT License - feel free to use and modify as needed.

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

Credits

Built using:

About

GTK app and bash script to use Fuji X-T2 camera as webcam on Ubuntu Linux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •