Author |
|
Carlos27
Joined: 09 Jul 2012 Posts: 8 Location: US, NYC
|
Posted: Mon 20 Jul '15 14:26 Post subject: Apache http streaming: direct links to external vod files |
|
|
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
|
Posted: Mon 20 Jul '15 16:52 Post subject: |
|
|
You can use mod rewrite. |
|
Back to top |
|
Carlos27
Joined: 09 Jul 2012 Posts: 8 Location: US, NYC
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Fri 24 Jul '15 17:58 Post subject: |
|
|
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
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Mon 03 Aug '15 16:38 Post subject: |
|
|
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
|
Posted: Mon 03 Aug '15 17:16 Post subject: |
|
|
Changed it as you suggested.
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
|
Posted: Mon 03 Aug '15 21:08 Post subject: |
|
|
Can you please post the content of the m3u8 file? |
|
Back to top |
|
Carlos27
Joined: 09 Jul 2012 Posts: 8 Location: US, NYC
|
Posted: Tue 04 Aug '15 15:28 Post subject: |
|
|
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
|
Posted: Wed 05 Aug '15 18:04 Post subject: |
|
|
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
|
Posted: Mon 10 Aug '15 17:10 Post subject: |
|
|
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
|
Posted: Mon 10 Aug '15 17:37 Post subject: |
|
|
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 |
|