upnp:从没有AVTransport服务的MediaServer设备获取内容

时间:2015-08-02 19:40:56

标签: service media sony upnp dlna

我想从支持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)。

2 个答案:

答案 0 :(得分:0)

感谢https://play.google.com/store/apps/details?id=lv.n3o.shark我可以捕获流量。 大多数请求都是&#34;标准&#34; ContentDirectory请求获取文件夹列表,文件,预览图像a.s.o. 但是,只要我下载完整的图片,我就会收到这样的请求:

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

这将以1616 x 1080像素大小的形式返回JPEG图像数据...... whohoo。解码GET请求返回:

!04_02_1107310400_000002_000073_000000!http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_LRG;DLNA.ORG_CI=1!!!!!

现在我必须看看如何构建这个查询字符串。似乎不是我的标准化。如果有人有线索,请告诉我。

答案 1 :(得分:-1)

实际上,索尼数码相机不是DLNA / UPnP,而是由基于HTTP和JSON的Wirelessly access Sony cameras with the Camera Remote API beta控制。

https://developer.sony.com/develop/cameras/

希望这会有所帮助。