Psuedo video streaming with item attachment and seeking enabled

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

Psuedo video streaming with item attachment and seeking enabled

ejeraltin
Hi, 

I added a html 5 video tag to play the video's I uploaded to dspace. The video can be played, but I cannot seek to parts which aren't downloaded. 

The command "curl -H Range:bytes=16- -I localhost:8080" gives "Accept-Ranges: bytes" back, so tomcat understands "content-range". Does this mean that the servlet handling the file downloads doesn't implement content-range? What other options do I have within dspace to do this or will it be difficult to implement content-range on servlet level? 

Regards,

(This is my second post for the same question, as the first was sent to [hidden email], as the question should be sent to this mailing list.)

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Reply | Threaded
Open this post in threaded view
|

Re: Psuedo video streaming with item attachment and seeking enabled

Keith Gilbertson-2
Jonathan -

I'm not sure if you're using xmlui or jspui. I know that in xmlui, the
servlet didn't implement content range. You have to uncomment some
code in BitstreamReader, and then fix a couple of bugs in it to get
things working.

Sample:
http://vtechworks.lib.vt.edu/handle/10919/18426

I've been intending to put these code changes back into the DSpace
project, but since the hack was a bit rushed I wanted to wait and see
if anything broke. Also, I think it would be better if the
content-range was configurable to be enabled/disabled.
--keith


On Mon, Feb 25, 2013 at 4:38 AM, Jonathan Freesbay <[hidden email]> wrote:

> Hi,
>
> I added a html 5 video tag to play the video's I uploaded to dspace. The
> video can be played, but I cannot seek to parts which aren't downloaded.
>
> The command "curl -H Range:bytes=16- -I localhost:8080" gives
> "Accept-Ranges: bytes" back, so tomcat understands "content-range". Does
> this mean that the servlet handling the file downloads doesn't implement
> content-range? What other options do I have within dspace to do this or will
> it be difficult to implement content-range on servlet level?
>
> Regards,
>
> (This is my second post for the same question, as the first was sent to
> [hidden email], as the question should be sent to this
> mailing list.)
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> DSpace-tech mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
> List Etiquette:
> https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Reply | Threaded
Open this post in threaded view
|

Re: Psuedo video streaming with item attachment and seeking enabled

ejeraltin
Hi Keith,

Impressive!

When do you plan to contribute the code?

Regards,


2013/2/27 Keith Gilbertson <[hidden email]>
Jonathan -

I'm not sure if you're using xmlui or jspui. I know that in xmlui, the
servlet didn't implement content range. You have to uncomment some
code in BitstreamReader, and then fix a couple of bugs in it to get
things working.

Sample:
http://vtechworks.lib.vt.edu/handle/10919/18426

I've been intending to put these code changes back into the DSpace
project, but since the hack was a bit rushed I wanted to wait and see
if anything broke. Also, I think it would be better if the
content-range was configurable to be enabled/disabled.
--keith


On Mon, Feb 25, 2013 at 4:38 AM, Jonathan Freesbay <[hidden email]> wrote:
> Hi,
>
> I added a html 5 video tag to play the video's I uploaded to dspace. The
> video can be played, but I cannot seek to parts which aren't downloaded.
>
> The command "curl -H Range:bytes=16- -I localhost:8080" gives
> "Accept-Ranges: bytes" back, so tomcat understands "content-range". Does
> this mean that the servlet handling the file downloads doesn't implement
> content-range? What other options do I have within dspace to do this or will
> it be difficult to implement content-range on servlet level?
>
> Regards,
>
> (This is my second post for the same question, as the first was sent to
> [hidden email], as the question should be sent to this
> mailing list.)
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> DSpace-tech mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
> List Etiquette:
> https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Reply | Threaded
Open this post in threaded view
|

Re: Psuedo video streaming with item attachment and seeking enabled

ejeraltin
Hi,

Just uncomment partial download code in org.dspace.app.xmlui.cocoon.BitstreamReader under generate(). It's disabled because some browser integrated PDF readers crash (says documentation code).

Regards,


2013/2/27 Jonathan Freesbay <[hidden email]>
Hi Keith,

Impressive!

When do you plan to contribute the code?

Regards,


2013/2/27 Keith Gilbertson <[hidden email]>
Jonathan -

