日本語はこちら
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!
Model | Has Live View | Status | High Res | Confirmed By |
---|---|---|---|---|
D3 | Yes | ? | Please give me a report! | |
D3X | Yes | ? | Please give me a report! | |
D3S | Yes | ? | Please give me a report! | |
D4 | Yes | ? | Please give me a report! | |
D4S | Yes | ? | Please give me a report! | |
D5 | Yes | ? | Please give me a report! | |
D6 | Yes | ✅ | ✅ | @puhitaku |
D90 | Yes | ✅ | ? | @sachaos |
D300 | Yes | #31 | ? | I welcome additional reports! |
D300S | Yes | ? | Please give me a report! | |
D500 | Yes | ✅ | ✅ | @yasuoeto |
D600 | Yes | ✅ | ? | @ohtayo |
D610 | Yes | ✅ | ? | @hazlitt |
D700 | ? | #11 | ? | I welcome additional reports! |
D750 | Yes | ✅ | ? | |
D780 | Yes | ✅ | ✅ | @puhitaku |
D800 | Yes | ✅ | ? | @pcjpnet |
D800E | Yes | ✅ | ? | @Higomon |
D810 | Yes | ? | Please give me a report! | |
D850 | Yes | ✅ | ✅ | @puhitaku |
D3200 | Yes | ✅ | @Ivisi | |
D3300 | Yes | ✅ | @unasuke | |
D3400 | Yes | ✅ | ? | @chefaustin |
D3500 | Yes | ✅ | ? | @fedegratti |
D5000 | Yes | ✅ | @rch850 | |
D5100 | Yes | ✅ | @shigureanko | |
D5200 | Yes | ✅ | @ThatSameer | |
D5300 | Yes | ✅ | @puhitaku | |
D5500 | Yes | ✅ | ? | @nasustim |
D5600 | Yes | ✅ | ? | @tadasv |
D7000 | Yes | ✅ | ? | @takashi0314 |
D7100 | Yes | ✅ | ? | @TheMidlander |
D7200 | Yes | ✅ | ? | @br_spike_love |
D7500 | Yes | ✅ | ✅ | @puhitaku |
Df | Yes | ✅ | ? | |
Z5 | Yes | ✅ | ✅ | @ag-eitilt |
Z6 | Yes | ✅ | ✅ | @ShadowXii |
Z6II | Yes | ✅ | ✅ | @puhitaku |
Z7 | Yes | ✅ | ✅ | @zacheadams |
Z7II | Yes | ✅ | ✅ | @puhitaku |
Z9 | Yes | ✅ | ✅ | @oxpa |
Z30 | Yes | ✅ | ✅ | @puhitaku |
Z50 | Yes | ✅ | ✅ | @puhitaku |
Z fc | Yes | ✅ | ✅ | @puhitaku |
While the default resolution is 640x424 for all models, newer models support capturing high res image like 1024xXXX. Changing the resolutions for some models succeeds but some do not. This problem is tracked in an issue and may be resolved when the right method to change the resolution is found.
Icon | Meaning |
---|---|
? |
Untested |
Blank | It has no higher resolutions |
🤔 | It replies higher resolutions but not confirmed to work (confirmation report is much appreciated) |
✅ | It replies higher resolutions and setting the resolution succeeds |
Note: model names without a link is not confirmed but may not support live viewing
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 |
macOS 11.2.3 Big Sur, arm64 | 26.1.2 | Microsoft Edge 88.0.705.68 | |
Debian 10 Buster, amd64 | 25.0.7-442-ge3942061 | obs-v4l2sink 1ec3c8a | Mozilla Firefox 68.10.0esr |
Debian sid (2021-03-27), amd64 | 26.1.2-290-ga52012e8c |
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 WinUSB 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 WinUSB driver is installed and will differ from what you see)
Choose WinUSB (vX.X.X.X)
in the input box in the middle of the window
Click Replace Driver
button and wait it finishes the installation
mtplvcap.exe
Download and install MSYS2 from here
Launch "MSYS2 MSYS" in the Start Menu
Install dependencies
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
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 it
cd mtplvcap
CGO_CFLAGS='-Wno-deprecated-declarations' go build .
./mtplvcap.exe -debug server
GOROOT=/mingw64/lib/go go build .
Done!
libusb-1.0.dll
from C:\msys64\mingw64\bin\libusb-1.0.dll
and place the copy alongside mtplvcap.exe
to launch it directly from ExplorerGeneric MTP apps will no longer be able to communicate with cameras with replaced WinUSB 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 "Device Manager"
Right-click your camera in the "Universal Serial Bus 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
‼️ For macOS Ventura users: please run mtplvcap
command with sudo
. See issue #68 for the background and further info.
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
Allow non-verified binary to launch
mtplvcap
once more and click "Open"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 it
cd mtplvcap
CGO_CFLAGS='-Wno-deprecated-declarations' go build .
./mtplvcap -debug server
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
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 it
cd mtplvcap
CGO_CFLAGS='-Wno-deprecated-declarations' go build .
./mtplvcap -debug server
$ ./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")
-max-resolution
change the resolution to the max (experimental)
-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 frameshttp://localhost:42839/mjpeg
will serve a bare MJPEG stream
(suitable to record a timelapse with OctoPrint etc.)http://localhost:42839/snapshot
will return the latest JPEG framehttp://localhost:42839
is a controller to control your cameraInstall 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
localhost:42839
to get the actual resolutionAdd 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!
winpty ./mtplvcap
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.