Using Sony Camera Remote API 2.4 can't get “avContent service” for Sony camera A6300

纵饮孤独 提交于 2019-12-11 07:18:51

问题


I'm developing an android app on A6300 camera. I want to realize "Transferring images " function. I connected the camera wifi and found the device. When I get the device info by accessing the url http://192.168.122.1:61000/scalarwebapi_dd.xml.

The information of Camera Remote API is described by the tags"X_ScalarWebAPI_DeviceInfo" element in the picture. I can't get the "avContent" service described on the Development Guide. I can just get "accessControl" service. I have updated the camera fireware to 2.00, but that doesn't matter.


回答1:


You actually have the first step required to start using the Camera API. You now need to parse the above xml to grab the correct ActionList_URL. The one you need is the one with the ServiceType of "camera". That means that you will be receive the url "http://192.168.122.1:8080/sony". Now what you need to do is run a POST call to this url providing the body for the API endPoint you want to call.

If you want to take a new picture you can call the actTakePicture Endpoint passing JSON like this

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

You will then get back a result like this:

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

As you can see the url to the image is returned and now you can download it. How you download it will depend on the programming language you are using. Here is a link to how to download an image from a url using Android: Best method to download image from url in Android

If you want to see all of the images and video on the camera and download them you would use the getContentList API call

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

This will give you a result something like this:

{

"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
}

Please let me know if you need more information



来源:https://stackoverflow.com/questions/45736605/using-sony-camera-remote-api-2-4-cant-get-avcontent-service-for-sony-camera-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!