Adobe Dreamweaver Forums



Last 10 THreads :         Query question/help (Last Post : trojnfn - Replies : 2 - Views : 3 )           »          CS4 Motion Editor issues (Last Post : aaronlyon - Replies : 4 - Views : 9 )           »          Bridge No Longer Rotates Automatically (Last Post : Michael_Palumbo@adobeforums.com - Replies : 1 - Views : 2 )           »          dollarFormat / numberformat problem (Last Post : izdabye - Replies : 0 - Views : 1 )           »          Call out side flex (Last Post : Amy Blankenship - Replies : 15 - Views : 16 )           »          captions for photos (Last Post : dc111652 - Replies : 0 - Views : 1 )           »          Re: CS4 GPU Acceleration and Intel X3100 (Last Post : Paul_B_Brown@adobeforums.com - Replies : 0 - Views : 1 )           »          error 1034 (Last Post : shottogan - Replies : 0 - Views : 1 )           »          Keyboard events don't work in player or projector (Last Post : tunghoy - Replies : 0 - Views : 1 )           »          Help with caption box question (Last Post : NZ-developer - Replies : 1 - Views : 2 )           »         


User Info Statistics
Go Back   Adobe Dreamweaver Forums > Macromedia Software > Flash > Flashcom
 
Tags:



Reply
  #1 (permalink)  
Old 12-02-2008, 11:04 PM
dhalbert
 
Posts: n/a
Diggs:
Default recorded a stream, but can't rename the resulting flv

I have a simple server-side app that creates a Stream, creates a NetConnection,
and then plays a live stream from that NetConnection. I record the resulting
stream into a file, say "recordstream.flv"

When I get an UnpublishNotify, I stop recording. When I see
NetStream.Record.Stop, I create a File object that points to recordstream.flv,
and try to rename it to a different filename with File.renameTo().

This worked in FMS2, but not in FMS3. In FMS3, I get an error that the
renameTo() failed. Interestingly, copyTo() the same new filename works, so it
is not a directory protection issue or something like that. It appears that
FMS3 is forbidding me from fiddling with the file; File.canRead returns false
on the file. Is there any way to get FMS3 to release the file? Or should I give
up and just use copyTo()?



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-05-2008, 12:34 AM
mohammep
 
Posts: n/a
Diggs:
Default Re: recorded a stream, but can't rename the resultingflv

Hi,

What platform are you running on ? If the platform is Windows, then this is
most probably happening because Windows thinks that the file is still open
under FMS. What happens if you wait for a while before trying to rename the
file. Does that work ?

You can also verify whehter Windows thinks that FMS still has the file open by
trying the following :
1) If you haven't got it installed yet, install process explorer. You can find
it at :
http://technet.microsoft.com/en-us/s.../bb896653.aspx
2) Search for your file name. Process explorer will tell you which process is
still using the file.

thanks,
Mo



[q]Originally posted by: dhalbert
I have a simple server-side app that creates a Stream, creates a
NetConnection, and then plays a live stream from that NetConnection. I record
the resulting stream into a file, say "recordstream.flv"

When I get an UnpublishNotify, I stop recording. When I see
NetStream.Record.Stop, I create a File object that points to recordstream.flv,
and try to rename it to a different filename with File.renameTo().

This worked in FMS2, but not in FMS3. In FMS3, I get an error that the
renameTo() failed. Interestingly, copyTo() the same new filename works, so it
is not a directory protection issue or something like that. It appears that
FMS3 is forbidding me from fiddling with the file; File.canRead returns false
on the file. Is there any way to get FMS3 to release the file? Or should I give
up and just use copyTo()?[/q]



Reply With Quote
  #3 (permalink)  
Old 12-05-2008, 01:54 AM
dhalbert
 
Posts: n/a
Diggs:
Default Re: recorded a stream, but can't rename the resultingflv

[Q]What platform are you running on ?[/Q]Thanks for reply. No, it's Linux, so
that's why I found it so odd. It seems that File.renameTo() is making some
extra check about the file being associated with a stream. Normally a rename
should be just fine.

I have since restructured my code so that the problem is moot, but still, it's
an open question.

Reply With Quote


  #4 (permalink)  
Old 12-08-2008, 08:04 PM
mohammep
 
