How to stream MP4 files from subdirectories with Flowplayer? - flowplayer

I am using Wowza Media Server to enable streaming of MP4 files and as video player I use Flowplayer.
To get some structure for my content I use sub directories within the configured StorageDir for my Wowza application.
The problem I have is that no matter what URL-format I use, Wowza keep looking for the file in the root storage directory.
I've tried using the URL format specified by Wowza here, but with no luck:
rtmp://[wowza-ip-address]/myapp/_definst_/mp4:mysubdirectory/sample.mp4
I also tried everything suggested in posts on the Wowza forum:
https://www.wowza.com/community/questions/327/mp4-streaming-from-application-sub-directory.html
https://www.wowza.com/community/questions/215/subfolders-in-application-content-folder.html
But Wowza keeps looking in the root storage directory, throwing exceptions like these:
404 b0c9be70-a33c-41ce-9692-199e3a1caccf.mp4
open: java.io.FileNotFoundException:
C:\Program Files (x86)\Wowza Media Systems\Wowza Media Server 3.6.2\content\b0c9be70-a33c-41ce-9692-199e3a1caccf.mp4.flv
(The system cannot find the file specified)
Somehow Wowza thinks it should look for an FLV file in the root storage directory, even though the URL specify that it is an MP4 file in a subdirectory. Why is that?

After spending hours looking into this, I finally found this post on the Wowza forum.
The problem:
Apparently there is an issue with some flash-based video players (like Flowplayer that I use), that accept a single string for the RTMP connection and stream name. Some of these players do not separate the RTMP connection and stream name properly when using sub directories.
When breaking this URL apart:
rtmp://[wowza-address]:1935/vod/_definst_/mp4:subfolder/sample.mp4
The player will use this as the RTMP connection:
rtmp://[wowza-address]:1935/vod/_definst_/mp4:subfolder
The player will then try to play sample.mp4 instead of subfolder/sample.mp4 which will fail.
The solution:
To remedy this problem, there is a plugin for Wowza that fixes the URL, available for download here:
http://www.wowzamedia.com/downloads/forums/collection/WowzaServerAddOnCollection.zip
Unzip the package and copy the JAR file into your Wowza /libs directory, then add this to your /conf/[app-name]/Application.xml configuration file:
<Module>
<Name>ModuleFixStreamPath</Name>
<Description>ModuleFixStreamPath</Description>
<Class>com.wowza.wms.plugin.collection.module.ModuleFixStreamPath</Class>
</Module>
Doing so got it all working for me!

I fix this problem by creating symlinks using PHP code before output video component template
$relativeVideoLink = str_replace("/", "__", $videoFileRelativePath);
if (!file_exists($wowzaDir . $relativeVideoLink)) {
symlink($wowzaDir . $videoFileRelativePath, $wowzaDir . $relativeVideoLink);
}
After creating symlink i put it to tag
<video src="http://00.00.00.00:1935/vod/mp4:<?=$relativeVideoLink?>/manifest.mpd"></video>

Related

Laravel How to download all files in a directory

Using Laravel, I am trying to make a function which would download all files in a directory from S3.
I have used to retrieve all keys of the files using $file = Storage::disk('s3')->allFiles('path');, but I do not know what to do next.
It seems like I have to download all files into local, then zip those files, then download that zip file. I would like to know if there is a better way.
Any suggestion or advice would be appreciated.
I was able to do what I wanted with this:
http://coderaweso.me/zip-and-download-files-directory-from-amazon-s3-with-laravel/
It is not possible to send more than one file simultaneously over the same request with the HTTP protocol. Laravel also does not support this. You have to pack the files in, for example, a zip file.
Install Chumper/Zipper package and return a zip containing all your files:
$files = Storage::disk('s3')->allFiles('path');
Zipper::make(public_path('test.zip'))->add($files);
return response()->download(public_path('test.zip'));

How can I avoid "Zip end of central directory signature not found (Zip::Error)" with rubyzip?

