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

9
Score 80.6%
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 \lua\extensions\ folder;
2) "time_intf.lua" > Copy the VLC Interface Lua script file into \lua\intf\ folder;
3) Start the Extension in VLC menu and configure the Time interface to your liking:
- Windows/Linux: "View > Time v3.x (intf)";
- Mac OS: "Vlc > Extensions > Time v3.x (intf)".

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]

Lua 5.1! like in VLC-32bit for Windows (later I will fix it for Lua 5.2/5.3)
INSTALLATION location \lua\extensions\ for an Extension script (Create directory if it does not exist! Then Interface script in \lua\intf\):
* Windows (all users): %ProgramFiles%\VideoLAN\VLC\lua\extensions\
* Windows (current user): %APPDATA%\VLC\lua\extensions\
* 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) 1 year ago

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

C

mederi

5 years ago

O.K. Thanks.

Report

PeterDV

5 years ago

Hi.
Thanks for the reply. I will try version 2.0.9 and will let you know the result.
Thanks
Peter

Report

9

NeM

6 years ago

Here is the debug error I see:

lua debug: Activating extension 'Time'
lua warning: Error while running script C:\Program Files\VideoLAN\VLC\lua\extensions\time.lua, function activate(): ...:\Program Files\VideoLAN\VLC\lua\extensions\time.lua:54: attempt to call field 'add_callback' (a nil value)
lua error: Could not activate extension!
lua debug: Deactivating 'Time'
lua warning: Error while running script C:\Program Files\VideoLAN\VLC\lua\extensions\time.lua, function deactivate(): ...:\Program Files\VideoLAN\VLC\lua\extensions\time.lua:57: attempt to call field 'del_callback' (a nil value)
lua warning: Extension 'Time' did not deactivate properly
lua debug: Extension thread end: 'Time'

Report

C

mederi

6 years ago

Ticket #8097
Lua Extensions, VLC2.1: var.add_callback( ), var.del_callback( ) do not work
http://trac.videolan.org/vlc/ticket/8097

Report

Alequito

6 years ago

Yes, I mean file size (e.g. 20MB or 1GB in my hard disc)

Report

Alequito

6 years ago

I was thinking... If you can get the total time of the movie maybe you can get some "codec information (Media Information)"... duration, resolution and size, and put it on the clipboard.
Or at least, what file contains that Media Information?

readtracksinfo(mrl)
What is it? How I use it?
Sorry, any idea.

Report

C

mederi

6 years ago

Yes, it is possible to put some text information into the clipboard in Windows. There is an extension:
>> http://forum.videolan.org/viewtopic.php?f=29&t=101114&p=341439#p341211
And it is also possible to read the Codec Information. There is an interface script, that displays it on the screen in a playing video by pressing the "t" hotkey:
>> http://forum.videolan.org/viewtopic.php?f=29&t=111880
So duration is available (if it is available :), resolution is available within Codec Information. By size do you mean a file size of a played media file?

Report

Alequito

6 years ago

Using the Video Effects overlay "Add text", in VLC 2.0.8 Twoflower, there are bad points:
●A stronger "heart beating" text effect.
●If you click Stop and later Play, the text disappear.

That's why I prefer the addon.

Report

Chromatic

6 years ago

From what I can tell, this script isn't necessary.

Simply use the Video Effects overlay "Add text" -- and use the variables -- $T and $D .

The $T variable will show the running time of the current video in real time.. and $D if you want it displayed, will show the full duration/length of the video being played.

So it would look something like 00:32:02/01:30:00

If you want the filename shown as well, the variable $N will show the filename.

The add text will let you position it anywhere on the screen.. You can adjust the font and color with the other advanced preferences in VLC.

Take care.

Report

ignorer

6 years ago

is there anyway to get this extension to autostart or autoload when i run VLC

Report

C

mederi

6 years ago

Autostart of VLC extensions is not implemented yet.

Report

ignorer

6 years ago

would i be able to use lua interpreter if it was an .luac module

Report

C

mederi

6 years ago

Compiled (.luac) or non-compiled (.lua) Lua scripts work.

Report

mfakih

6 years ago

Is it possible that when the addon is showing the time , e.g. the elapsed time ([E]), and "Record" is hit (or shirt+r), the time is also displayed in the recorded file?

This is very useful when someone is taking excerpts from a long video file. The excepts will have their time (relative to the original file) within them. VLC does not put the recording time in the filename of the result file, only the system time.

Report

C

mederi

6 years ago

Hi! It is not possible to do it through the Record button. You should stream a transcoded input with Marquee subpicture filter into a file. Please search VLC wiki and forums for more information about Marquee sub filter.

Report

ravemir

7 years ago

I have been using your patch to show milliseconds on my time, but it seems the displayed times are randomly retrieved.

