2017-08-17 99 views
1

「avContent服務」我正在開發A6300相機上的Android應用程序。我想實現「傳送圖像」功能。我連接了攝像頭wifi並找到了設備。當我通過訪問url http://192.168.122.1:61000/scalarwebapi_dd.xml獲取設備信息時。使用索尼相機遠程API 2.4無法獲得索尼相機A6300

Camera Remote API的信息由圖片中的標籤「X_ScalarWebAPI_DeviceInfo」元素描述。我無法獲得開發指南中描述的「avContent」服務。我可以獲得「accessControl」服務。我已將相機的Fireware更新至2.00,但這並不重要。

the device info xml

+0

請閱讀[在什麼情況下,我可以在我的問題中添加「緊急」或其他類似的短語,以獲得更快的答案?](// meta.stackoverflow.com/q/326569) - 摘要這不是解決志願者問題的理想方式,而且可能會對獲得答案產生反作用。請不要將這添加到您的問題。 – halfer

回答

1

實際上,你不得不開始使用相機API所需的第一步。您現在需要解析上述xml以獲取正確的ActionList_URL。您需要的是具有「相機」的ServiceType的那個。這意味着您將收到網址「http://192.168.122.1:8080/sony」。現在,您需要做的是對此URL執行POST調用,爲您要調用的API endPoint提供正文。

如果要拍一張新照片,你可以撥打actTakePicture端點通過JSON這樣

{ 
"method": "actTakePicture", 
"params": [], 
"id": 1, 
"version": "1.0" 
} 

然後,您將得到類似下面的結果:

{ 
"result": [ 
["http://ip:port/postview/postview.jpg"] 
], 
"id": 1 
} 

正如你所看到的圖像的網址被返回,現在你可以下載它。您如何下載它取決於您使用的編程語言。這裏是一個鏈接,如何從URL中使用下載圖像,安卓 Best method to download image from url in Android

如果你想看到所有的圖像和視頻的攝像頭,並下載他們,你會使用getContentList API調用

{ 
"method": "getContentList", 
"params": [ 
{ 
    "uri": "storage:memoryCard1", 
    "stIdx": 0, 
    "cnt": 50, 
    "view": "date", 
    "sort": "" 
} 
], 
    "id": 1, 
    "version": "1.3" 
} 

這會給你的結果是這樣的:

{

"result": [ 
[ 
{ 
"uri": "image:content?contentId=XXXXXXXXXX", 
"title": "", 
"content": { 
"original": [ 
{ 
"fileName": "DSC00001.JPG", 
"stillObject": "jpeg", 
"url": "http://ip:port/contentstransfer/orgjpeg/xxxxxxxx-xxxxxxxx" 
} 
], 
"smallUrl": "http://ip:port/contentstransfer/vga/xxxxxxxx-xxxxxxxx", 
"largeUrl": "http://ip:port/contentstransfer/scn/xxxxxxxx-xxxxxxxx", 
"thumbnailUrl": "http://ip:port/contentstransfer/thumb/xxxxxxxx-xxxxxxxx" 
}, 
"createdTime": "2014-08-18T12:34:56+09:00", 
"contentKind": "still", 
"folderNo": "100", 
"fileNo": "0001", 
"isPlayable": "false", 
"isBrowsable": "false", 
"isProtected": "", 
"remotePlayType": null 
} 
] 
], 
"id": 1 
} 

請讓我知道如果您將n eed more information