日本語はこちら
mtplvcap is a multi-platform (Windows/Mac/Linux) software that relays the Live View of Nikon cameras via WebSocket.
mtplvcap + OBS turn your cameras into web cameras without HDMI capture device. Enjoy video chatting on Google Hangouts/Meet/Zoom etc. with your favorite cameras!
- Nikon D3200 (thanks @Ivisi !)
- Nikon D3300 (thanks @unasuke !)
- Nikon D5000 (thanks @rch850 !)
- Nikon D5100 (thanks @shigureanko !)
- Nikon D5300
- Nikon D5500 (thanks @nasustim !)
- Nikon D600 (thanks @ohtayo !)
- Nikon D610 (thanks @hazlitt !)
- Nikon D7000 (thanks @takashi0314 !)
- Nikon D7100 (thanks @TheMidlander !)
- Nikon D7200 (thanks @br_spike_love !)
- Nikon Z6 (thanks @ShadowXii !)
- Nikon Z7 (thanks @zacheadams !)
- I welcome feedback! Please tell me if your camera works or not.
OS | OBS | Virtual camera | Browser |
---|---|---|---|
Windows 10 version 1909, Build 18363.900, amd64 | 25.0.8 | OBS Virtualcam 2.0.5 | Microsoft Edge 84.0.522.44 (Chromium Edge) |
macOS 10.15.5 Catalina, amd64 | 25.0.8 | obs-mac-virtualcam 3ca8f62 v1.2.0 | Google Chrome 84.0.4147.89, Microsoft Edge 84.0.522.44 |
Debian GNU/Linux 10 Buster, amd64 | 25.0.7-442-ge3942061 | obs-v4l2sink 1ec3c8a | Mozilla Firefox 68.10.0esr |
Note: Browsers listed here are used to check if virtual cams work well. Any other browsers should work.
Notice: Snippets described here should run as-is and copy-and-pastable.
Important: For Windows, you have to replace a pre-installed MTP driver with a libusb driver. Your PC will no longer recognize the camera as an MTP device unless you re-install it manually. Reverting back is super easy! Follow the instruction to revert back the driver.
-
Connect your Nikon camera to the PC
-
Download Zadig from here and launch it
-
Tick
List All Devices
-
Make sure that your camera is in the list upper in the window and choose it
(This screenshot was taken after the libusb driver is installed and will differ from what you see)
-
Choose
libusb-win32 (vX.X.X.X)
in the input box in the middle of the window- Please keep in mind that
WinUSB
does NOT work. Be careful not to choose it.
- Please keep in mind that
-
Click
Replace Driver
button and wait it finishes the installation- Optionally, open the Device Manager and make sure it's installed
- Download the release from here (mtplvcap_windows_amd64.zip).
- Extract the ZIP
- Double-click
mtplvcap.exe
- Make sure your camera opens up its shutter
-
Download and install MSYS2 from here
-
Launch "MSYS2 MSYS" in the Start Menu
-
Install dependencies
- Some people reported that pacman fails to install a package group
mingw-w64-x86_64-toolchain
and other packages at once. Installing them separately should succeed.
pacman -Sy pacman -S mingw-w64-x86_64-toolchain pacman -S \ mingw-w64-x86_64-libusb \ mingw-w64-x86_64-go \ mingw-w64-x86_64-pkg-config \ git
- Some people reported that pacman fails to install a package group
-
Add PATHs
echo 'PATH=$PATH:/mingw64/bin:/mingw64/lib/go/bin' >> ~/.bashrc source ~/.bashrc
-
Clone this repo
git clone https://github.com/puhitaku/mtplvcap.git
-
cd
, build, and launch itcd mtplvcap CGO_CFLAGS='-Wno-deprecated-declarations' go build . ./mtplvcap.exe -debug server
- Make sure your camera opens up its shutter
- Perhaps you have to specify GOROOT like
GOROOT=/mingw64/lib/go go build .
-
Done!
- The binary can be moved and redistributed easily
- Copy
libusb-1.0.dll
fromC:\msys64\mingw64\bin\libusb-1.0.dll
and place the copy alongsidemtplvcap.exe
to launch it directly from Explorer
Generic MTP apps will no longer be able to communicate with cameras with replaced libusb driver. To revert it back, follow the instruction:
(Screenshots are not available as I don't have English Windows. Sorry for inconvenience.)
-
Right-click the Start Button and click ""
-
Right-click your camera in the "libusb-win32 devices" section and click "Update driver"
-
Click "Browse my computer for driver software"
-
Click "Let me pick from a list of device drivers on my computer"
-
Choose "MTP USB Device" in the list and click "Next >"
-
It'll show "Windows has successfully updated your driver software" and it's done
-
Install libusb
brew install libusb
-
Download the release from here (mtplvcap_macos_amd64.zip).
-
Extract the ZIP and launch it
unzip mtplvcap_macos_amd64.zip ./macos/mtplvcap
- macOS will warn you that the binary is not verified
-
Allow non-verified binary to launch
- Dismiss the dialog (Do not move it to the trash!)
- Open "System Preferences" -> "Security & Privacy" -> Click "Allow Anyway"
- Launch
mtplvcap
once more and click "Open"
- Make sure your camera opens up its shutter
-
Install dependencies
brew install golang git
-
Install XCode Command Line Tools with
xcode-select --install
-
Clone this repo
git clone https://github.com/puhitaku/mtplvcap.git
-
cd
, build, and launch itcd mtplvcap CGO_CFLAGS='-Wno-deprecated-declarations' go build . ./mtplvcap -debug server
- If macOS blocks the downloaded executable and show alerts, please follow this procedure to proceed
- Make sure your camera opens up its shutter
-
Done!
I strongly recommend you to compile by yourself for Linux distributions as Linux environments vary widely.
-
Install libusb
# For Debian/Ubuntu: sudo apt install libusb-1.0-0
# For Arch: pacman --sync libusb
-
Download the release from here (mtplvcap_linux_amd64.zip).
-
Extract the ZIP and launch it
unzip mtplvcap_linux_amd64.zip ./linux/mtplvcap
- Make sure your camera opens up its shutter
-
Install dependencies
# For Debian/Ubuntu: sudo apt install golang-go libusb-1.0-0-dev
# For Arch: pacman --sync go libusb
-
cd
, build, and launch itcd mtplvcap CGO_CFLAGS='-Wno-deprecated-declarations' go build . ./mtplvcap -debug server
- Make sure your camera opens up its shutter
$ ./mtplvcap -help
Usage of ./mtplvcap:
-backend-go
force gousb as libusb wrapper (not recommended)
-debug string
comma-separated list of debugging options: usb, data, mtp, server
-host string
hostname: default = localhost, specify 0.0.0.0 for public access (default "localhost")
-port int
port: default = 42839 (default 42839)
-product-id string
PID of the camera to search (in hex), default=0x0 (all) (default "0x0")
-server-only
serve frontend without opening a DSLR (for devevelopment)
-vendor-id string
VID of the camera to search (in hex), default=0x0 (all) (default "0x0")
http://localhost:42839/view
will show the captured frames
http://localhost:42839
is a controller to control your camera- "Auto Focus" section controls periodic/manual AF
- "Rate Limit" section limits/un-limits the frame rate to decrease overall CPU usage
- "Information" section shows the dimension of captured images etc.
-
Install mtplvcap and check if it works
-
Install OBS (Open Broadcaster Software) from here
-
Install OBS virtual camera (it varies for each OS)
-
Open OBS preference and "Video" tab
-
Adjust resolutions to fit with LV frame dimension
- Launch mtplvcap and open
localhost:42839
to get the actual resolution
- Launch mtplvcap and open
-
Add a "Browser" source
-
Set "Width" and "Height" to the same value of "Video" preference
-
Set
http://localhost:42839/view
as the URL -
Enable the virtual camera and configure chat apps
-
BOOM!
- This software is in alpha stage.
- Stops Live View automatically
- The timeout can be elongated in camera menu.
- Some cameras support disabling auto-off timer, while some does not.
- For D5300, "Custom Setting Menu" -> "c Timers/AE lock" -> "Auto off timers" -> "Custom" -> "Live View" -> "30 min"
- As a work-around, mtplvcap watches the shutter and opens it automatically when it's closed.
- D5000: incorrect frame dimension is reported in the controller
- Correct dimension is 640x426
- Windows: on MinTTY, the process gets killed without graceful shut-down when you press Ctrl-C.
- It will result in a fail of the next launch and might require you to re-plug the camera in.
- It's a known behavior and is not a bug of mtplvcap.
- Please install winpty with pacman and run via it
winpty ./mtplvcap
- Running mtplvcap directly from Explorer with double-click runs without this problem. Please stop it with Ctrl-C, not by pressing the close button.
- Posting issues and PRs is welcome. Follow CONTRIBUTING.md for contribution.
- Only few cameras are tested. Please tell me if mtplvcap works (or not) with your camera.
This program is based on github.com/hanwen/go-mtpfs. Special thanks to Han-Wen-san for a robust and mature MTP implementation.
And also I referenced github.com/dukus/digiCamControl for parsing MTP payloads. If not for this, I couldn't have implemented mtplvcap.