2017-04-04 376 views
1

在錄製過程中,我正在錄製一些運動素材,並記下一些註釋。在播放時(錄製剪輯的時間)在VLC播放器中顯示剪輯時間

我希望能夠儘快將我的評論與視頻段落聯繫起來。我用GoPro錄製它,所以1.5小時長的視頻被切成小塊。

我認爲這將是一個想法,如果VLC可以在屏幕上顯示拍攝時間的實際時間。以同樣的方式(從評論的命令行開啓VLC):

vlc.exe --sub-filter=marq{marquee=$T/$D" Volume:"$V,size=-2,color=16776960}:marq{marquee=Time:%H:%M:%S" Date:"%d/%m/%Y,color=16776960,size=-2,position=6} 

該行只顯示當前時間。我想讓它顯示這樣的內容:

如果錄製開始於19:39:21,那麼錄製視頻的時間爲三分七秒,計數器應該說是19:42:28。以某種方式可以實現嗎?

我認爲VLC是最好的/最簡單的方法來實現它 - 但如果別人有另一個或更好的想法,那麼我都是耳朵。

+0

你需要看到的每一秒時間?或者,如果僅在暫停視頻時才顯示,那麼還可以嗎?用LUA的快速擴展可能是可行的 – Tee

+0

我想一直看到時間。就像屏幕右上方的運行時鐘一樣。因此,我可以在我面前的論文中留下我的書面評論,並看到'好的 - 從現在開始10秒鐘後,出現了一些事情'。如果我不得不一直暫停視頻,那麼恐怕很快就會變成一種麻煩。 : -/ – Zeth

+0

啊,我明白了。文字是否必須放在視頻上?如果它出現在旁邊的一個小窗口怎麼辦? – Tee

回答

0

這是LUA擴展應該做你需要的。它會根據給定的「開始」時間顯示右上角的時間。你需要做的唯一事情就是設定開始時間。您可以在任何時候調整開始時間和文本應相應地更新:

  1. 把文件custom_time.lua在[VLC DIR]\VLC\lua\extensions
  2. 使用命令行把文件looper_custom_time.lua在[VLC DIR]\VLC\lua\intf
  3. 運行VLC參數:vlc.exe --extraintf=luaintf{intf="looper_custom_time"}
  4. 您應該看到在右上角的時間開始12:00:00和增加基礎上的視頻播放
  5. 你可以去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() 
相關問題