I'm not sure if you're using xmlui or jspui. I know that in xmlui, the
servlet didn't implement content range. You have to uncomment some
code in BitstreamReader, and then fix a couple of bugs in it to get
things working.

Sample:
http://vtechworks.lib.vt.edu/handle/10919/18426

I've been intending to put these code changes back into the DSpace
project, but since the hack was a bit rushed I wanted to wait and see
if anything broke. Also, I think it would be better if the
content-range was configurable to be enabled/disabled.
--keith


On Mon, Feb 25, 2013 at 4:38 AM, Jonathan Freesbay <[hidden email]> wrote:
> Hi,
>
> I added a html 5 video tag to play the video's I uploaded to dspace. The
> video can be played, but I cannot seek to parts which aren't downloaded.
>
> The command "curl -H Range:bytes=16- -I localhost:8080" gives
> "Accept-Ranges: bytes" back, so tomcat understands "content-range". Does
> this mean that the servlet handling the file downloads doesn't implement
> content-range? What other options do I have within dspace to do this or will
> it be difficult to implement content-range on servlet level?
>
> Regards,
>
> (This is my second post for the same question, as the first was sent to
> [hidden email], as the question should be sent to this
> mailing list.)
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> DSpace-tech mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
> List Etiquette:
> https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette



------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Reply | Threaded
Open this post in threaded view
|

Re: Psuedo video streaming with item attachment and seeking enabled

ejeraltin
In reply to this post by ejeraltin
Hi,

It looks like it only works in Firefox. In IE I get "Invalid source". The same file works in other static web servers. Looking at the content type, I got video/mp4;charset=ISO-8859-1. This should be just "video/mp4". How can I change this?

Thanks,

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Reply | Threaded
Open this post in threaded view
|

Re: Psuedo video streaming with item attachment and seeking enabled

Sara Amato
I'm trying to get this working in xmlui, and find that while I can get the proper looking code on the page, e.g. 

<video src="/xmlui/bitstream/handle/10177/62/Knopf.mp4?sequence=1" width="320" height="240" controls="" autobuffer="" />

the video does not play.  If I go to the link directly, it downloads the video rather than playing.  I notice in the VTech example, following the link
actually plays the video.

I'm guessing that I missed a step somewhere.  All I've done is edit the item-view.xsl  and uncommented the partial download code in the BitstreamReader.  

Any advice appreciated. 




On May 31, 2013, at 1:24 AM, Jonathan Freesbay wrote:

Hi,

It looks like it only works in Firefox. In IE I get "Invalid source". The same file works in other static web servers. Looking at the content type, I got video/mp4;charset=ISO-8859-1. This should be just "video/mp4". How can I change this?

Thanks,
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Reply | Threaded
Open this post in threaded view
|

Re: Psuedo video streaming with item attachment and seeking enabled

helix84
On Tue, Jun 18, 2013 at 7:31 PM, Sara Amato <[hidden email]> wrote:
> I notice in the VTech example, following the
> link
> http://vtechworks.lib.vt.edu/bitstream/handle/10919/18426/S11L1U0024h_qtp.mp4?sequence=3
> actually plays the video.

$ wget --server-response
"http://vtechworks.lib.vt.edu/bitstream/handle/10919/18426/S11L1U0024h_qtp.mp4?sequence=3"
--2013-06-19 10:15:22--
http://vtechworks.lib.vt.edu/bitstream/handle/10919/18426/S11L1U0024h_qtp.mp4?sequence=3
Resolving vtechworks.lib.vt.edu (vtechworks.lib.vt.edu)... 128.173.127.96
Connecting to vtechworks.lib.vt.edu
(vtechworks.lib.vt.edu)|128.173.127.96|:80... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Date: Wed, 19 Jun 2013 08:15:22 GMT
  Set-Cookie: JSESSIONID=62C0449028B6DB15AFCE71002D2F11A5; Path=/
  X-Cocoon-Version: 2.2.0
  Vary: User-Agent
  Last-Modified: Wed, 14 Nov 2012 20:46:11 GMT
  Expires: Wed, 19 Jun 2013 09:15:22 GMT
  Accept-Ranges: bytes
  Content-Type: video/mp4
  Content-Length: 14010976
  Connection: close
