Time v3.2 Original

VLC Extensions

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

8
8.0
Description:

Time is VLC Extension that displays running time on the screen in a playing video.
(Extension script "time_ext.lua" + Interface script "time_intf.lua")
Features:
- supported tags: [E], [Efps], [D], [R], [T], [O], [P], [n], [_];
- 9 possible positions on the screen;
- elapsed time with milliseconds;
- playback speed rate taken into account for duration time;

Time v3.1+ (intf)
Simple instructions:
1) "time_ext.lua" > Copy the VLC Extension Lua script file into luaextensions folder;
2) "time_intf.lua" > Copy the VLC Interface Lua script file into luaintf folder;
3) Start the Extension in VLC menu "View > Time v3.x (intf)" on Windows/Linux or "Vlc > Extensions > Time v3.x (intf)" on Mac and configure the Time interface to your liking.

Alternative activation of the Interface script:
* The Interface script can be activated from the CLI (batch script or desktop shortcut icon):
vlc.exe --extraintf=luaintf --lua-intf=time_intf
* VLC preferences for automatic activation of the Interface script:
Tools > Preferences > Show settings=All > Interface >
> Main interfaces: Extra interface modules [luaintf]
> Main interfaces > Lua: Lua interface [time_intf]

INSTALLATION location luaextensions for an Extension script (Create directory if it does not exist! Then Interface script in luaintf):
* Windows (all users): %ProgramFiles%VideoLANVLCluaextensions
* Windows (current user): %APPDATA%VLCluaextensions
* Linux (all users): /usr/lib/vlc/lua/extensions/
* Linux (current user): ~/.local/share/vlc/lua/extensions/
* Mac OS X (all users): /Applications/VLC.app/Contents/MacOS/share/lua/extensions/
* Mac OS X (current user): /Users/%your_name%/Library/Application Support/org.videolan.vlc/lua/extensions/

Forum: https://forum.videolan.org/viewtopic.php?f=29&t=97639
Last changelog:

v3.2 (intf) (27.8.2018) 9 months ago

- option to disable milliseconds in elapsed time
- option to show system/ending time in "h:m" format

torr3

15 days ago

Hi. Is there a way to use this extension to calculate and display the record time of the video? If I know the start time of the video could I add the [E] time to that to get the record time displayed? Something like: 13:50:30 + [E] This would be very helpful to me. Thanks for your support and help!

Report

C

mederi

14 days ago

The code for [E+seconds] tag ([E+49830]):
local addend=tonumber(string.match(osd_output,"%[E%+(.-)%]"))
if addend then
osd_output = string.gsub(osd_output, "%[E%+.-%]", tostring(TIME_Time2string(et+addend, 0, not TIME_Enoms)))
end

Insert the code right above following line in "time_intf.lua":
local fps=tonumber(string.match(osd_output,"%[E(.-)%]"))

Report

torr3

14 days ago

Wonderful! Thank you!
Another question. How do I get the Time v3.2 information to be on the image when I use the 'Take Snapshot' function in VLC?
Thanks again!

Report

C

mederi

13 days ago

It is not supported in VLC. You can use an external screenshot taker (like IrfanView - hotkey C; you can switch VLC to Minimal Interface Ctrl+H).

Report

torr3

2 hours ago

Hi again. Could you also please tell me how to calculate and display the record time of the video using the endtime of the video (instead of the start time, as I previously asked you)? So, if I know the endtime, perhaps the code would look like [(seconds-D)+E]. Many thanks for your help!

Report

frob

1 month ago

How do I change the position of the timer besides the nine options? I'm trying to place it further to the top left. Is there anyway to customize it?

Report

C

mederi

29 days ago

There is a workaround using marquee filter reading a text file (Tools > Preferences > Show settings=All > Video \ Subtitles/OSD
: [v] Marquee display
\ Marquee: Text file [D:\vlc-3.0.2+\portable\timemarquee.txt] / Position / Font / Misc).

Edit the "time_intf.lua" in a text editor, find following line:
vlc.osd.message(TIME_Decode_time_format(), 1111111111, TIME_osd_position)
Replace it with following new lines of code:
local f = vlc.io.open(vlc.config.userdatadir().."\\timemarquee.txt", "w")
if f then
f:write(TIME_Decode_time_format())
f:close()
end

I could add this option in Time extension in the future version.

Report

dementia

1 month ago

Instead of specifying the FPS in the [E] tag, you can get it from VLC directly. At that point, you can use it to create a new [F] tag if you wish, or use it to display the frame number in the time stamps, instead of milliseconds. NOTE: if a video file contains more than one video stream and they are at different frame rates, then the following code will need to be changed to detect which stream is actually playing.

Put the following code in the function TIME_Decode_time_format()

local input_object_info = vlc.input.item():info()
local key
local value
local fps
for key, value in pairs( input_object_info ) do
if value["Frame rate"] then
fps = value["Frame rate"]
end
end
if not fps then fps="--" end

Report

C

mederi

1 month ago

How would you handle all other languages? The "Frame rate" key is translated according to selected interface language in VLC.

Report

dementia

1 month ago

Updated code- 1) Detects the currently playing video stream used to determine the FPS. 2) changed variable from "fps" to "vlc_fps" so as not to clobber an existing variable. The following code goes directly above the line

"local osd_output = string.gsub(TIME_time_format, "%[E%]", elapsed_time)"

local input_object_info = vlc.input.item():info()
local key
local value
local vlc_fps
local cur_stream_name = "Stream " .. vlc.var.get(input, "video-es")
for key, value in pairs( input_object_info ) do
if key == cur_stream_name and value["Frame rate"] then
vlc_fps = value["Frame rate"]
end
end
if not vlc_fps then vlc_fps="--" end