Posts: n/a
Diggs:
Default Re: recorded a stream, but can't rename the resultingflv

It seems that this might be a bug in FMS, which will need further
investigation. I have filled a bug detailing what you explained. That way we
can have resources allocated to it. The bug number for our internal bug
database is : 1935018.

Reply With Quote
  #5 (permalink)  
Old 12-08-2008, 08:04 PM
mohammep
 
Posts: n/a
Diggs:
Default Re: recorded a stream, but can't rename the resultingflv

Btw what is the build number for FMS and can you give the version (major and minor version) too.
Reply With Quote
  #6 (permalink)  
Old 12-08-2008, 09:24 PM
dhalbert
 
Posts: n/a
Diggs:
Default Re: recorded a stream, but can't rename the resultingflv

[q]Originally posted by: mohammep
Btw what is the build number for FMS and can you give the version (major and
minor version) too.[/q]
It is FMS_3_0_1_R123, unpacked from the latest Development Server build a few
days ago, running on Scientific Linux 4.2 i686 (RHEL 4 clone).



Reply With Quote


  #7 (permalink)  
Old 12-09-2008, 12:54 AM
mohammep
 
Posts: n/a
Diggs:
Default Re: recorded a stream, but can't rename the resultingflv

Hi Dhalbert,

Thanks for the prompt response. Do you have a script handy which we can use to
repro the bug ? It would help to havethe script you are using or a code snippet
thereof which we can use to repro the bug.

thanks,
Mo



Reply With Quote
  #8 (permalink)  
Old 12-09-2008, 11:54 PM
dhalbert
 
Posts: n/a
Diggs:
Default Re: recorded a stream, but can't rename the resultingflv

Hi, here's the essence of the code, as described in the original posting:

# Demonstration of failure of renameTo() on a recorded stream file on FMS3
# dhalbert

application.onAppStart = function() {
this.ns = Stream.get("recordstream");
this.ns.onStatus = onStatusHandler;
this.nc = new NetConnection();
this.nc.connect("rtmp://remoteserver/remoteapp");
var playResult = this.ns.play("remotestream", -1, -1, true, this.nc);
application.ns.record();
}

onStatusHandler = function(info) {
timetrace("onStatus: " + info.code );
if (info.code == "NetStream.Play.UnpublishNotify") {
application.ns.record(false); // Stop recording:
NetStream.Record.Stop will be sent
}

else if (info.code == "NetStream.Record.Stop") {
// application.ns.record(false) has done its work.
var file = new File("streams/remotestream/recordstream.flv");
trace("file.canRead: " + file.canRead);
trace("file.exists: " + file.exists);

var filename = "streams/remotestream/renamed.flv";
// file.copyTo(filename); // Works on FMS2 and FMS3
file.renameTo(filename); // Works on FMS2, gets "renameTo
failed" on FMS3
}
}

Reply With Quote
  #9 (permalink)  
Old 12-10-2008, 01:55 AM
osipls
 
Posts: n/a
Diggs:
Default Re: recorded a stream, but can't rename the resultingflv

I belive this is not a bug as designed. In your code he specified stream rename
to as var filename = streams/remotestream/renamed.flv
and that why extra level is added, and probably your directory
streams/remotestream/streams/remotestream not exists
To rename to same directory you needs to specify var filename =
"/streams/remotestream/renamed.flv"
and everything works well.
By specifying leading / the level could be controlled. Please confirm.
Thanks.


Reply With Quote


  #10 (permalink)  
Old 12-10-2008, 02:04 AM
dhalbert
 
Posts: n/a
Diggs:
Default Re: recorded a stream, but can't rename the resultingflv

Sorry, I was simplifying and sanitizing my sample program and made some typos.
I did not actually run the exact code above. I meant something like:

...
else if (info.code == "NetStream.Record.Stop") {
// application.ns.record(false) has done its work.
var file = new File("streams/_definst_/recordstream.flv");
trace("file.canRead: " + file.canRead);
trace("file.exists: " + file.exists);

var filename = "streams/_definst_/renamed.flv";
// file.copyTo(filename); // Works on FMS2 and FMS3
file.renameTo(filename); // Works on FMS2, gets "renameTo failed" on FMS3

I know the file is there because file.exists returns true.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 03:36 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk