mp4 streaming from application sub directory?

I am unable to stream mp4 and mp3 content from directories which are sub directories of my applications Streams > StorageDir, not matter what I try to do with the paths.

Our application generates massive amounts of content and requires the content to be organised in sub directories rather than simply stored in the root of the applications content directory.

Some background.

For testing I am using the CS3 FLVPlayback component.

My applications My Streams > StorageDir is set to /echo360

I am able to stream mp4 content that exists within the root of application content directory by simply pre-pending mp4: to the filename

ie,

rtmp://localhost/echo360/mp4:vga01.mp4

And I am able to stream flv content from a sub directory by using definst in the path

ie,

rtmp://localhost/echo360/definst/dev/vga03.flv

However all of the following fail.

rtmp://localhost/echo360/definst/dev/mp4:vga02.mp4

ERROR server comment - MediaReaderFactory: getInstance: Missing definition for dev/mp4

rtmp://localhost/echo360/dev/definst/mp4:vga02.mp4

ERROR server comment - MediaReaderFactory: getInstance: Missing definition for definst/mp4

rtmp://localhost/echo360/mp4:definst/dev/vga02.mp4

I even tried dropping the file extension from the call to the file and these fail too.

rtmp://localhost/echo360/definst/dev/mp4:vga02

rtmp://localhost/echo360/dev/definst/mp4:vga02

rtmp://localhost/echo360/mp4:definst/dev/vga02

Any suggestions to resolve this problem without storing everything in the root of the applications content directory will be much appreciated :slight_smile:

Take a look at NTFS junctions:

http://en.wikipedia.org/wiki/NTFS_junction_point

Charlie

Check this post out, see if it helps:

http://community.wowza.com/t/-/226

I am going to guess that the Application.xml is in the wrong folder. The Application.xml file should be in:

[install-dir]/conf/[application]/Application.xml

It will not be read if it is in:

[install-dir]/applications/[application]/Application.xml

If you still can’t sort this out zip up conf and logs folder and send to support@wowza.com.

Charlie

This is a great write-up. I’m having the same problem and your instructions get me a lot closer to a solution. Thanks!

What about us poor souls in Windows, though? We can’t use symbolic links to map directories in /Applications to a centralized network location. What are my options if I want both subdirectory access and all my video to be located somewhere other than my Wowza server?

In Windows you can use UNC path or mapped drive in Application.xml /Streams /StorageDir.

Richard

Sure, I do that with other projects, but I thought the gotcha here was that subdirectories didn’t work if StorageDir was filled out. Am I reading that wrong? (Totally possible - I’ve been at this for hours and I’m fried.)

Take a look at NTFS junctions:

http://en.wikipedia.org/wiki/NTFS_junction_point

Charlie

Nifty! Thanks!

This is a great write-up. I’m having the same problem and your instructions get me a lot closer to a solution. Thanks!

What about us poor souls in Windows, though? We can’t use symbolic links to map directories in /Applications to a centralized network location. What are my options if I want both subdirectory access and all my video to be located somewhere other than my Wowza server?

Update: It seems like one level of subdirectories works for me but two doesn’t.

In a nutshell, I can stream this video:

/applications/myapp/streams/topdir/file.f4v

but not:

/applications/myapp/streams/topdir/bottomdir/file.f4v

This second option generates a Java.io.FileNotFoundException saying that /applications/myapp/streams/topdir/file.f4v can’t be found. “bottomdir” is absent from the error message.

I’m using JW Player 4.5, Wowza 1.5.3, if either of those things figure in the equation.

Richard, thanks for your help. I was tacking the subdirectories on the end of my streamer variable, not the front of my file variable. Now things are working as they should.

You rock!

What is in StorageDir?

Richard

It was //server/proxy/collection/project.

I was putting the subdirectory stuff in the wrong place - thanks for helping me figure that out!

If you have Flash player 9.0.124, it could be this problem, which is under re-development:

https://www.wowza.com/forums/showthread.php?t=1223

Have you tried using an absolute path for storageDir?

I’m not sure, but I think definst is only meaningful if storageDir is blank.

Also, if you leave storageDir blank, then content will be stored in:

wowza_install/applications/yourApp/streams/someInstance/someStream.flv

…which is another way to organize content.

Right, that is absolute – I was thinking windows server (pre-coffee).

It’s confusing because appInstance and sub-directory look similar. Which is which is not obvious. For myself, if I want to organize content I use blank in storageDir, and if I want to centralize content I use a path in storageDir.

that’s great, I’m glad I could help

In Windows you can use UNC path or mapped drive in Application.xml /Streams /StorageDir.

Richard

You can use subdirectories with StorageDir not empty. For example:

//server1/content

With a video located here:

server1/content/folder1/video.flv

The stream (or file in JW Player) would be:

folder1/video.flv

Other players might need something like this, and you must have a appInstance part:

rtmp://wowzaIP/simplevideostream/definst/folder1/video.flv

Richard

What is in StorageDir?

Richard

To debug this, it is very helpful to look at the Wowza logs to see where Wowza is looking for the video.

Using your example:

rtmp://server.ip/musicStreaming/music/test

if you make Application.xml /Streams /StorageDir empty, Wowza will look for the video (in your case) here:

[wowza-install-dir]/applications/musicStreaming/streams/music/test

“music” is the ApplicationInstance, and it is part of the physical path in the case where StorageDir is empty.

It would work a little differently if you StorageDir is not empty, for example:

C:\content

Using the same rtmp url:

rtmp://server.ip/musicStreaming/music/test

Wowza would look here:

c:\content\test

ApplicationInstance in this case is not part of the physical location.

Richard

Not sure, but this is what you were doing wrong:

… created a symbolic link from music library to the /applications/musicStreaming/sharedobjects/music folder

I’ve copied a file test.m4a into root of this folder

Richard