[Red5] change default folder streams
RTG RTG
rtgrtgrtg at googlemail.com
Thu Aug 14 17:30:16 PDT 2008
Mehmet, what is your project structure, something oflaDemo similar?
And why to restart several times :-), this is sort of strange....
I had similar path playbackPath=E:/data/music/
and the result is still
2008-08-14 22:30:06,925 [pool-4-thread-6] DEBUG
o.r.s.webapp.oflaDemo.DemoService
- getting the FLV files
2008-08-14 22:30:06,940 [pool-4-thread-6] ERROR
o.r.s.webapp.oflaDemo.DemoService - {}
java.io.FileNotFoundException: ServletContext resource [/E:/data/music/]
cannot be resolved to URL because it does not exist
But it does exists.
This is however not the trunk. but a freeze I did by mid of may. Might be
that something has been fixed, changed since that time.
Just wondering which release you are running on...
RTG
2008/8/15 Mehmet Sen <senmehmet80 at gmail.com>
>
> Now, it works, I can set external drive point
>
> I did set:
>
> playbackPath=F:/videoStreams/
>
> But it worked after I restarted Red5 several times
>
> Mehmet
>
>
>
> On Thu, Aug 14, 2008 at 6:34 PM, Mehmet Sen <senmehmet80 at gmail.com> wrote:
>
>> This custom directory issue is so weird, I read all of the tutorial and
>> did exactly the same things but I can not even show a directory under
>> streams.
>>
>> let's assume I have 'videoStreams' folder under stream
>>
>> in my red5-web.xml file I have the following configuration:
>>
>> <bean id="streamFilenameGenerator"
>> class="com.custom.CustomFilenameGenerator" >
>> <property name="recordPath" value="${recordPath}" />
>> <property name="playbackPath" value="${playbackPath}" />
>> </bean>
>>
>>
>> and in my red5-web.properties file:
>>
>> recordPath=recordedStreams/
>> playbackPath=videoStreams/
>>
>>
>> so I call my actionscript: ns.play("rtmp://localhost/myplayer/film.flv");
>>
>> Here I assume that the configuration will see automatically the folder
>> videoStreams
>>
>> but I have always call it
>>
>> ns.play("rtmp://localhost/myplayer/videoStreams/film.flv");
>>
>> and this runs, but it doesn't make sense because I wanna to have my
>> application see the videoStreams folder from configuration
>>
>> Why does the application always see the streams folder and not recognize
>> the configuration?
>>
>>
>>
>>
>>
>> On Thu, Aug 14, 2008 at 6:20 PM, Andy Shaules <bowljoman at hotmail.com>wrote:
>>
>>> THe easiest and I mean easiest way is via client connect scope. it will
>>> be the folder.
>>> It is extremely easy to set up recorders and players which use simple php
>>> post/get and address to produce fantastic results.
>>>
>>> tranfer from
>>>
>>> broadcast.php?user=joe&stream=live&topic=sex&record=true
>>>
>>> to
>>>
>>> broadcast.swf?user=joe&stream=live&topic=sex&record=true (use flashvars
>>> though)
>>>
>>> then in as3 , from USER=Application.application.parameters.user
>>>
>>> nc.connect("rtmp://"+IP+"/"+TOPIC+"/"+USER);
>>>
>>> ns.publish(TITLE)
>>>
>>> Of course use encodeURI so that users can include spaces in the titles
>>> and not cause errors on things like shared objects and the web address,
>>> which cant have ' ' in the name.
>>>
>>> TO play do the same fo rthe subscriber.
>>>
>>>
>>>
>>> ----- Original Message -----
>>> *From:* Daniel Rossi <spam at electroteque.org>
>>> *To:* red5 at osflash.org
>>> *Sent:* Thursday, August 14, 2008 3:53 PM
>>> *Subject:* Re: [Red5] change default folder streams
>>>
>>> I had no idea 2K3 had such a tool, i've used junction in the past which
>>> are hardlink paths.
>>> On 15/08/2008, at 8:43 AM, Manuel R.G. wrote:
>>>
>>> In your IStreamFilenameGenerator implementation have you forced method
>>> resolvesToAbsolutePath() to return true?
>>>
>>> Other posible solution for windows could be using linkd.exe (from windows
>>> resource kit rktools).
>>> It can create symbolic links (like linux ln) or something similar so
>>> red5's streams/aaa/bbb could point to E:/some/streams/another/folder/aaa/bbb
>>>
>>> I used it once and it worked for me.
>>>
>>> It's included in 2003 server rktools (originally made by sysinternals i
>>> believe)
>>>
>>> For the dynamic paths an easy solution could be generating the dynamic
>>> path on the client if it fits your needs, like:
>>>
>>> ns.play(theFolder+"/"+theStream);
>>>
>>>
>>>
>>>
>>> 2008/8/14 RTG RTG <rtgrtgrtg at googlemail.com>
>>>
>>>> Hi Manuel,
>>>> thank you for your reply first!
>>>>
>>>> yeah this tutorial I started with so far, but for some reason it adds a
>>>> "/" before the path.
>>>>
>>>>
>>>> 1. I took the oflaDemo implemented the IStreamFilenameGenerator as
>>>> CustomFilenameGenerator put the propertis E:/data/music
>>>> 2. and in the demo service changed the pathThing
>>>> log.debug("getting the FLV files");
>>>> Resource[] flvs =
>>>> scope.getResources(CustomFilenameGenerator.playbackPath+"*.flv");
>>>> addToMap(filesMap, flvs);
>>>> Resource[] mp3s =
>>>> scope.getResources(CustomFilenameGenerator.playbackPath+"*.mp3");
>>>> addToMap(filesMap, mp3s);
>>>> 3. But for some reason there is "/" before the actual path
>>>>
>>>> 2008-08-14 22:30:06,925 [pool-4-thread-6] DEBUG
>>>> o.r.s.webapp.oflaDemo.DemoService - getting the FLV files
>>>> 2008-08-14 22:30:06,940 [pool-4-thread-6] ERROR
>>>> o.r.s.webapp.oflaDemo.DemoService - {}
>>>> java.io.FileNotFoundException: ServletContext resource [/E:/data/music/]
>>>> cannot be resolved to URL because it does not exist
>>>> at org.springframework.
>>>> web.context.support.ServletContextResource.getURL
>>>> (ServletContextResource.java:112)
>>>> at
>>>> org.springframework.core.io.support.PathMatchingResourcePatternResolver.isJarResource(PathMatchingResourcePatternResolver.java:368)
>>>> at
>>>> org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources(PathMatchingResourcePatternResolver.java:319)
>>>> ...
>>>> I cann only debug into the Applicaton.java but than it misses the
>>>> sources so I think it might be this line.
>>>>
>>>> private String getStreamDirectory(IScope scope) {
>>>> final StringBuilder result = new StringBuilder();
>>>> final IScope app = ScopeUtils.findApplication(scope);
>>>> while (scope != null && scope != app) {
>>>>
>>>>
>>>>
>>>>
>>>> result.insert(0, "/" + scope.getName());
>>>> scope = scope.getParent();
>>>> }
>>>> return playbackPath + result.toString();
>>>> }
>>>>
>>>>
>>>>
>>>>
>>>> 4. So I need to fix this first and understand how to calculate some
>>>> dynamic paths based on params passed from the app under
>>>> E:/data/music/<user>/<file_id>.
>>>> If you have any ideas, I would highly appreciate this.
>>>>
>>>> Thx again,
>>>> RTG
>>>>
>>>>
>>>> 2008/8/14 Manuel R.G. <info at vengava.com>
>>>>
>>>> Hi RTG RTG RTG
>>>>>
>>>>> Can this help you?
>>>>>
>>>>>
>>>>> http://www.red5tutorials.net/index.php/Tutorials:Streaming_from_custom_directories
>>>>>
>>>>>
>>>>>
>>>>> 2008/8/14 RTG RTG <rtgrtgrtg at googlemail.com>
>>>>>
>>>>> Hi, I ran through this topic and the related tutorials, but how is it
>>>>>> possible to aggregate ressource locations which go deeper than just the root
>>>>>> directory?
>>>>>> We have /data as a mount to nfs and based on the user id and file id
>>>>>> requested passed to the client I want to calculate the subdirs
>>>>>> /data/<userid>/<file>.flv
>>>>>> Is the IStreamFilenameGenerator the right place, and will it be able
>>>>>> to resolve files underneath CustomFilenameGenerator.playbackPath
>>>>>>
>>>>>> RTG
>>>>>>
>>>>>>
>>>>>> 2007/7/13 Niels Joubert <njoubert at yahoo-inc.com>
>>>>>>
>>>>>>> If you want truly absolute paths, then it's easier to wait if you
>>>>>>> can afford to yes. For example, you have a big fat cross-mounted NFS
>>>>>>> filesystem with all your video, while you're running Red5 on your blazing
>>>>>>> Xeon multi-processor server, and you want to point your apps to paths on the
>>>>>>> NFS drive, and windows doesn't allow you to make nice symbolic links like
>>>>>>> Linux, wait it out for the new build.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> The old releases DOES support custom relative paths, e.g. a different
>>>>>>> path under the webapps/<app> folder
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------
>>>>>>>
>>>>>>> *From:* red5-bounces at osflash.org [mailto:red5-bounces at osflash.org] *On
>>>>>>> Behalf Of *Stefano
>>>>>>> *Sent:* Friday, July 13, 2007 1:19 PM
>>>>>>> *To:* red5 at osflash.org
>>>>>>> *Subject:* Re: [Red5] change default folder streams
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Thanks alll, so, if I want to use an absolute paths i should wait
>>>>>>> 0.6.3 release??
>>>>>>>
>>>>>>> On 13/07/07, *Niels Joubert* < njoubert at yahoo-inc.com> wrote:
>>>>>>>
>>>>>>> I just posted another tutorial on how to do custom stream
>>>>>>> directories:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> http://www.red5tutorials.net/index.php/Tutorials:Streaming_from_custom_directories
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> This tutorial focuses on the as-yet-unreleased 0.6.3 version of Red5.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> To sum it up, if you want to change the directory from /streams to
>>>>>>> /trailer only for oflaDemo, this is what you would do:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> - Create a CustomFilenameGenerator.java class under
>>>>>>> webapps/oflaDemo/WEB-INF/src in the package org.red5.server.webapp.oflaDemo
>>>>>>>
>>>>>>> - Copy the body of the
>>>>>>> org.red5.server.stream.DefaultStreamFilenameGenerator class to this new
>>>>>>> class. Be sure that the package and class name stays with the new class
>>>>>>> (i.e. don't copy the WHOLE file, just the contents of the class itself.
>>>>>>>
>>>>>>> - change the playbackPath to be /trailer instead of /streams in the
>>>>>>> variable in the class. (Joachim's or the aforementioned guide gives detail
>>>>>>> about how to abstract this out into the XML config files.)
>>>>>>>
>>>>>>> - Save the file and build it. (I'm assuming you have all of this
>>>>>>> running in Eclipse or the like)
>>>>>>>
>>>>>>> - in the webapps/oflaDemo/WEB-INF/red5-web.xml config file, add the
>>>>>>> following information:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> < bean id= "streamFilenameGenerator"
>>>>>>>
>>>>>>> class="org.red5.server.webapp.oflaDemo.CustomFilenameGenerator"
>>>>>>> />
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> This should be enough to hook up your custom filename generator to
>>>>>>> oflaDemo, and use it to generate paths instead of the default one.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> I would recommend studying the two tutorials (the above one and
>>>>>>> Joachim's one at http://www.joachim-bauch.de/tutorials/red5/HOWTO-StreamCustomDirectories.txt/view
>>>>>>> ), they go into detail on how to do this.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> I hope this works for you!
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> -Niels Joubert
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Red5 mailing list
>>>>>>> Red5 at osflash.org
>>>>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Red5 mailing list
>>>>>> Red5 at osflash.org
>>>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>>>
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Red5 mailing list
>>>>> Red5 at osflash.org
>>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> Red5 mailing list
>>>> Red5 at osflash.org
>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>
>>>>
>>> _______________________________________________
>>> Red5 mailing list
>>> Red5 at osflash.org
>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>
>>>
>>> ------------------------------
>>>
>>> _______________________________________________
>>> Red5 mailing list
>>> Red5 at osflash.org
>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>
>>>
>>> _______________________________________________
>>> Red5 mailing list
>>> Red5 at osflash.org
>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>
>>>
>>
>
> _______________________________________________
> Red5 mailing list
> Red5 at osflash.org
> http://osflash.org/mailman/listinfo/red5_osflash.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/red5_osflash.org/attachments/20080815/14cd7616/attachment-0001.html
More information about the Red5
mailing list