To add an [F] tag to display the video FPS, the following line goes directly below the same line-- "local osd_output = string.gsub(TIME_time_format, "%[E%]", elapsed_time)"

osd_output = string.gsub(osd_output, "%[F%]", vlc_fps)

Report

jaramazovic

4 months ago

Hi, I like your extension. Cool , I have a question is it possible to get FpS instead of miliseconds, I mean not the all frame no but just frame no in a sec? thanks

Report

C

mederi

4 months ago

You can edit the "time_intf.lua" script in a text editor. Find the line:
osd_output = string.gsub(osd_output, "%[E.-%]", math.floor(et * fps))
Edit the math.floor() function there if it make sense for you:
osd_output = string.gsub(osd_output, "%[E.-%]", math.floor(et * fps % fps))

Report

jaramazovic

3 months ago

Thank you.

Report

calanda1900

5 months ago

I just installed the extension, but it won't run, the window won't close after I choose my settings and click "START!', nothing happens. Does any one have a suggestion?
By the way, could you include an explanation for the different options in settings? Thank you!

Report

calanda1900

5 months ago

For Mac users, here's a guideline for installing the extension:
Go to your Applications folder and right-click on the VLC app. Select “Show Package Contents”. Once inside Package Contents, locate and open the “MacOS” folder. Locate and open the “share” folder, locate and open the “lua” folder.
Locate and open the “extensions” and copy your “time_ext.lua” and "time_inft.lua" to it.

Report

C

mederi

5 months ago

Copy the "time_inft.lua" into "intf" folder, not into "extensions"! Then it works.

Report

C

mederi

5 months ago

time_intf.lua

Report

sharjeelkhan

5 months ago

this is very good

Report

exphp

5 months ago

I'm confused by this addon. When I use [E] and enable milliseconds, they seem to jump around randomly as I use frame advance. Even if I use [E23.976215] on a video with that frame rate, when using frame advance the number does not increase by units of 1, or even monotonically. (I see 36, 41, 42, 42, 43, 41, 47, 44, ...)

Report

C

mederi

5 months ago

It is known that VLC is not frame accurate. The split-second jumps are better in some video formats and worse in others (like variable frame rate). The [Efps] tag just multiplies time value (returned by VLC) with the provided fps value and the result is rounded down: math.floor(et * fps). You can check/ask VLC, whether it gets better in VLC 4.

Report

bhwtuileusd

5 months ago

I cannot use it for any audio files...

Report

C

mederi

5 months ago

You can enable an audio visualization in VLC: Audio > Visualization >. You can set up visualizations in VLC preferences: Tools > Preferences > Show settings=All > Audio \ Visualizations

Report

smmaruf

6 months ago

This addon does not show in if you take a screen shot. any one plz help this

Report

C

mederi

6 months ago

You can use an external screenshot taker (like IrfanView - hotkey C on Windows).

Report

jonpalawan

7 months ago

Is there a way to alter the refresh rate? It seems to be about a quarter second.

Report

v3.2 (intf) (27.8.2018) 9 months ago

- option to disable milliseconds in elapsed time
- option to show system/ending time in "h:m" format

v3.1 (intf) (19.8.2018) 9 months ago

- fixed numeric locale issue on Mac
- VLC version detection so the script works also in older VLC versions
- auto-format time (s > m:s > h:m:s > D/h:m:s)
- percentage playback position tag [P]
- always show "Settings" dialog box for disabled interface script
- respect other enabled VLC interfaces when saving settings
- "Settings" button in "Control panel" dialog box
- ">STOPPED<" status in title bar
- "looper_intf.lua" script file renamed to "time_intf.lua"

v3.0 (intf) (11.2.2018) 66127 1 year ago

- fixed time in microseconds for VLC 3;

v2.1 (intf) (5.9.2016) 58019 2 years ago

- fixed several bugs in Interface script;

old (before changes on this portal in September 2016) 7 years ago

v2.0 (intf) (28.4.2016) 53798
- resurrection attempt;
- Interface script "looper_intf.lua" + Extension script "time_ext.lua";
- new tags [Efps]-elapsed frames (et*fps), [n]-name, [_]-new/next line;
- elapsed time with milliseconds;
- playback speed rate taken into account for duration time;

v1.0 (19.3.2012)
- works in VLC 2.0.x;
- supported tags: [E]-elapsed time, [D]-duration, [R]-remaining time, [T]-system time, [O]-over/ending time;

12345678910
12
product-maker pascal Sep 28 2018 9 excellent
+
product-maker artistmatej Sep 12 2018 9 excellent
+Thank you very much! Now I can view FPS of my animation.
product-maker khant45 Sep 05 2018 9 excellent
Useful
product-maker GKidM-A-A-DCity Aug 27 2018 9 excellent
+
product-maker neokix Feb 18 2018 9 excellent
Love this script. I'm glad I can use it with VLC v3.0!!
product-maker NeM Feb 12 2018 9 excellent
Excellent extension
product-maker dimitrovden Jul 09 2017 9 excellent
product-maker Storm77 Apr 12 2017 9 excellent
product-maker ipers Feb 26 2017 9 excellent
product-maker CPaddict Dec 20 2016 9 excellent
product-maker Safranriz Oct 05 2016 9 excellent
product-maker 3demax Apr 08 2013 9 excellent
product-maker Count: 4 Rating: 5.0
File (click to download) Version Description Downloads Date Filesize DL OCS-Install
Pling
*Needs ocs-url or ocs-store to install things
Details
license
GPLv2 or later
version
updated Sep 01 2018
added Mar 19 2012
downloads today
72
page views today 401
System Tags addon gplv2-later