dragonsun00000 2012-04-16 08:30
浏览 37

需要将文本文件写为视频标题,延迟时间为7秒

I have video running as a live stream and an editor can add captions at any time. Also when microphones are clicked in the broadcast room they move the camera and then update the caption. The flash video pulls a text file every 3 seconds for the new caption. The video takes an average of 7secs delay to get to the web users though and so I need to write some php to hold the update somewhere and then write it 7 seconds later to the text file.

I need to update away from a Java demon that needs to keep a socket open at the moment.

I have thought of trying out a queue or a cron job. Cron does not do second updates and queue seems to mean running a java demon again, and have not found a way or pausing yet. The caption needs to stay in a text file and must not do a db call, but the api can be changed in any simple way to delay the updates.

So Jason object generated through the api (only 1-5k) held for 7seconds and then written to text file.

  • 写回答

1条回答 默认 最新

  • douxin8610 2012-04-16 08:48
    关注

    You should look into long polling and real time updates, then do some sort of loop that pushes content when specified.

    You can setup a very simple webservice with something like Pubnub or Pusher. And then do some sort of loop in the server side of your choice that pushes contents with the right intervals to make sure data is there.

    Please be aware that the design you mention has race conditions all over, so take that in consideration when building it.

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大