日本語はこちら
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 | Yes | ✅ | ? | @Jokler |
D750 | Yes | ✅ | ? | @anonymous |
D780 | Yes | ✅ | ✅ | @puhitaku |
D800 | Yes | ✅ | ? | @pcjpnet |
D800E | Yes | ✅ | ? | @Higomon |
D810 | Yes | ✅ | @GlassOnTin | |
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 | ✅ | ? | @anonymous |
Z5 | Yes | ✅ | ✅ | @ag-eitilt |
Z6 | Yes | ✅ | ✅ | @ShadowXii |
Z6II | Yes | ✅ | ✅ | @puhitaku |
Z6III | Yes | ? | Please give me a report! | |
Z7 | Yes | ✅ | ✅ | @zacheadams |
Z7II | Yes | ✅ | ✅ | @puhitaku |
Z8 | Yes | ✅ | ✅ | @evanslify |
Z9 | Yes | ✅ | ✅ | @oxpa |
Z30 | Yes | ✅ | ✅ | @puhitaku |
Z50 | Yes | ✅ | ✅ | @puhitaku |
Z fc | Yes | ✅ | ✅ | @puhitaku |
Z f | Yes | #75 |
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
- One digit D series D1, D1X, D1H, D2H, D2X, D2Hs, D2Xs
- Two digits D series D40, D40x, D50, D60, D70, D70s, D80
- Three digits D series D100, D200
- Four digits D series D3000, D3100
- Nikon 1 series
- 1 J5 responds "unsupported" as a reply of Start Live View request, so mysterious
- There may be an unknown MTP operation to get it working
- Please tell me anything you know about Live View or tethered shoot of Nikon 1 series!
- COOLPIX series
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- Please keep in mind that other choices do NOT work
-
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 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
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
- 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 pkg-config
-
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")
-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 frame
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.