Red5 流记录中的文件名替换问题

发布于 2024-12-15 16:27:46 字数 237 浏览 2 评论 0原文

我创建了一个 as3 应用程序来通过流式传输捕获麦克风或网络摄像头并将其保存在 red5 服务器中。 我还通过在publish()函数中传递参数来更改文件名。

如何检查服务器中是否已存在同名的任何其他文件。 我想维护服务器中的文件名序列...... 示例:如果我通过publish()发送的文件名“xyz.flv”并且xyz.flv已经存在于服务器中,那么它应该采用文件名的序列,如“xyz-1.flv”或“xyz- 2.flv”...这样。

I have created one as3 application to capture and save the mic or web cam in red5 server by streaming.
I am also changing the file name by passing argument in publish() function.

How I can check whether the any other file with same name already exists in the server or not.
I want to maintain the file name sequence in the server...
Example: if the file name "xyz.flv" I sent through publish() and the xyz.flv already there in the server, then it should take the sequence of the file name like "xyz-1.flv" or "xyz-2.flv"...like that.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

骄傲 2024-12-22 16:27:46

为什么不使用时间戳来命名?
做类似的事情:

var date_str:String = (today_date.getDate()+"_"+(today_date.getMonth()+1)+"_"+today_date.getFullYear()+"_"+today_date.getTime());               
newRecording = new Recording();             //create a record instance
newRecording.filename = "rec_" + date_str;  //name the file according to timestamp  

why dont you use a timestamp for the naming?
do something like:

var date_str:String = (today_date.getDate()+"_"+(today_date.getMonth()+1)+"_"+today_date.getFullYear()+"_"+today_date.getTime());               
newRecording = new Recording();             //create a record instance
newRecording.filename = "rec_" + date_str;  //name the file according to timestamp  
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文