0
我有一臺服務器正在使用攝像頭拍攝視頻剪輯並將它們放置在#{Rails.root}/app/assets/videos
中。問題是我無法看到新創建的視頻剪輯,直到服務器重新啓動。有沒有解決方法?如果創建新文件,Rails 3.1資產管道需要重新啓動?
這裏的控制器代碼:
@file_name = Time.now.strftime("%Y-%m-%d_%H-%M-%S-%p") + ".mp4"
system("ffmpeg -f video4linux2 -s 320x240 -t 10 -i /dev/video0
#{Rails.root.to_s}/app/assets/videos/#{@file_name}")
並在視圖:
<video src="/assets/<%= @file_name %>" width="320" height="240">
Your browser does not support the video tag.
</video>