logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache http streaming: direct links to external vod files
Author
Carlos27



Joined: 09 Jul 2012
Posts: 8
Location: US, NYC

PostPosted: Mon 20 Jul '15 14:26    Post subject: Apache http streaming: direct links to external vod files Reply with quote

I have added external storage to an Apache/FMS http streaming server and would like to have direct links to the files stored on this external drive. The files stored in the internal webroot/vod folder can be directly accessed from http://server-ip-address/hls-vod/movie.mov and the external vod files can be streamed from http://ipaddress/hls-vod2/movie.mov.m3u8, but I need to configure the Apache server to provide direct links to these external vod files (http://ipaddress/hls-vod2/movie.mov) so that our users can download them. How can I do this?

I have also posted this question on Adobe's forums here:
https://forums.adobe.com/thread/1904337

Thanks
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 20 Jul '15 16:52    Post subject: Reply with quote

You can use mod rewrite.
Back to top
Carlos27



Joined: 09 Jul 2012
Posts: 8
Location: US, NYC

PostPosted: Thu 23 Jul '15 17:58    Post subject: Reply with quote

http://httpd.apache.org/docs/2.0/misc/rewriteguide.html :"The price you have to pay is to accept complexity, because mod_rewrite's major drawback is that it is not easy to understand and use for the beginner."

Needless to say, I am couple of levels below a beginner. So, if the external drive/folder is at G:\vod\media\ how can I get Apache to see them as http://ipadresss/vod/media/files.mov?

Would this work instead (when not to use mod_rewrite)?
http://httpd.apache.org/docs/2.4/rewrite/avoid.html



Thank you for pointing me in the right direction. I'll read the manual and hopefully I can figure it out.

Danke
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Fri 24 Jul '15 17:58    Post subject: Reply with quote

not tested but this should work

Code:

RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^\/hls-vod2\/(.*)$ /hls-vod2/$1
Back to top
Carlos27



Joined: 09 Jul 2012
Posts: 8
Location: US, NYC

PostPosted: Mon 03 Aug '15 15:21    Post subject: Reply with quote

I added the following to the httpd.conf file and made sure that mod_rewrite was uncommented:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^\/hls-vod2\/(.*)$ /hls-vod2/$1
</IfModule>

http streaming of the files works (iOS/Safari): http://server-ip-address/hls-vod2/5K-Run-2006_800kbps.mov.m3u8

The direct link does not: http://server-ip-address/hls-vod2/5K-Run-2006_800kbps.mov

Did I do something wrong?

Thanks for the help/patience.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 03 Aug '15 16:38    Post subject: Reply with quote

Sorry I made a mistake using copy and paste with the 2

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^\/hls-vod\/(.*)$ /hls-vod2/$1
</IfModule>

However

http://server-ip-address/hls-vod2/5K-Run-2006_800kbps.mov

if you put that directly into the browser of your desktop, what happens? Download or stream?

If it downloads you have set the correct mime type.
Back to top
Carlos27



Joined: 09 Jul 2012
Posts: 8
Location: US, NYC

PostPosted: Mon 03 Aug '15 17:16    Post subject: Reply with quote

Changed it as you suggested.

James Blond wrote:
Sorry I made a mistake using copy and paste with the 2

http://server-ip-address/hls-vod2/5K-Run-2006_800kbps.mov

if you put that directly into the browser of your desktop, what happens? Download or stream?


It does neither (File not Found/404 error). Still streams via http though so the FMS server is set up properly to do that. Requires the .m3u8 designation after .mov to stream, but the file itself is inaccessible.

I might give up. Thanks for your help.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 03 Aug '15 21:08    Post subject: Reply with quote

Can you please post the content of the m3u8 file?
Back to top
Carlos27



Joined: 09 Jul 2012
Posts: 8
Location: US, NYC

PostPosted: Tue 04 Aug '15 15:28    Post subject: Reply with quote

James Blond wrote:
Can you please post the content of the m3u8 file?


The .m3u8 designation tells the FMS server to use the http module to stream the file, so it is not a manifest file and is only there to let the server know how to stream/package it. So the file with the .m3u8 link is the video file that is on the external drive (outside of the Apache webroot folder, e.g., http://server-ip-address/hls-vod2/5K-Run-2006_800kbps.mov, but that doesn't work as a direct link). Trying to access the file directly results with a 404 error in the browser and shows up as such in the logs.

Does that make sense? I hope I explained it correctly.

Thanks for hanging in with me.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Wed 05 Aug '15 18:04    Post subject: Reply with quote

The FMS server seems to work very different to usual apache. Cause an m3u8 file should contain only a list of links. Is there a rewrite rule for the m3u8 file?
Back to top
Carlos27



Joined: 09 Jul 2012
Posts: 8
Location: US, NYC

PostPosted: Mon 10 Aug '15 17:10    Post subject: Reply with quote

James Blond wrote:
Is there a rewrite rule for the m3u8 file?


Rewrite was commented before I tried your suggestion and there is no rule for .m3u8 files. This seems to be a regular Apache 2.2 server with FMS modules added for video streaming, so accessing the files on the external drive via http should work normally.

Can I PM you a link so that you can try it? Server is under contact attacks/probes so I don't want to post the IP here.

Thanks
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 10 Aug '15 17:37    Post subject: Reply with quote

You can send Steffen an email you find the adress at http://www.apachelounge.com/contact.html cause this forum doesn't offer PM. he will forward your mail to me.
Back to top


Reply to topic   Topic: Apache http streaming: direct links to external vod files View previous topic :: View next topic
Post new topic   Forum Index -> Apache