Red5目前不能自己设定Stream目录,必须手动修改JAVA程序来实现.你看到的文档就是详细的修改方法了
以上文章的大体流程如下:
1.首先你需要有一个名为CustomFilenameGenerator的类文件,这个文件可以和你的Application放同个目录,内容如下复制内容到剪贴板代码:
import org.red5.server.api.IScope;
import org.red5.server.api.stream.IStreamFilenameGenerator;
public class CustomFilenameGenerator implements IStreamFilenameGenerator {
/** Path that will store recorded videos. */
public String recordPath = "recordedStreams/";
/** Path that contains VOD streams. */
public String playbackPath = "videoStreams/";
public String generateFilename(IScope scope, String name,
GenerationType type) {
// Generate filename without an extension.
return generateFilename(scope, name, null, type);
}
public String generateFilename(IScope scope, String name,
String extension, GenerationType type) {
String filename;
if (type == GenerationType.RECORD)
filename = recordPath + name;
else
filename = playbackPath + name;
if (extension != null)
// Add extension
filename += extension;
return filename;
}
}