Length: 14010976 (13M) [video/mp4]
Saving to: `S11L1U0024h_qtp.mp4?sequence=3'


Confirming Jonathan's observation, this returns Content-Type: video/mp4


> <video src="/xmlui/bitstream/handle/10177/62/Knopf.mp4?sequence=1"
> width="320" height="240" controls="" autobuffer="" />
>
> the video does not play.  If I go to the link directly, it downloads the
> video rather than playing.

I couldn't verify this assumption on your repository, because it
doesn't contain the mp4 bitstream (anymore?):

http://libmedia.willamette.edu/xmlui/metadata/handle/10177/62/mets.xml


Regards,
~~helix84

Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Reply | Threaded
Open this post in threaded view
|

Re: Psuedo video streaming with item attachment and seeking enabled

Keith Gilbertson-2
In reply to this post by Sara Amato
Sara, 

We're still running DSpace 1.8.2 here. We're going to the DSpace 3 update sometime this year. We'll need to update and fix our code, and I think that the intern we have here now will take more meticulous notes about how this customization works. He's good about that.


I do remember that there is a dspace.cfg parameter:
xmlui.content_disposition_threshold = 8388608

Keeping this set to zero (not -1) was part of getting things to work. We have a custom BitstreamReader from 1.7 that fixes some bugs in that partial download code, but it hasn't been properly integrated with the newer versions of DSpace yet.f

I can pass along notes from our upgrade to DSpace 3.2 later this summer.

--keith



On Tue, Jun 18, 2013 at 1:31 PM, Sara Amato <[hidden email]> wrote:
I'm trying to get this working in xmlui, and find that while I can get the proper looking code on the page, e.g. 

<video src="/xmlui/bitstream/handle/10177/62/Knopf.mp4?sequence=1" width="320" height="240" controls="" autobuffer="" />

the video does not play.  If I go to the link directly, it downloads the video rather than playing.  I notice in the VTech example, following the link
actually plays the video.

I'm guessing that I missed a step somewhere.  All I've done is edit the item-view.xsl  and uncommented the partial download code in the BitstreamReader.  

Any advice appreciated. 




On May 31, 2013, at 1:24 AM, Jonathan Freesbay wrote:

Hi,

It looks like it only works in Firefox. In IE I get "Invalid source". The same file works in other static web servers. Looking at the content type, I got video/mp4;charset=ISO-8859-1. This should be just "video/mp4". How can I change this?

Thanks,
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Reply | Threaded
Open this post in threaded view
|

Re: Psuedo video streaming with item attachment and seeking enabled

Sara Amato
In reply to this post by helix84
I should have mentioned that I am trying this on a test server, behind a firewall so could not provide a direct example.   Here's what wget says:

dspace:~> wget --server-response http://libtest-1.willamette.edu/xmlui/bitstream/handle/10177/62/Knopf.mp4?sequence=1
--2013-06-19 10:27:16--  http://libtest-1.willamette.edu/xmlui/bitstream/handle/10177/62/Knopf.mp4?sequence=1
Resolving libtest-1.willamette.edu... 158.104.100.29
Connecting to libtest-1.willamette.edu|158.104.100.29|:80... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Date: Wed, 19 Jun 2013 17:27:16 GMT
  Server: Apache-Coyote/1.1
  X-Cocoon-Version: 2.2.0
  Vary: User-Agent
  Last-Modified: Wed, 12 Jun 2013 16:01:03 GMT
  Expires: Wed, 19 Jun 2013 18:27:16 GMT
  Content-Type: video/mp4;charset=ISO-8859-1
  Content-Language: en-US
  Content-Length: 704016273
  Set-Cookie: JSESSIONID=75019D1168F83C09153BC0FCFF319E22; Path=/xmlui
  Connection: close
Length: 704016273 (671M) [video/mp4]
Saving to: “Knopf.mp4?sequence=1.1”

which looks, to my eye, similar to the vetch response.

Keith, thanks for the heads up about the xmlui.content_disposition_threshold   .  I was unaware of that setting.  I tried setting it to 0 and when that didn't seem to have any effect to -1, but still no luck. I'll be interested to hear how the upgrade to 3.2 works out.   It would be lovely if the modifications to support <video> could become part of the code.    


On Jun 19, 2013, at 1:17 AM, helix84 wrote:

> On Tue, Jun 18, 2013 at 7:31 PM, Sara Amato <[hidden email]> wrote:
>> I notice in the VTech example, following the
>> link
>> http://vtechworks.lib.vt.edu/bitstream/handle/10919/18426/S11L1U0024h_qtp.mp4?sequence=3
>> actually plays the video.
>
> $ wget --server-response
> "http://vtechworks.lib.vt.edu/bitstream/handle/10919/18426/S11L1U0024h_qtp.mp4?sequence=3"
> --2013-06-19 10:15:22--
> http://vtechworks.lib.vt.edu/bitstream/handle/10919/18426/S11L1U0024h_qtp.mp4?sequence=3
> Resolving vtechworks.lib.vt.edu (vtechworks.lib.vt.edu)... 128.173.127.96
> Connecting to vtechworks.lib.vt.edu
> (vtechworks.lib.vt.edu)|128.173.127.96|:80... connected.
> HTTP request sent, awaiting response...
>  HTTP/1.1 200 OK
>  Date: Wed, 19 Jun 2013 08:15:22 GMT
>  Set-Cookie: JSESSIONID=62C0449028B6DB15AFCE71002D2F11A5; Path=/
>  X-Cocoon-Version: 2.2.0
>  Vary: User-Agent
>  Last-Modified: Wed, 14 Nov 2012 20:46:11 GMT
>  Expires: Wed, 19 Jun 2013 09:15:22 GMT
>  Accept-Ranges: bytes
>  Content-Type: video/mp4
>  Content-Length: 14010976
>  Connection: close
> Length: 14010976 (13M) [video/mp4]
> Saving to: `S11L1U0024h_qtp.mp4?sequence=3'
>
>
> Confirming Jonathan's observation, this returns Content-Type: video/mp4
>
>
>> <video src="/xmlui/bitstream/handle/10177/62/Knopf.mp4?sequence=1"
>> width="320" height="240" controls="" autobuffer="" />
>>
>> the video does not play.  If I go to the link directly, it downloads the
>> video rather than playing.
>
> I couldn't verify this assumption on your repository, because it
> doesn't contain the mp4 bitstream (anymore?):
>
> http://libmedia.willamette.edu/xmlui/metadata/handle/10177/62/mets.xml
>
>
> Regards,
> ~~helix84
>
> Compulsory reading: DSpace Mailing List Etiquette
> https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Reply | Threaded
Open this post in threaded view
|

