strands-project/strands_ui

[media_server] Media resource could not be decoded. video.

Closed this issue · 9 comments

I am trying to play a video from the media server directly in html5. This is what I do:

   <div id="videoDiv" style="position: absolute; left: 156px; top: 40px; width:711px; height: 400px;">
       <video id="videoplayer" width="356" height="200" >
        <source src="http://localhost:8027/get_media/5515715a0a08f5480c4489bc" type="video/mp4" />
        <source src="http://localhost:8027/get_media/5515715a0a08f5480c4489bc" type="video/ogg" />
        <source src="http://localhost:8027/get_media/5515715a0a08f5480c4489bc" type="video/webm" />
        <em>Sorry, your browser doesn't support HTML5 video.</em>
        </video>
    </div>

But I do get the error message:

Media resource http://localhost:8027/get_media/5515715a0a08f5480c4489bc could not be decoded.

three times, once for every call.

If I download the file, copy it to correct location, and try it with:

       <div id="videoDiv" style="position: absolute; left: 156px; top: 40px; width:711px; height: 400px;">
       <video id="videoplayer" width="356" height="200" >
        <source src="5515715a0a08f5480c4489bc.mp4" type="video/mp4" />
        <source src="5515715a0a08f5480c4489bc.mp4" type="video/ogg" />
        <source src="5515715a0a08f5480c4489bc.mp4" type="video/webm" />
        <em>Sorry, your browser doesn't support HTML5 video.</em>
        </video>
    </div>

It works as intended. Am I missing anything? @cburbridge @marc-hanheide

Just to add, this is the download link I get from the media server: http://localhost:8027/get_media/5515715a0a08f5480c4489bc so that should be correct?!

This is the output when clicking download:

Resource interpreted as Document but transferred with MIME type video/mp4: "http://localhost:8027/get_media_by_name/movie.mp4".
Navigated to http://localhost:8027/get_media_by_name/movie.mp4

This, by default opens it in a different tab and tries to play it (works for music and images) but this doesn't seem to work either.

The server reports no problems: 127.0.0.1:36773 - - [29/Mar/2015 14:16:34] "HTTP/1.1 GET /get_media_by_name/movie.mp4" - 200 OK

what happens if you use the get_media_by_name URL instead of the get_media
url?
I guess it will work in firefox?

On 29 March 2015 at 14:18, Christian Dondrup notifications@github.com
wrote:

This is the output when clicking download:

Resource interpreted as Document but transferred with MIME type video/mp4: "http://localhost:8027/get_media_by_name/movie.mp4".
Navigated to http://localhost:8027/get_media_by_name/movie.mp4

This, by default opens it in a different tab and tries to play it (works
for music and images) but this doesn't seem to work either.

The server reports no problems: 127.0.0.1:36773 - - [29/Mar/2015
14:16:34] "HTTP/1.1 GET /get_media_by_name/movie.mp4" - 200 OK


Reply to this email directly or view it on GitHub
#77 (comment)
.

I tried that as well. Neither firefox nor chrome can play it. Firefox says that the file is corrupted and chrome just doesn't play it.

@cburbridge any news on this?

I totally forgot I'll look into it now..

Ogg files work for me, but MP4 doesn't.. I have added some headers: https://github.com/cburbridge/strands_ui please test and let me know if it makes a difference. What video are you using?

@cburbridge Tried it, it seems to work in Firefox now but still doesn't work in Chrome I'm afraid. I'm using this video: https://lcas.lincoln.ac.uk/owncloud/public.php?service=files&t=bbf0c5da105a4c6bdb3b8327a972188a

It plays fine when I download it from the datacentre before I play it. But when just clicking on "Download" it tries to play it inside the browser where chrome doesn't give much of a hint regarding the error:

Resource interpreted as Document but transferred with MIME type video/mp4: "http://localhost:8027/get_media_by_name/tracker_video_new2.mp4".
Navigated to http://localhost:8027/get_media_by_name/tracker_video_new2.mp4

Since we are most likely using Firefox on the robot (due to being less demanding when it come to memory) I'm fine with that. Thank you!

Just confirming again, this works on Firefox. Can you open a PR @cburbridge ?