-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working with D300 #31
Comments
Hi, The shutter won't open if "the camera is not ready" error happens except you change the F value. I'd like to ask you to confirm that it opened after you changed it manually. On the other hand, I pushed the experimental fix of this problem. Can you build this branch and run it with debug output enabled? |
ping @mochihisa |
I'm sorry for the late reply. I don't have time right now, so I'll reply later. |
I'm getting different output than before. Is there any possibility?
|
@mochihisa Sorry for inactivity, |
I'm sorry, I'll be late in replying due to periodic exams. |
Sorry for the late reply. |
I found 4 problems with D300.
EnvironmentNikon D300 firmware A: 1.01, B: 1.00 Issue: Failed to parse 64-byte style header.Log (Release 1.5.0 and 3bc52d4 are showed same logs):
When I change the header size 64 to 96, 128, 192, 256, 384 (mtp/nikon.go), the resolution and frame rate were displayed correctly on localhost:42389 and "failed to decode header" is not show up. I dumped the raw byte array to binary file for debugging. source code diffdiff --git a/mtp/server.go b/mtp/server.go
index 1bb11ba..e89892a 100644
--- a/mtp/server.go
+++ b/mtp/server.go
@@ -8,6 +8,7 @@ import (
"encoding/json"
"fmt"
"io"
+ "io/ioutil"
"net/http"
"strconv"
"sync"
@@ -778,6 +779,7 @@ func (s *LVServer) getLiveViewImgInner() (LiveView, error) {
}
raw := buf.Bytes()
+ _ = ioutil.WriteFile("debug", raw, 0644)
lvr := liveViewRaw{}
err = binary.Read(bytes.NewReader(raw[8:hs]), binary.BigEndian, &lvr) xxd
I found SOI marker (ffd8) at 0x40 (64). dd bs=1 skip=64 if=debug of=debug.jpg This image is correct. I put some bytes (more than or equal 5) to binary.Read and I got works well, But it is dirty hack. I think liveViewRaw has ommitable element(s). I need accurate liveViewRaw struct for 64-byte style header. diff --git a/mtp/server.go b/mtp/server.go
index 1bb11ba..0760695 100644
--- a/mtp/server.go
+++ b/mtp/server.go
@@ -780,7 +780,7 @@ func (s *LVServer) getLiveViewImgInner() (LiveView, error) {
raw := buf.Bytes()
lvr := liveViewRaw{}
- err = binary.Read(bytes.NewReader(raw[8:hs]), binary.BigEndian, &lvr)
+ err = binary.Read(bytes.NewReader(raw[8:hs+5]), binary.BigEndian, &lvr)
if err != nil {
return LiveView{}, fmt.Errorf("failed to decode header")
} Issue: Failed to set f-value (showup an error message):I tried to change f-number but I got ERROR (1.5.0 and 3bc52d4).
Issue: Failed to set ISO (w/o error message)ISO value does not affect the image w/o error message. (check on 3bc52d4 + dirtyhack) Issue: Showup invalid resolution.D300 reports original camera resolution (4288x2848) but image resolution is 640x426. (check on 3bc52d4 + dirtyhack) Note:This model's ISO and F-value control does not affect to internal LiveView function's image. |
I tried to use it on my D300, but it did not work.
The environment in which it was run is as follows.
OS : Ubuntu 20.10
Version : v1.2.0
The text was updated successfully, but these errors were encountered: