puhitaku / mtplvcap

Nikon to USB Webcam. Supports older models that Nikon WU does not. Windows/macOS/Linux. No HDMI capture dongle is needed. Ask me on Twitter @puhitaku
https://twitter.com/puhitaku
Other
251 stars 17 forks source link

How to get other qualities? #44

Closed Revisto closed 2 years ago

Revisto commented 3 years ago

Hi, I'm using Nikon D5100 and everything works fine but there is a problem. mtplvcap only captures 640x424 video quality. I wanted to see how I can get other qualities like full-HD as well.

puhitaku commented 3 years ago

Dup: #34 Unfortunately, there's no other choice of resolution AFAIK.

kendermag commented 2 years ago

Hello, i might found a way for this in another repo, here:

https://github.com/dognotdog/ptpwebcam/blob/fd96bc3aaf5b5b02a43dd5d71e100b2ed95c1e17/PtpWebcamDalPlugin/PtpWebcamPtp.h#L122

in this line there is a hex which is unused in your code in const.go , i assume writing the appropriate value to that address could be used in some cameras to increase the live view resolution, hence increasing the usb transferred resolution. The maximum resolution seems to be 1024x768 but that is way better than 640x424. Here is the commit where the other repo's owner added this feature: commit

I tried to port this yesterday, but i am unskilled both in go and obj-c

puhitaku commented 2 years ago

Interesting, opening it again

puhitaku commented 2 years ago

I've tested it (read the available resolutions) and my D5300 returned 1 (320x212) and 2 (640,424). Unfortunately, my DSLR isn't capable of another choice "3" (1024x?) but some may be.

puhitaku commented 2 years ago

D5300 returns an array [1, 2] as available choices and I believe that newer models return like [1, 2, 3]. I'll try reading the choice from other models and post the update here.

puhitaku commented 2 years ago

My expectation was right; on-production models return [1, 2, 3]. I tried it in a camera shop. Unexpectedly, I met a member of Nikon and he told me that MTP commands and properties are slightly different between models. Actually, some models like Z* reply [1, 2, 3] for the read value of property 0xD1AC but writing it didn't succeed.

Changing resolution may fail but we can fallback so I'll implement like "try to read available resolutions and set it maximum and just log an error if it's not successful and go ahead".

kendermag commented 2 years ago

Thank you! On the other repo it is stated that d7500 works with XGA: issue What is interesting regarding a Z50 is: issue z50 the person there says that he used Z50, and he got 720p resolution.

puhitaku commented 2 years ago

I've created a PR: #52 I wonder if I should enable this option as standard, but decided not to because the resolution change API is different for some models and I don't know how many models it would affect.

puhitaku commented 2 years ago

I've released Version 1.5.0 that has -max-resolution option. While there seems to be another unknown way to set it max on some models, I implemented it anyway and I should close here. Thanks @kendermag for pinging me with nice information!