Re: Psuedo video streaming with item attachment and seeking enabled

helix84
On Wed, Jun 19, 2013 at 7:32 PM, Sara Amato <[hidden email]> wrote:
>   Content-Type: video/mp4;charset=ISO-8859-1

Because this seems to be the problem, removing ";charset=ISO-8859-1"
using mod_headers [1] could if not solve the problem, at least confirm
that this is the only thing that causes the problem.

[1] http://httpd.apache.org/docs/current/mod/mod_headers.html


Regards,
~~helix84

Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Reply | Threaded
Open this post in threaded view
|

Re: Psuedo video streaming with item attachment and seeking enabled

Sara Amato
I tried to modify the Content-Type header with mod-headers, but it appears that can't be done, even when I tried it in 'early' mode:

http://httpd.apache.org/docs/current/mod/mod_headers.html:
"... it is possible to set and/or override most headers, except for those headers added by the HTTP header filter, such as Content-Type."

I'm guessing there must be somewhere in the dspace code that sets the Content-type in the response header to include a charset, but can't seem to find where that is.

On Jun 19, 2013, at 12:58 PM, helix84 wrote:

> On Wed, Jun 19, 2013 at 7:32 PM, Sara Amato <[hidden email]> wrote:
>>  Content-Type: video/mp4;charset=ISO-8859-1
>
> Because this seems to be the problem, removing ";charset=ISO-8859-1"
> using mod_headers [1] could if not solve the problem, at least confirm
> that this is the only thing that causes the problem.
>
> [1] http://httpd.apache.org/docs/current/mod/mod_headers.html
>
>
> Regards,
> ~~helix84
>
> Compulsory reading: DSpace Mailing List Etiquette
> https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette