I have made an streamFileGenerator based on the example made by Joachmin.
package nl.blueberry.streamer;
import org.red5.server.api.IScope;
import org.red5.server.api.stream.IStreamFilenameGenerator;
import nl.blueberry.data.QueryManager;
import java.io.*;
import java.util.Properties;
public class FilenameGenerator implements IStreamFilenameGenerator {
/** Path that will store recorded videos. */
public String recordPath = "";
/** Path that contains VOD streams. */
public String playbackPath = "";
Properties props = new Properties();
private String getStreamDirectory(IScope scope) {
if ( recordPath.equals("") ) {
resolveDirectory();
}
return recordPath;
}
private void resolveDirectory(){
try{
props.load(new FileInputStream("db.properties"));
recordPath = props.getProperty("path.record");
playbackPath = props.getProperty("path.playback");
}catch (Exception e) {
// TODO: handle exception
System.out.println("Loading Properties: db.properties failed");
System.out.println("Exception: " + e.getMessage());
}
}
public String generateFilename(IScope scope, String name, GenerationType
type) {
// Generate filename without an extension.
String filename = generateFilename(scope, name, null, type);
System.out.println ( "generateFilename: "+filename);
return filename;
}
public String generateFilename(IScope scope, String name,
String extension, GenerationType type) {
String filename;
if ( recordPath.equals("") ) {
resolveDirectory();
}
if (type == GenerationType.RECORD)
filename = recordPath + name;
else
filename = playbackPath + name;
if (extension != null) // Add extension
filename += extension;
System.out.println ( "generateFilename: "+filename);
return filename;
}
}
The data is parsed correctly but somehow the video isn't displayed. I cannot
find where Red5 accually is accessing the file
Any idea
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org