Image 01
profile-image

dementia

Time v3.2

VLC Extensions 174 comments

Score 80.0%
Sep 01 2018
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)
- May 03 2019
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 - May 03 2019