I have been using Wowza 3 on EC2 (Devpay AMIs with startup packages for customization). I have successfully used the built in FileMover module in conjunction with S3FS to move recordings recorded with a live-record application. When the stream ends and thus writes the recorded file, FileMover copies the file into a folder mounted to an S3 bucket. This works perfectly.
What I am trying to do now, is the same thing, except rather than recording the whole stream with a live-record application, I want to use the LiveStreamRecord module to record the stream on-demand. I have the LiveStreamRecord module working perfectly using the HttpProvider to start and stop recordings, but FileMover doesn't move the recorded files.
By my logic, it seems that FileMover should act upon files written with LiveStreamRecord in the same way that it does files written by a live-record application, but it doesn't.
I have a few suspicions as to why this may not work:
1. FileMover might only listens for files written by a live-record application, and since I am using a live application with LiveStreamRecord, FileMover doesn't recognize the recorded files, and thus doesn't move them. I've tried using LiveStreamRecord with a live-record application, but that doesn't work. In that case the whole stream is recorded, and moves successfully, but StartRecord and StopRecord calls to the HTTPProvider don't do anything.
2. The setup instructions for both Modules instruct you to add the module code as the last module in <modules> in the application.xml file. Obviously, both modules cant be last. Could this be the problem?
Again, I've gotten both modules to work, so I know they're configured properly, I just can't get them to work together.
Does anyone know if this is possible? If not, how would I go about automatically moving files recorded by the LiveStreamRecord Module to my s3 mount folder.
Here is a link to the startup package I'm using, which contains the installation and setup of the two Modules:
Scratch that, I figured out what's happening. The move is working, it was just that the FileMover isn't naming the copied file as I had expected. When using LiveStreamRecord, I was providing a custom output, say ThisCoolFile.mp4. (output=/usr/local/WowzaMediaServer/content/ThisCoolFile.mp4) I had expected that FileMover would move the file to the folder I designated (fileMoverDestinationPath=/mnt/s3), and use the filename of the file created by LiveStream record (/mnt/s3/ThisCoolFile.mp4). Instead, FileMover names the copied file as the stream name. (/mnt/s3/StreamName.mp4)
I think it's worth pointing out that this is not a logical behavior, as having FileMover name the copied file using the stream name makes the custom output option of LiveStreamRecord useless when moving files back to s3. Unless otherwise specified by the path property, it would certainly make more sense to have FileMover use the name of the file rather than the stream name.
As best I can tell, I will have use the more complicated approach of compiling a custom FileMover module in order to achieve this. (Haven't dove into extending wowza with java yet, but suppose now would be a good time)
Would you concur with my assessment? If so any advice in getting started with this approach would be helpful. I've installed the Wowza IDE.
This is how it works, if content is in subfolder the path is part of the stream name. You put any prefix in front of the path (mp4:subfolder/sample.mp4). If you enter a path with a stream name in a live encoder Wowza will create that location and record the file there.
Thanks for your help. I may not have been entirely clear.
My concern is not with controlling the name of a file created by the live-record application, but attaining granular control of files that are created as a result of a move operation executed by FileMover.
For example, regardless of what the name of the stream is, I need to be able to create recordings with a custom name (using the LiveStreamRecordModule, and the HTTPProvider that goes with it.), and have them moved by FileMover to my s3 mount point with the name I assigned when sending the startRecord command to LiveStreamRecord via the httpprovider. Here's what happens now step by step
1. I'm encoding a live stream using stream name: mp4:StreamName.
2. I send a startRecord command via the httpProvider: "http://[wowzaserver]:8086/livestreamrecord?app=[appName]&streamname=StreamName&action=startRecording&format=2&output=/usr/local/WowzaMediaServer/content/mycoolvideo.mp4"
5. FileMover moves the file to my s3 mount point, but the path is:
.....what I would expect to see (or need to achieve in any case)......
In other words, FileMover uses the stream name when moving content, rather than the actual filename. In my application, I am creating a very large number of video files on a number of servers in a given day. Without the ability to control these names at the server level, it's impossible to distinguish these files or predict what their names will be.
Thanks. I'm gunna be learning this business of custom java development for Wowza from scratch. Is the code for the example module identical to the built in FileMover module? It there a way to get the full source for the built in FileMover module? This would make it easier to build out my custom module, so I can see exactly what is going on.
Right. I see that. I was referring to the source for the built-in FileMover module, as it currently functions.
The code in the post seems to be just the event listener, and does not appear to have the actual move file code. I am just curious as to what the code looks like that does the move in the built in listener.