Play video. Invalid args(HTTP 500)

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Play video. Invalid args(HTTP 500)

netslow
Hello!

I have Samsung UE32D6100 TV. I try to play video on it. But I get the following error:
Error: Invalid Args (HTTP response was: 500 Internal Server Error)

Can you explain what's wrong? Any ideas? I will appreciate for any help.

Here is my code:


package org.halfcup.upnp;

import org.teleal.cling.UpnpService;
import org.teleal.cling.UpnpServiceImpl;
import org.teleal.cling.controlpoint.ActionCallback;
import org.teleal.cling.model.action.ActionInvocation;
import org.teleal.cling.model.message.UpnpResponse;
import org.teleal.cling.model.message.header.STAllHeader;
import org.teleal.cling.model.meta.Device;
import org.teleal.cling.model.meta.Service;
import org.teleal.cling.registry.DefaultRegistryListener;
import org.teleal.cling.registry.Registry;
import org.teleal.cling.support.avtransport.callback.Play;
import org.teleal.cling.support.avtransport.callback.SetAVTransportURI;


public class TestService2 extends DefaultRegistryListener implements Runnable {

        public static void main(String[] args) throws Exception {
                Thread clientThread = new Thread(new TestService());
                clientThread.setDaemon(false);
                clientThread.start();

        }

        private UpnpService upnpService = null;
        public void run() {
                try {
                        upnpService = new UpnpServiceImpl();
                        upnpService.getRegistry().addListener(this);
                        upnpService.getControlPoint().search(new STAllHeader());
                } catch (Exception ex) {
                        System.err.println("Exception occured: " + ex);
                        System.exit(1);
                }
        }

        @Override
        public void deviceAdded(Registry registry, Device device) {
                super.deviceAdded(registry, device);
                if ("MediaRenderer".equals(device.getType().getType())) {
                        Service[] services = device.findServices();
                        for (Service service : services) {
                                System.out.println("=======================================================================");
                                System.out.println(service.getServiceId() + " "+ service.getServiceType().getType());
                                if ("AVTransport".equals(service.getServiceType().getType())) {
                                        setContent(service);
                                }
                        }
                }
        }

        public ActionCallback getPlayAction(Service service) {
                ActionCallback playAction =
                                new Play(service) {
                        @Override
                        public void failure(ActionInvocation invocation, UpnpResponse operation, String defaultMsg) {
                                System.out.println("error");
                        }
                };
                return playAction;
        }

        public void setContent(final Service service) {
                ActionCallback setAVTransportURIAction = new SetAVTransportURI(service, "http://192.168.1.8/12190028.mp4", "NO METADATA") {
                        @Override
                        public void failure(ActionInvocation invocation, UpnpResponse operation, String defaultMsg) {
                                System.out.println(" "+defaultMsg);
                        }

                        @Override
                        public void success(ActionInvocation invocation) {
                                ActionCallback playAction = getPlayAction(service);
                                playAction.setControlPoint(upnpService.getControlPoint());
                                playAction.run();
                        }
                };
                setAVTransportURIAction.setControlPoint(upnpService.getControlPoint());
                setAVTransportURIAction.run();
        }

}

Reply | Threaded
Open this post in threaded view
|

Re: Play video. Invalid args(HTTP 500)

Michael Pujos
Set the empty string instead of "NO METADATA"
Reply | Threaded
Open this post in threaded view
|

Re: Play video. Invalid args(HTTP 500)

netslow
Same result
Reply | Threaded
Open this post in threaded view
|

Re: Play video. Invalid args(HTTP 500)

Christian Bauer
Administrator

Call Samsung and tell them they suck.

On Jan 3, 2012 4:41 PM, "netslow [via Mailinglists]" <[hidden email]> wrote:
Same result


If you reply to this email, your message will be added to the discussion below:
http://mailinglists.945824.n3.nabble.com/Play-video-Invalid-args-HTTP-500-tp3628577p3629430.html
To start a new topic under Cling users and developers, email [hidden email]
To unsubscribe from Cling users and developers, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: Play video. Invalid args(HTTP 500)