Are these values supposed to be as precise as possible, or are they estimations with varying precision?

Report

C

mederi

7 years ago

The time is actual playback time returned by VLC. If you pause playing video, then you will see stabile actual time position including milliseconds. Even if it is paused, the value is still being refreshed on the screen. For better stability I programmed the sctipt to perform update of time on the screen approximately 2 times per second. You can try to disable it completely for frequent update of time:Quote:function input_events_handler(var, old, new, data)
-- tt=os.clock()
-- if tt>=(t+.5) then -- OSD update approximately 2 times per second instead of 4-5 times
-- t=tt

...

-- end
end

Report

vlcaddon

6 years ago

You should not use os.clock() as the clock() gives the CPU time, which is how much time the thread consumed. This time is a random time depends on how much the program use the CPU. That's why the update jump up and down randomly. And elapse more than a few seconds.

You should use os.time() here with ">".

tt = os.time()
if tt > t then
....

unfortunately, lua has no built in function to retreived time more acturate than 1 sec.

Also the vlc.osd.message should have a durantion value bigger than 1.5 seconds to keep the OSD shows up all the time:

vlc.osd.message(osd_output, channel1, osd_position, 1500000)

Report

vlcaddon

6 years ago

Since vlc itself provide some more precise time value, we can use it here like:

Quote:
...
ttvlc = vlc.var.get(input, "time")
tt = os.time()
if tt > t || ttvlc >= tvlc + .5 then
tvlc = ttvlc
t = tt
...


That will give us some stable update.

[/quote]

Report

C

mederi

6 years ago

Or you can remove that timing part from the script :) It just reduces a refresh period a bit. The extension seems to work pretty well, so it is not necessary there at all. We cannot talk about precision here. You just see a running time on the screen and if you pause a playing video, then actual time appears.

Report

ravemir

7 years ago

Well, I tried your fix but, as you said, it only speeds up the updates, it doesn't show many differences in the update procedure:
If, for example, I click on the skip bar on a position, with the the video paused, it shows a given time for a fraction of a second, and then skips forward to a different time.

I have, however, found out something interesting: if I skip the video to exactly the same spot, the frames present the same timestamp every time, but if I skip even a pixel to the left/right of that spot, the timestamp of the frame changes.

Could this be a problem calculating the time from the frame numbers? Could the frame numbers themselves be computed wrong when I skip the video (and hence, influence the ms values)?

Report

C

mederi

7 years ago

VLC is time-based player. Every change in position iniciates some internal decoding procedures causing various events. The extension just reads actual available value of elapsed time several times per second, so VLC is not automatically sending any change of time value to extension. If the played media is of constant bitrate, then it si possible to convert time to frames (seconds * fps = frames). Then there is also some rounding of a result (math.floor()). If it is not accurate enough, then I am sorry but I cannot do much about it.

Report

blackfeet

3 years ago

Hi mederi,
I'm using the Time addon following instructions to downgrade my version, and I'm happy to be using it. But I have also noticed that the milliseconds change in strange ways. For example, if I am paused and I change the playback speed from 0.33x to 0.50x. Also, the time displayed does not always land on the same milliseconds each time I pause on the same frame. It's usually close each time, but it does make me wonder how it is being calculated. I wonder, as you suggest, can the frame rate be used to calculate the decimals displayed, such as 30 frames/sec displays hh:mm:ss.000, .033, .067, .100, .133, and so on? If these times were assigned to frames and did not change it would remove some ambiguity in the time.
I really don't need accuracy to the millisecond, but CONSISTENCY to the hundredth of a second would give me confidence to know exactly which frame I'm on. I'm no coder, so I don't know how feasible it is what I'm asking for.

Report

C

mederi

3 years ago

I am not VLC developer. The Extension just works with time values provided by VLC.

Report

ravemir

7 years ago

Well, I managed a workaround for this, by using AviDemux, and works perfect. Anyone looking for this feature be sure to check it out.

Report

v3.2 (intf) (27.8.2018) 1 year ago

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

v3.1 (intf) (19.8.2018) 1 year 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 3 years ago

- fixed several bugs in Interface script;

old (before changes on this portal in September 2016) 1 year 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
13
product-maker sldgehammer Oct 25 2019 9 excellent
9 excellent
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 Base: 4 x 5.0 Ratings
yaanu
Sep 28 2019
lukas089
Apr 24 2019
jaramazovic
Feb 14 2019
praneet
Dec 28 2018
engdarkrosealchemist
Nov 13 2018
gu5tavo
Nov 09 2018
artistmatej
Sep 12 2018
arnoldwaswaiga
May 19 2018
neokix
Feb 18 2018
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
GPLv2 or later
version
updated Sep 01 2018
added Mar 19 2012
downloads 24h
93
mediaviews 24h 0
pageviews 24h 522
System Tags addon gplv2-later