我想从支持DLNA的Sony NEX-6摄像头下载图像。发现ConnectionManager将返回以下内容:
<device
xmlns="urn:schemas-upnp-org:device-1-0">
<dlna:X_DLNADOC
xmlns:dlna="urn:schemas-dlna-org:device-1-0">DMS-1.50
</dlna:X_DLNADOC>
<deviceType>urn:schemas-upnp-org:device:MediaServer:1</deviceType>
<friendlyName>NEX-6</friendlyName>
<manufacturer>Sony Corporation</manufacturer>
<manufacturerURL>http://www.sony.com/</manufacturerURL>
<modelDescription>SonyDigitalMediaServer</modelDescription>
<modelName>SonyImagingDevice</modelName>
<modelURL>http://www.sony.net/</modelURL>
<UDN>uuid:00000000-0000-0010-8000-2002af0fa742</UDN>
<serviceList>
<service>
<serviceType>urn:schemas-upnp-org:service:ContentDirectory:1</serviceType>
<serviceId>urn:upnp-org:serviceId:ContentDirectory</serviceId>
<SCPDURL>/CdsDesc.xml</SCPDURL>
<controlURL>/upnp/control/ContentDirectory</controlURL>
<eventSubURL>/upnp/event/ContentDirectory</eventSubURL>
</service>
<service>
<serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>
<serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
<SCPDURL>/CmsDesc.xml</SCPDURL>
<controlURL>/upnp/control/ConnectionManager</controlURL>
<eventSubURL>/upnp/event/ConnectionManager</eventSubURL>
</service>
</serviceList>
<iconList>
<icon>
<mimetype>image/jpeg</mimetype>
<width>48</width>
<height>48</height>
<depth>24</depth>
<url>/DLNA_camera_48.jpg</url>
</icon>
<icon>
<mimetype>image/jpeg</mimetype>
<width>120</width>
<height>120</height>
<depth>24</depth>
<url>/DLNA_camera_120.jpg</url>
</icon>
<icon>
<mimetype>image/png</mimetype>
<width>48</width>
<height>48</height>
<depth>24</depth>
<url>/DLNA_camera_48.png</url>
</icon>
<icon>
<mimetype>image/png</mimetype>
<width>120</width>
<height>120</height>
<depth>24</depth>
<url>/DLNA_camera_120.png</url>
</icon>
</iconList>
<av:standardCDS
xmlns:av="urn:schemas-sony-com:av">5.0
</av:standardCDS>
<av:photoRoot
xmlns:av="urn:schemas-sony-com:av">PhotoRoot
</av:photoRoot>
</device>据我所知,这款相机不提供AVTransport服务。这是真的吗?那么我如何才能从相机中获得图像呢?最大值。来自ContentDirectory服务的分辨率太小(JPEG_LRG)。
发布于 2015-08-04 00:38:26
多亏了https://play.google.com/store/apps/details?id=lv.n3o.shark,我才能捕捉到流量。大多数请求都是“标准”的ContentDirectory请求,比如获取文件夹列表、文件、预览图像等。但是一旦我下载了一个完整的图片,我就收到了这样的请求:
GET http://10.0.0.1:60151/LRG__DSC9978.ARW?%2104%5f02%5f1107310400%5f000002%5f000073%5f000000%21http%2dget%3a%2a%3aimage%2fjpeg%3aDLNA%2eORG%5fPN%3dJPEG%5fLRG%3bDLNA%2eORG%5fCI%3d1%21%21%21%21%21 HTTP/1.1
Connection: close
User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.1.1; HUAWEI G510-0100 Build/HuaweiG510-0100)
Host: 10.0.0.1:60151
Accept-Encoding: gzip这将返回1616x1080像素大小的JPEG格式的图像数据...哇哦。解码GET请求返回:
!04_02_1107310400_000002_000073_000000!http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_LRG;DLNA.ORG_CI=1!!!!!现在我要看看如何构建这个查询字符串。对我来说似乎不是标准化的。如果有人有线索,请告诉我。
发布于 2015-08-03 09:19:51
实际上,索尼数码相机是由基于HTTP和JSON的Wirelessly access Sony cameras with the Camera Remote API beta控制的,而不是DLNA/UPnP。
https://developer.sony.com/develop/cameras/
希望这能有所帮助。
https://stackoverflow.com/questions/31775864
复制相似问题