Michael Pujos
Christian Bauer wrote
Call Samsung and tell them they suck.
That.

To OP:

Alternatively pass a valid DIDL-Lite frgament to SetAVTransportURI with a resource with the correct mime-type.
Some manufacturers have the great idea to reject any URL for which they cannot find a supported mime-type
in the metadata param of SetAVTransportURI...
Reply | Threaded
Open this post in threaded view
|

Re: Play video. Invalid args(HTTP 500)

netslow
Can you give me an example? I'm kind a newbee in UPNP world...
Reply | Threaded
Open this post in threaded view
|

Re: Play video. Invalid args(HTTP 500)

netslow
In reply to this post by Michael Pujos
Now when I set the following DIDL-Lite fragment:

<DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="1$14$744776839$2758061249" id="64$3$8$1" parentID="64$3$8" restricted="1"><dc:title>Title</dc:title><dc:creator>Unknown</dc:creator><upnp:artist>Artist</upnp:artist><upnp:album>Album</upnp:album><upnp:genre>Unknown</upnp:genre><upnp:albumArtURI></upnp:albumArtURI><upnp:originalTrackNumber>412506592</upnp:originalTrackNumber><upnp:class>object.item.audioItem.musicTrack</upnp:class> <res size="8414449" duration="0:05:48.000" bitrate="192000" protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01">http://192.168.1.8/Kalimba.mp3</res></item></DIDL-Lite>

...instead of NO METADATA, I get the message on my TV "Not supported file format".
Any ideas? Maybe I've missed something Samsung specific?

Reply | Threaded
Open this post in threaded view
|

Re: Play video. Invalid args(HTTP 500)

netslow
Well...  In this article http://ubuntuforums.org/showthread.php?t=1198689 I've found strange recipe which eventually solved my problem. I've set 2 http headers in my Apache Server. And metadata field I've set to "".
transferMode.dlna.org: Streaming
contentFeatures.dlna.org: DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=017000 00000000000000000000000000

Samsung....
I'm curious, how many TVs have same problem?
Reply | Threaded
Open this post in threaded view
|

Re: Play video. Invalid args(HTTP 500)

Michal
hi, my code does the same as yours... I have set my headers the same way as you described, I have samsung ps51d550... my app detects its avtransport service fine, when I execute the SetAVTransportURI pointing to an image on one of my web servers with the headers set according to you, I still get the HTTP 500 :(

any ideas appreciated except calling samsung telling them they suck... which actually won't help me any further :)))

btw. cling... very nice lib... helped a lot ... thumb up
Reply | Threaded
Open this post in threaded view
|

Re: Play video. Invalid args(HTTP 500)

Mat Ludlam
I am having the same problem.

I have a Samsung UE465500 which gives the same HTTP500 error.  I am using an MP3 file because this is a more common media format and I want to rule out anything specific to MP4.

I have changed my headers to include those defined above.

I know that what I want to achieve can be done because ZappoTV on my iPad works just fine.  It may not be using UPnP, but I am guessing that it does.

I have a Pioneer VSX-921 on my network and this plays just fine so the code is ok.

Right now installing Wire Shark and watching what ZappoTV does and comparing to Cling is my only thought.  This is something I have never done so would like to avoid if possible.

Any suggestions welcome.

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Play video. Invalid args(HTTP 500)

Mat Ludlam
Immediately after posting the above I removed the "NO METADATA" from this statement:

ActionCallback setAVTransportURIAction = new SetAVTransportURI(service, "http://192.168.1.8/12190028.mp4", "NO METADATA")

and it worked.

So in short for me, the headers and removal of that text works.

On my TV I found that I only needed 1 header:
contentFeatures.dlna.org: DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=017000 00000000000000000000000000

The other one made no difference.

I get a box on the screen asking permission to play, but that is ok; it has only done it once.

Thanks all for the help.
Reply | Threaded
Open this post in threaded view
|

Re: Play video. Invalid args(HTTP 500)

jaysontela
In reply to this post by netslow
Thnkas a lot for your help