[Extension] Time

Discuss your Lua playlist, album art and interface scripts.
VLCGeorge
New Cone
New Cone
Posts: 2
Joined: 27 Aug 2012 07:15
Operating System: Windows

Re: VLC extension: Time

Postby VLCGeorge » 27 Aug 2012 07:19

It gives me just zeros, not the total time. This happens if I select the extension before I load the playlist, and if I select it after I load the playlist, and whether the player is stopped or active.

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: VLC extension: Time

Postby mederi » 03 Sep 2012 15:09

Patches published at http://addons.videolan.org/content/show ... ent=149618
Elapsed time with miliseconds:
- remove the math.floor() from the elapsedSecond definition (line 91)
- change the elapsed_time string format to "%02d:%02d:%06.3f" (line 115)
viewtopic.php?f=29&t=103803
Meanwhile here is a patch for extended [E] tag for manual input of constant fps information to convert time to frames, e.g. [E23.976]. Tip: [E1] means time in seconds.
There is also a new tag [N] - new/next line.
- insert following line before line 115>local elapsed_time = string.format(...

Code: Select all

local et = elapsed_time
- insert following lines right before line 125>return osd_output

Code: Select all

local osd_output = string.gsub(osd_output, "%[N%]", "\n") local fps=tonumber(string.match(osd_output,"%[E(.-)%]")) if fps~=nil then osd_output = string.gsub(osd_output, "%[E.-%]", math.floor(et * fps)) end

akatarmo
New Cone
New Cone
Posts: 3
Joined: 15 Oct 2012 19:47

Re: VLC extension: Time

Postby akatarmo » 15 Oct 2012 20:43

Hello!
I am happy I can finally share my complete script also with dialog box. Before uploading it to official website for VLC addons I would like you to test it first. I have also a couple of issues to discuss.

[.
Hello, is there any way that the TIME option is always checked in View Options?. If I can do this, then it's perfect for me.
Now whenever I have to go to View and manually check this option at start VLC.

Thanks for your work !!

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: VLC extension: Time

Postby mederi » 17 Oct 2012 14:23

Sorry, I have not found any way for automatic start of chosen extension in VLC. It is not implemented yet. Only developers could do something about it. There are already some good ideas for improvement: Which feature do you miss in lua ?

anechoic
New Cone
New Cone
Posts: 4
Joined: 05 Mar 2006 21:14
Location: San Francisco
Contact:

Re: VLC extension: Time

Postby anechoic » 13 Feb 2013 19:57

is there a way to display the total time of the *selected* tracks only?

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: VLC extension: Time

Postby mederi » 14 Feb 2013 16:07

This is not implemented. I do not know whether it is possible to read only selected items directly in VLC playlist using Lua extension script. But it would be possible to make selections in a custom dialog box containg a list widged with all playlist items.

qwerti
New Cone
New Cone
Posts: 1
Joined: 12 Mar 2013 18:11

Re: VLC extension: Time

Postby qwerti » 12 Mar 2013 18:16

It gives me just zeros, not the total time. This happens if I select the extension before I load the playlist, and if I select it after I load the playlist, and whether the player is stopped or active.
Do you have "Display Playlist Tree" enabled? I was having the same problem, but once I disabled this option, the extension (with the playlist duration function) worked fine.

Great extension! Thank you!

dvjrickkraft
New Cone
New Cone
Posts: 5
Joined: 11 Nov 2012 21:50

Re: VLC extension: Time

Postby dvjrickkraft » 19 Apr 2013 00:28

As I'm a video DJ, I needed exactly this to try to guesstimate my new mix I'm making. Thanks so much for your time, and it saved me lots! Cheers! :D

wrwolf2
New Cone
New Cone
Posts: 1
Joined: 07 Apr 2018 13:34

Re: [Extension] Time

Postby wrwolf2 » 07 Apr 2018 14:28

made small changes to .intf file , this way elapsed time won't show milliseconds.

also:
read your comment on marquee filter and i found ( marquee filter) can be config. even by using WINDOW>VIDEO EFFECTS menu option ( ⌘E on a mac), though
i can't detect right code to show elapsed time. only few "%key" or "$key" seem working correctly [ unless we need to enter operators and to subtract time left to duration " ($D−$L) "... and i wouldn't know where to start ]

marcelo
VLC 3.0.1 on a mac

--local elapsed_time = string.format("%02d:%02d:%06.3f", elapsedHour, elapsedMinute, elapsedSecond)<<THIS TO SHOW MILLISECONDS
local elapsed_time = string.format("%02d:%02d:%02d", elapsedHour, elapsedMinute, elapsedSecond)

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: [Extension] Time

Postby mederi » 07 Apr 2018 23:19

You can customize the script. Marquee filter currently does not support meta expansions $.

LRN
New Cone
New Cone
Posts: 3
Joined: 04 Sep 2018 11:46

Re: [Extension] Time

Postby LRN » 04 Sep 2018 11:50

It seems to me that this extension doesn't work in VLC4 (nightly). Is that actually true, or am i installing it wrong?

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: [Extension] Time

Postby mederi » 04 Sep 2018 19:48

I cannot test the extension (Time v3.2) in VLC4 on Windows XP/Vista. You could try to debug the script on your system whether there is a solution. Try to start VLC with additional options and then check the logs in the "vlc_log.txt" file:

Code: Select all

vlc.exe --verbose=2 --file-logging --logfile=vlc_log.txt --extraintf=luaintf --lua-intf=time_intf

LRN
New Cone
New Cone
Posts: 3
Joined: 04 Sep 2018 11:46

Re: [Extension] Time

Postby LRN » 06 Sep 2018 14:34

Thanks, looks like it's a problem in VLC4 lua interface loading:

Code: Select all

main debug: looking for interface module matching "luaintf,none": 15 candidates main debug: no interface modules matched main error: no suitable interface module main error: interface "luaintf,none" initialization failed

LRN
New Cone
New Cone
Posts: 3
Joined: 04 Sep 2018 11:46

Re: [Extension] Time

Postby LRN » 06 Sep 2018 18:06

Okay. After trying it out in VLC3 (also didn't work), then in VLC3-x86 (until that point i've been trying on x86_64; also didn't work) i just uninstalled VLC and deleted all preferences and cache. And then the extension magically started to work, even in VLC4.

Dae
New Cone
New Cone
Posts: 6
Joined: 25 Jul 2018 23:59
Contact:

Re: [Extension] Time

Postby Dae » 19 Sep 2018 15:07

Hey mederi, I saw your comments on the addons site about macOS and I wanted to tell you that your script works absolutely fine in macOS High Sierra.

In my experience, it is more stable on macOS than on Windows, because on Windows VLC keeps "forgetting" the extra interface setting (extraintf=luaintf) required for your script to work.

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: [Extension] Time

Postby mederi » 20 Sep 2018 13:18

Hey mederi, I saw your comments on the addons site about macOS and I wanted to tell you that your script works absolutely fine in macOS High Sierra.
Thanks for the feedback. Another brave masOS user pablo_kks willing to cooperate and debug the script on his system helped me to find a solution for the strange issue with a standard dot as a decimal separator in numbers. The solution:

Code: Select all

os.setlocale("C", "all")

In my experience, it is more stable on macOS than on Windows, because on Windows VLC keeps "forgetting" the extra interface setting (extraintf=luaintf) required for your script to work.
Well, the script works fine here (Vista). The Extension script shows the SETTINGS dialog box that helps users to set appropriate VLC settings for the Interface script and asks them to restart VLC for changes to take effect. They do not have to check the settings manually in VLC preferences.
If you check again the settings manually in VLC preferences, then you are right that the "luaintf" is incorrectly recognized as "lua" and you always have to fix it to "luaintf". Just fix it, save it, leave it and do not check the settings again there and then it works :)
Tools > Preferences > Show settings=All > Interface >
> Main interfaces: Extra interface modules [luaintf]
> Main interfaces > Lua: Lua interface [time_intf]
I can open a trac ticket for the missing checkbox for "luaintf" in VLC preferences in Qt GUI. How does the Mac behaves if you check again the VLC preferences? Is there always the "luaintf" in the input field there? What happens if you check some of the checkboxes there for enabling of other interfaces?

Dae
New Cone
New Cone
Posts: 6
Joined: 25 Jul 2018 23:59
Contact:

Re: [Extension] Time

Postby Dae » 20 Sep 2018 15:38

@mederi thanks for the information!

On macOS, you can type in "luaintf" into the field and it just stays there after saving, even if you change other options. However, if you check "Lua interpreter", "luaintf" will be replaced with just "lua".

Wabiloo1
New Cone
New Cone
Posts: 1
Joined: 05 Oct 2018 12:35

Re: [Extension] Time

Postby Wabiloo1 » 05 Oct 2018 12:41

Great tool.
Quick question though: is there any way to automatically detect the FPS, rather than having to manually set it in [Enn]?

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: [Extension] Time

Postby mederi » 06 Oct 2018 13:08

It is possible but limited like in Jump to time (Previous frame) v3 VLC Extension (1/FPS). It could be a new tag [F].

Leopardshark
New Cone
New Cone
Posts: 1
Joined: 10 Nov 2018 02:54

Re: [Extension] Time

Postby Leopardshark » 10 Nov 2018 03:06

MacOS 10.12.6
VLC 3.0.4

Having an issue with running time display. Using pattern [E], instead of seeing 00:00:03:268, I see 03,268.

Plz help

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: [Extension] Time

Postby mederi » 11 Nov 2018 21:11

03,268 is correct. Autoformat (with or without ",ms"): s > m:s > h:­m:s > D/h:­m:s

bridgescodecamp
New Cone
New Cone
Posts: 1
Joined: 13 Aug 2019 15:59

Re: [Extension] Time

Postby bridgescodecamp » 13 Aug 2019 16:02

This extension fails over time on the Mac. The time to failure isn't consistent but it will fail after at least 12 to 48 hours. Any help is very appreciated. When it fails the time code just stops displaying. A restart of VLC player fixes the issue until the next failure.

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: [Extension] Time

Postby mederi » 15 Aug 2019 12:57

The best you could do about it is to check the VLC logs.

jae1379
New Cone
New Cone
Posts: 1
Joined: 14 Feb 2020 13:58

Re: [Extension] Time

Postby jae1379 » 14 Feb 2020 14:00

Thank you very much for this useful extension!

I got the most updated version of Time Extension at https://addons.videolan.org/p/1154032

In the lua file, how do you edit the codes that font size is smaller?

[EDIT: Sorry! After digging in deeper--smh--I figured it out. Your extension had solved that already.
For those who are also having trouble like myself:

"OSD text format can be customised within internal VLC settings:
Tools > Preferences > (Show settings = Simple) > Subtitles/OSD
Tools > Preferences > (Show settings = All) > Video \ Subtitles/OSD \ Text renderer
Do not forget to Save and restart VLC for changes to take effect!"]

Very Best,
J

adambishop
New Cone
New Cone
Posts: 1
Joined: 02 Mar 2020 19:19

Re: [Extension] Time

Postby adambishop » 02 Mar 2020 19:44

Thank you for this great VLC extension. I use it all the time. I do have a request. Can you change the [E] elapsed_time to reflect changes made by changing the speed (rate) of the video? I have been modifying your file with each new version that comes out, but I am not a proficient programmer, so it takes me a while to figure it out. For clarification, when I play a one-hour video at normal speed, at thirty minutes I have [E]/[D] 30:00/01:00:00. If I increase the rate of speed to 2x, at thirty minutes I have 30:00/30:00. I like to watch videos while exercising and so I increase the speed of the video to reduce the duration to 1-hour. And I would like the elapsed time to accurately reflect the rate change. So in my previous example, if I am at 2x speed and the video is half-way over, I would have [E]/[D] = 15:00/30:00. You already do this change for remaining time, ending time, and duration, so elapsed time would seem to make sense also. I don't know if you want to make a new symbol for this, or just change the current [E]. I don't even need the "*" because you already have the speed in parenthesis when you change the rate. Thanks again.


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 4 guests