Note that there are some explanatory texts on larger screens.

plurals
  1. POCustomize stream playback paths in Red5 to access file from a shared machine
    primarykey
    data
    text
    <p>I have installed Red5 server. I have created a custom application same as oflaDemo. I am able to play videos in /streams folder of my application, my application name is demo.I want to change the directory RED5_HOME/demo/webapps/streams from which my application is accessing videos, to a folder in a shared machine. I am able to change to a directory in local machine, for example "c:\streams". I have achieved this using CustomFileNameGenerator implementing IStreamFilenameGenerator . But I am not able to access a shared folder. Here is my CustomFileNameGenerator class</p> <pre><code> import java.io.File; import org.apache.log4j.Logger; import org.red5.server.api.scope.IScope; import org.red5.server.api.stream.IStreamFilenameGenerator; public class CustomFilenameGenerator implements IStreamFilenameGenerator { Logger log = Logger.getLogger(CustomFilenameGenerator.class); /** Path that will store recorded videos. */ /public String recordPath = "recordedStreams/";/ /** Path that contains VOD streams. */ public String playbackPath; /** Set if the path is absolute or relative */ public Boolean resolvesAbsolutePath; 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 = null; if (type == GenerationType.PLAYBACK) { filename = playbackPath + name; } log.info("file Name " + filename); if (extension != null) // Add extension filename += extension; log.info("Extension and file name " + filename); return filename; } public boolean resolvesToAbsolutePath() { log.info("resolvesAbsolutePath" + resolvesAbsolutePath); return resolvesAbsolutePath; } public void setPlaybackPath(String playbackPath) { this.playbackPath = playbackPath; } public void setResolvesAbsolutePath(Boolean resolvesAbsolutePath) { this.resolvesAbsolutePath = resolvesAbsolutePath; } } </code></pre> <p>Following are properties in my red5-web.properties file:</p> <pre><code> webapp.contextPath=/demo webapp.virtualHosts=*, 192.168.1.20, 192.168.1.20:8088, 127.0.0.1:8088, 192.168.1.20:1935 playbackPath=C://streams/ resolvesAbsolutePath=true </code></pre> <p>Following is the bean definition in my red5-web.xml file</p> <pre><code> &lt;bean id="streamFilenameGenerator" class="com.abhinow.demo.CustomFilenameGenerator" &gt; &lt;property name="playbackPath" value="${playbackPath}" /&gt; &lt;property name="resolvesAbsolutePath" value="${resolvesAbsolutePath}" /&gt; &lt;/bean&gt; </code></pre> <p>The above given code is working fine and I am able to playback video in C:\streams folder, but when I have changed the playback path to a shared folder like /192.168.1.20/streams it is not working. I am using windows computer. I have also tried by mapping shared folder /192.168.1.20/streams to a network drive using map network drive feature in windows and gave name to that drive as Z:. Then I have tried by giving the path Z://streams Now also it is not working. Any one please help where I am getting it wrong. I have been struggling on it for two days. Please help me to solve this issue.</p> <p>Thanks a lot in advance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload