Hi,
Im trying to create the following module:
-
record incoming {livestreamname} to {livestreamname}_temp.mp4 file, send notification to external app “recoring started for {livestreamname}”
-
when incoming {livestreamname} has stoped, save/move recorded copy to {livestreamname}.mp4, notify external app
-
repeat
the ModuleAutoRecordAdvancedExample has been of great help and I’m using it as a base, but there is an issue that i can not figure out:
I’ve noticed that the module will only ever use the first livestream streamname for all upcoming streams. The only thing different to the recorded copy filename is the timestamp. It doesn’t matter that the name of the livestream has changed, as it only ever uses the first streamname since applicationstart.
Could some one point me to how I would change this behaivor so that it uses the current streams name as the filename for storing?
sorry for the bump, am i going at this wrong?
I have exactly the same problem. I took ModuleAutoRecordAdvancedExample as a base, and having problem with streams written to the wrong file. It looks for me like a problem of using a shared resource in a multithread application, here is a log output:
Log call in onStopRecorder:
getLogger().info(“LiveStreamRecorder.onStopRecorder: Recording stopped:” + recorder.getStreamName() + " " + recorder.getFilePath() + " " + params.outputFile);
Actual log output:
INFO server comment - LiveStreamRecorder.onStopRecorder: Recording stopped:mystreamtest_240p D:\Java\Wowza\content\mystreamtest_360p.mp4 mystreamtest_720p.mp4
So, as you may see from log statement recorder.getStreamName(), recorder.getFilePath() and params.outputFile are in inconsistent state. Should not be a recorder and params instances thread-safe and created on per stream basis?
For those who might be interested by the topic, and hope this will save some precious hours.
My idea was to record selected (not all) streams by appending streams to existing files with the same stream name without breaking files into segments and creating versions.
First I tried LiveStreamRecordAutoRecord example, which I believed could record all the streams with SEGMENT_NONE and APPEND_FILE options set. Unfortunately, I had catastrofic issues with streams (transcoded) written either to the same base stream file location or to a wrong file location, e.g. 720p could be written to 160p. Having spent a entire day, I could not find out how to resolve the issue with parameters tuning or custom listener (see my log output in the post above). Also, I did not find the way to filter which streams to record and which not to. Luckily, LiveStreamRecordExampleModule did solve some problems as it shows record control on stream level rather then on app instance level. However, still not sure if streams appending to existing files handled properly by wowza, as I see some warnings in console and source stream playing issues (not transcoded one).
This example did not work for me:
How to start and stop live stream recordings programmatically (LiveStreamRecordAutoRecord example).
This one works as expected:
Download LiveStreamRecordExampleModule_4.0.zip
Sorry for asking another question.
But did either of you guys solve the problem of retrieving the recording file from the wowza server? Wowza doesn’t serve up .mp4 files; Add to that if you copy it to another server straight after wowza has notified your module, then the file may not have been completely written to disk by wowza.
Hey rynkan,
Did you ever figure out a solution? I have the exact same problem and would like to know how to fix it. Can you paste the source code or give any guidance?