ここには、必要な作業を行うLUA拡張機能があります。指定された「開始」時間に基づいて右上に時間が表示されます。あなたがする必要があるのは、その開始時間を設定することだけです。あなたは、任意の時点で開始時間を調整することができ、テキストはそれに応じて更新する必要があります:
- は
[VLC DIR]\VLC\lua\extensions
- でファイルcustom_time.luaを入れて、コマンドラインを使用して
[VLC DIR]\VLC\lua\intf
- 実行VLCでファイルlooper_custom_time.luaを入れ引数:
vlc.exe --extraintf=luaintf{intf="looper_custom_time"}
- あなたが
View -> Custom Time
に行くと何秒を設定することができ
- を再生する映像に基づいて、右上の時間が
12:00:00
から始まり、インクリメント表示されるはずですtarting時間はべきで、テキストは更新する必要があります
私はそれが動作するかどうか教えてください!
custom_time.lua:
function descriptor()
return {
title = "Custom Time",
capabilities = { }
}
end
function activate()
window = vlc.dialog("Enter Time")
textbox = window:add_text_input("HH:MM:SS", 1, 1, 1, 1)
label = window:add_label("Enter Start Time (24h)", 2, 1, 1, 1)
button = window:add_button("Set", setStartTime, 1, 2, 2, 1)
end
function deactivate()
end
function meta_changed()
end
function setStartTime()
vlc.config.set("bookmark10", textbox:get_text())
vlc.msg.info("[ext_Custom_Time] " .. "Set Start Time to: ".. os.date("%H:%M:%S", globalTimeFinal))
end
looper_custom_time.lua:
-- "looper_custom_time" >> copy the script file into VLC\lua\intf\ folder
-- activate it:
-- vlc.exe --extraintf=luaintf{intf="looper_custom_time"}
function Looper()
local loops=0 -- counter of loops
while true do
if vlc.volume.get() == -256 then break end -- inspired by syncplay.lua; kills vlc.exe process in Task Manager
if vlc.playlist.status()=="stopped" then -- no input or stopped input
loops=loops+1
Log(loops)
Sleep(1)
else -- playing, paused
if vlc.playlist.status()=="playing" then
showFinalTime()
Sleep(1)
elseif vlc.playlist.status()=="paused" then
showFinalTime()
Sleep(0.3)
else -- ?
Log("unknown")
Sleep(1)
end
end
end
end
function getStartTime()
local pattern = "(%d+):(%d+):(%d+)"
local startTimeString = vlc.config.get("bookmark10")
if startTimeString == nil then
startTimeString = ""
end
local hh, mm, ss = startTimeString:match(pattern)
return os.time({year = 2000, month = 1, day = 1, hour = hh, min = mm, sec = ss})
end
function Log(lm)
vlc.msg.info("[looper_intf] " .. lm .. os.date(" %H:%M:%S", getStartTime()))
end
function showFinalTime()
local timePassed = getTimePassed()
local timeStart = getStartTime()
local timeFinal = os.date("%H:%M:%S", timeStart + timePassed)
vlc.osd.message(timeFinal, vlc.osd.channel_register(), "top-right", 1200000)
end
function getTimePassed()
return vlc.var.get(vlc.object.input(), "time")
end
function Sleep(st) -- seconds
vlc.misc.mwait(vlc.misc.mdate() + st*1000000)
end
Looper()
出典
2017-04-14 15:29:51
Tee
あなたは時間毎秒を参照してくださいする必要がありますか?または、ビデオを一時停止するときにのみ表示されるのであれば問題ありませんか?素早いLUA拡張でやることができるかもしれない – Tee
私はいつも時間を見たいと思います。画面の右上にある実行中の時計のように。だから私は私の前に私の論文に私の書いたコメントで座って、 "Ok - 10秒後に何かが起きる"と見ることができます。私がビデオを一時停止しなければならないのなら、それはすぐに迷惑になるでしょう、私は恐れています。 :/ – Zeth
ああ、そうだ。テキストはビデオ自体にある必要がありますか?もしそれが側に小さな窓として現れるなら、どうでしょうか? – Tee