I'm reading a lot of zip file with rubyzip.
However this error message is always showing in only specific file even it is zip file.
/app/vendor/bundle/ruby/2.3.0/gems/rubyzip-1.2.1/lib/zip/central_directory.rb:143:in `get_e_o_c_d': Zip end of central directory signature not found (Zip::Error)
I guess this error occures in rubyzip.
How can I manage this error?
Here is my code.
url = 'http://example.zip'
zipfilename = open(url)
Zip::File.open(zipfilename, :allow_redirections => :all) do |zip_file|
entry = zip_file.glob("*ixbrl.htm").first
stream = entry.get_input_stream.read
puts stream
end
Thank you!
I faced this error when I try to extract data from a uploaded .xlsx file in my application. On my context, the .xlsx file was corrupted, so my solution was save the content (I usually handle the buffer file after the upload) as a csv file (in my application I dont need to worry about the file extension), fixing the content by force it to encode as utf-8, and extract it's data after it. here is a example of the code, I'm using roo-xls gem to handle .xls files and roo gem to handle .csv and .xlsx files.
I ran into the same error. Also only reproducible on Heroku. The error was fixed after I added an unzip buildpack (second, after Ruby).
https://github.com/davidlibrera/heroku-buildpack-unzip
If you're using a google docs xlsx file try checking if the access of the sheet link is public.

nReco.Video Converter ffMpeg Error

I am using Nreco Video Converter for take video thumbnail on my MVC project. App is working correctly on local but it shows error on live host
Error is
Access to the path 'C:\Inetpub\vhosts********\httpdocs\bin\ffmpeg.exe' is denied.
I did search this file in my code and host bin folder but I can't found. NReco's site says
Simple and easy to use video conversion .NET library: all you need is one assembly (FFMpeg is embedded)
There is no ffmpeg.exe file in local and host bin folder or anywhere.
How can i fix this?
Thanks.
VideoConverter is a .net wrapper for ffmpeg tool (I'm an author of this library) and ffmpeg.exe is extracted into app bin folder (default location) on first use. On your live host asp.net process cannot write to app bin folder; this may be fixed by specifying another location, for example:
var ffmpeg = new FFMpegConverter();
ffmpeg.FFMpegToolPath = System.Web.HttpContext.Current.Server.MapPath("~/App_Data");

Firefox 19.0.2 deletes proxy extension file

Working on Windows 8 64bit, Firefox 19.0.2.
I went to .../Firefox/Profiles/.../extensions and put my ekons#www.solver.ws file containing
a string
h:\myextensions\ekons\
The directory h:\myextensions\ekons\ contains install.rdf file of my extension.
Every time I restart Firefox, it deletes .../Firefox/Profiles/.../extensions/ekons#www.solver.ws file. Of course, without trying to install the extension.
Any suggestions?
Addition
I attach an image FF extensions directory.
Well, it was my mistake: extension file name was not the same as ID inside install.rdf.
Such files are silently deleted by FireFox from profile directory.
I had the same isue, the problem was an extra tag </em:description> in the install.rdf file.
When it was a valid XML all goes ok.

Got '206 Partial Content' Status on requesting webm videos from my server

I'm using XAMPP server on my MAC.
I've created a page which has a video tag on it ! (i'm using video.js framework)
The video file doesn't play, When i check it on firebug (the plugin on firefox) ,the GET operation returns '206 Partial Content' status for that file.
How can i make it work ?
Thank you for your time
The answer of longilong works great. I just want to explain how to add mime-types which i wasn't know until i had some googling.
1- create a text file named '.htaccess' in the directory of your site (the path where your pages exists)
the htaccess file is just a apache configuration file which override the main apache configurations for just that path which it resides
2- add these lines to your new .htaccess file:
# Audio
AddType audio/ogg oga ogg
AddType audio/mp4 m4a
# Video
AddType video/ogg ogv
AddType video/mp4 mp4 m4v
AddType video/webm webm
as far as i know, WebM is supported in Firefox 4+. This error also could occur, if your server is not well configured. for example if the mime-types are not added. check this post here: Playing a movie/DVD on a website .hope it helps

Resources