A simple GTK application and bash script to use your Fuji X-T2 camera as a webcam on Ubuntu Linux using gphoto2 and v4l2loopback.
- 🎥 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
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
- 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)
-
Clone this repository:
git clone https://github.com/yourusername/fuji-webcam2-linux.git cd fuji-webcam2-linux
-
Run the installation script:
./install.sh
-
Launch the app:
- From your application menu (search for "Fuji X-T2 Webcam")
- Or run directly:
./fuji-webcam-gtk.py
If you prefer a command-line interface:
./enable-fuji-webcam.sh
-
Connect your Fuji X-T2 camera via USB
-
Set camera USB mode to PC AUTO or USB TETHER
- Menu → Connection Setting → USB Mode → PC AUTO
-
Launch the Fuji X-T2 Webcam app
-
Click Start Webcam
-
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
-
Your camera will appear as
/dev/video2
in video applications -
Click Stop Webcam when done
- Connect and configure your camera (same as above)
- Run
./enable-fuji-webcam.sh
- Follow the prompts
- Press Ctrl+C to stop streaming
On your Fuji X-T2:
- Go to Menu
- Navigate to Connection Setting
- Select USB Mode
- Choose PC AUTO or USB TETHER
- Connect the camera via USB and power it on
- 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
- 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
- Kill interfering processes:
sudo pkill -f gvfs-gphoto2 sudo pkill -f gphoto2
- Restart the application
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
fuji-webcam-gtk.py
- GTK applicationenable-fuji-webcam.sh
- Bash script alternativefuji-webcam.desktop
- Desktop entry for application menuinstall.sh
- Installation script
- 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.
MIT License - feel free to use and modify as needed.
Contributions are welcome! Please feel free to submit issues or pull requests.
Built using:
- gphoto2
- v4l2loopback
- FFmpeg
- GTK 3