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 git.opendesktop.org

7
Score 67%
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 "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 \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) 5 months ago

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

Alequito

5 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

5 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

5 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

5 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

5 years ago

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

Report

C

mederi

5 years ago

Autostart of VLC extensions is not implemented yet.

Report

ignorer

5 years ago

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

Report

C

mederi

5 years ago

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

Report

mfakih

5 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

5 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

5 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

5 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

ravemir

5 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

5 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

ravemir

5 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

blackfeet

2 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

2 years ago

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

Report

vlcaddon

5 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

5 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

5 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

jayaprakash

6 years ago

May I know the setting to show the time only in seconds?
Because to create custom playlist it requires time only in seconds. If it could get the time in seconds, the process can be make little bit faster.

Report

C

mederi

6 years ago

Please read carefully my posts above here to add some extra lines of code in the script. Then [E1] tag will be elapsed time in seconds. To edit the script you can use simple text editor like Notepad in Windows, but I recommend you to use Notepad++ that you can find on Internet.

Report

jayaprakash

6 years ago

Good...
How can display the play time of video/music file on the screen in the format of Elapsed/Remaining/Total.
And have to adjust the display font and its size.
Is it possible?

Report

C

mederi

6 years ago

Please, press HELP button and read red and yellow parts.
Then just write some new time pattern "[E]/[R]/[D]" or just edit the predefined one. You can also edit the extension script to add some new predefined pattern in the drop-down list and/or to set your favourite pattern as the default one.
To change the look of time, change subtitle settings in VLC preferences.
This extension shows time in a played video. Some future version of this extension can show time also for music files in the dialog box as a video is not available.

Report

jayaprakash

6 years ago

Thank you very much!
I tried as you guided.
It is working very well.

Report

v3.2 (intf) (27.8.2018) 5 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) 5 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) 6 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;

File (click to download) Version Description Downloads Date Filesize DL OCS-Install
Pling
Details
license
GPLv2 or later
version
updated Sep 01 2018
added Mar 19 2012
downloads today
0
page views today 364
System Tags addon gplv2-later