這是LUA擴展應該做你需要的。它會根據給定的「開始」時間顯示右上角的時間。你需要做的唯一事情就是設定開始時間。您可以在任何時候調整開始時間和文本應相應地更新:
- 把文件custom_time.lua在
[VLC DIR]\VLC\lua\extensions
- 使用命令行把文件looper_custom_time.lua在
[VLC DIR]\VLC\lua\intf
- 運行VLC參數:
vlc.exe --extraintf=luaintf{intf="looper_custom_time"}
- 您應該看到在右上角的時間開始
12:00:00
和增加基礎上的視頻播放
- 你可以去
View -> Custom Time
並設置什麼的S放屁時間應該是,文字應該更新
讓我知道它是否有效!
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
我想一直看到時間。就像屏幕右上方的運行時鐘一樣。因此,我可以在我面前的論文中留下我的書面評論,並看到'好的 - 從現在開始10秒鐘後,出現了一些事情'。如果我不得不一直暫停視頻,那麼恐怕很快就會變成一種麻煩。 : -/ – Zeth
啊,我明白了。文字是否必須放在視頻上?如果它出現在旁邊的一個小窗口怎麼辦? – Tee