Jump to time Previous frame v3 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

1
Score 52%
Description:

Jump to time (Previous frame) is VLC Extension that can:
- jump to a desired time in a played media;
- jump forward/backward by a desired time length;
- split-second jumps imitating previous/next frame;*
- show actual playback time with milliseconds;
- use time longer than 24 hours;
- repeat a desired scene again and again (A-loop);
- convert time.
It cannot make a cup of coffee for you :-)

Automatic DOWNLOAD & INSTALLATION of the extension is now (VLC-2.2) available through the Addons Manager in VLC menu (Tools > Plugins and extensions).

Manual DOWNLOAD & INSTALLATION:
DOWNLOAD:
- click the download button below
- save the .zip file
INSTALLATION:
- extract (unzip) the .lua file and put it in VLC subdir /lua/extensions, by default:
* 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/
(create directories if they don't exist)
- Restart VLC or just reload extensions (Tools > Plugins and extensions > Active Extensions tab: Reload extensions button).
USAGE:
Then you simply start the extension by going to the "View" menu or "Vlc > Extensions" on Mac OS X.
Last changelog:

v3.0 (11.2.2018) 33721 10 months ago

- fixed time in microseconds for VLC 3;
- set 1/FPS as default value;

Sonario648

3 months ago

Just wondering, is it possible to change the backwards hotkey? I'd like to make it a single key, rather than having to press Alt and then press the key.

Report

Sonario648

3 months ago

I'd like to change the backwards hot key so it can be easy to jump backwards, like how when you press the E key, you go forward a frame in VLC. I was thinking, perhaps its possible to give this extension the same hotkey feature so we won't have to keep using the dialog box. I just downloaded vlc, and this extension so I'm still trying to figure out what does what.

Report

C

mederi

3 months ago

Custom hotkeys are not available in addons in current VLC version. There are only dialog box button hotkeys (Alt+b) available within Qt GUI. You could try to use an external helper like AutoHotkey on Windows.

Report

Achille

4 months ago

Dear Medari. I thank you so much for this add-on. I have successfully installed it via VLC/tools/extensions/search online... Now, I can replay a part whenever I need it.

But what I can't do is this: How can I indicate to the add-on an exact time to jump up to or to jump back to. Thanks in advance. Greetings from Cameroon.

Report

C

mederi

4 months ago

First of all, if you use the new VLC 3, then you have to download and install the updated script (v3) manually from here. Then the usage is simple. There is more help available in extension's submenu in VLC menu after activation of the extension (when the dialogbox appears go back in VLC menu View > Jump to time > Help).

Report

adamearle

4 months ago

+Maybe call it

1. Time Jumper
2. Time Jog
3. Time Shuffle

Loven this.

Report

C

mederi

4 months ago

Thanks.

Report

enfilade

8 months ago

I installed via the vlc addon manager in osx. The current time has a strange format that I can't understand. I've tried pressing the "time format" button, but nothing ever looks lik hh:mm:ss.ms. I will try downloading directly from here.

Report

enfilade

8 months ago

Ok great, that worked. Nevermind!

Report

abro656

9 months ago

I had to change click_use_jump() on OSX to set the input_jump text as 1000000/FPS instead of 1/FPS... I also configured it to default to `33333.3333` if there was no valid "Frame rate" reported from the input.



if k1=="Frame rate" then
if tonumber(v1) then
textinput_jump:set_text(1000000/v1)
else
textinput_jump:set_text(33333.33333333)
end
return
end
--if tonumber(v1) then textinput_jump:set_text(1/v1) return end

Report

C

mederi

9 months ago

Does the updated script v3 not work on OSX? You need to download it manually here. It is not available through the Addons Manager yet. Then there is a problem with "Frame rate" key, as it depends on VLC interface language. The key is translated in different languages. Therefore I take the first number value for "Frame rate". It works in most cases.

Report

abro656

9 months ago

Oh! I installed directly from the addons manager on OSX... I didn't catch that it might have grabbed the wrong version or something. But it is definitely available for download from the manager in VLC 3.0 for OSX.

Ah, i was wondering why you were getting the frame rate that way... I just made that change because it made more sense to me... the issue with needing to use a million instead of 1 was there.

So yea if you're a doofus like me and grab the wrong version you need to make that change... I'll test what happens installing manually on monday!

Report

RozRoyal

1 year ago

Hey Mederi I LOVE your script! I have a request though, could you make the (Alt + B) (Alt + F) work if the video is on full screen or just make your extension work in the background or add it in the toolbar?

Report

C

mederi

1 year ago

The button hotkeys work only in active/focused dialogbox window. It is not possible to improve the script the way you want it. The scripting VLC in Lua is very limited and require further improvements. You could try to use Autohotkey, the external helper for Windows, to send keystrokes to Jump to time window.

Report

tragicmagic

1 year ago

Thank you for this extension! I have it installed now on Windows 7 on VLC 2.2.6 and it's working perfectly. I read the lua script and found the shortcut/hotkey for alt+b for back and alt+f for forward, and I can now use hotkeys to navigate back and forward a frame in VLC! My only wish is that it would detect the framerate of the playing video and set it to frame format automatically (probably no small feat). But aside from that, it's great! This is a small dream come true. Thanks again!

Report

tragicmagic

1 year ago

Aha! I figured out how to make it default to the 1/FPS time format, and set the 1-frame jump value based on the current video FPS. It just required changing the order of the jumps, and adding the click_use_jump() function to the activate() function:

jumps = { -- drop-down list
{"1/FPS", "vlcfps"},
{"2 sec", 2},
{"20 sec", 20},
-- {"30 sec", 30},
{"1 min", "1:00"},
{"5 min", "5:00"},
{"10 min", "10:00"},
{"1/2 sec", 0.5},
{"1/x", "reciprocal"},
{"1/23.976", 1/23.976},
{"1/24", 1/24},
{"1/25", 1/25},
{"1/29.97", 1/29.97},
{"1/30", 1/30},
{"1/60", 1/60},
}

AND

function activate()
Create_dialog()
click_Get_time()
click_Use_jump()
end

Report

C

mederi

1 year ago

So this is what you need. O.K.

Report

C

mederi

1 year ago

There is "1/VLCfps" in dropdown menu. Then use "1/x" on the returned value to see the fps. Does it return correct fps for your films? Do you want to have automatic update of the time value in the bottom input field?

Report

kinghat

10 months ago

that would be helpful. also, the ability to set the window as always on top?

Report

kinghat

10 months ago

just realized the always on top is not for extensions. sorry.

Report

C

mederi

10 months ago

You can use some external helper/program like DeskPins.

Report

ate9

3 years ago

Hi, mederi (or someone who can commit into the code). Have fixed a bug for all us. Dialog elements colspan and col positions needed some adjustments as two buttons were overlapped with inputs. Here is the right code:


function Create_dialog()
d = vlc.dialog(descriptor().title)

d:add_label(string.rep(" ",27),1,1,1,1)
d:add_label(string.rep(" ",27),2,1,1,1)
d:add_label(string.rep(" ",27),3,1,1,1)


d:add_button("&Get time >>", click_Get_time, 1,1,1,1)
textinput_time = d:add_text_input(Time2string(0), 2,1,2,1) -- "00:00:00,000"
d:add_button(">> &Set time", click_Set_time, 4,1,1,1)

d:add_button("&Time format", click_Switch_time_format, 1,2,1,1)
dropdown_jump = d:add_dropdown(2,2,1,1)
for i,v in ipairs(jumps) do
dropdown_jump:add_value(v[1],i)
end
d:add_button("&Use selected", click_Use_jump, 3,2,1,1)

d:add_button("&Backward <<", function() click_Jump(-1) end, 1,3,1,1)
textinput_jump = d:add_text_input(jumps[1][2], 2,3,2,1) -- default jump length (1-st in the list)
d:add_button(">> &Forward", function() click_Jump(1) end, 4,3,1,1)
end

Report

C

mederi

3 years ago

VLC Extensions dialog box widgets stacking issue in VLC for OS X.

Report

ate9

3 years ago

Stacking focusable elements one on another may seem as a good workaround, still it isn't. If you target multi-platform environment you can't rely on default behavior of such elements stacking, especially if you have no direct control of their z-ordering.

In this case on os x, rightmost buttons were hiding behind inputs only if doing something in that input (focusing, entering text, pressing other button). What happened, I think, OS or library simply recreated/redraw input element, and it became top on a stack. Should it be left at a same creation order, yea probably, you may hope so.

Imho, unless and until vlc lua dialog code implement explicit z-order parameter for elements stacking and vlc coders enforce it's behavior in any of supported os gui - relying, on inexplicit z-ordering (creation order in source code), is erroneous. You simply can't rely on initial elements creation order if something is changing latter. What we have faced here - last focused element in OS X is always on top :), and no way back, button is deep behind with no way to click through. Is it bad default behavior of gui kit? No, actually, it is quite useful and logical behavior - get focused on top.


P.S. simply cols span 1 instead of 2 was not a better solution. Left input twice wide, to keep current time input text visible even if it is shown in its longest format with widest weirdest user font :)

Let it be a feature, not a bug - as we say ;)

Attaching screens:
1. [ just launched ]
http://pasteboard.co/LltRXCg.png
2. [after focusing input, editing, pressing get time]
http://pasteboard.co/LlvaYGk.png
3. [after focusing input, selecting time format from drop, pressing use selected]
http://pasteboard.co/LlwlUgG.png

4. [after a, erroneous stacking workaround, fix]
http://pasteboard.co/Lls1fM0.png

Report

C

mederi

3 years ago

Thank you for the screenshots. Now I see the difference. VLC for OS X is all different from Windows/Linux. Please can you make 2 more screenshots of 2 different variations for me?
Quote:-- text_input: col_span=1; button: col=3;
textinput_time = d:add_text_input(Time2string(0), 2,1,1,1) -- "00:00:00,000"
d:add_button(">> &Set time", click_Set_time, 3,1,1,1)
textinput_jump = d:add_text_input(jumps[1][2], 2,3,1,1) -- default jump length (1-st in the list)
d:add_button(">> &Forward", function() click_Jump(1) end, 3,3,1,1)

-- text_input: col_span=2; button: col=4;
textinput_time = d:add_text_input(Time2string(0), 2,1,2,1) -- "00:00:00,000"
d:add_button(">> &Set time", click_Set_time, 4,1,1,1)
textinput_jump = d:add_text_input(jumps[1][2], 2,3,2,1) -- default jump length (1-st in the list)
d:add_button(">> &Forward", function() click_Jump(1) end, 4,3,1,1)Here is how it looks in my computer: https://cdn.pbrd.co/images/NYpDsUO.png

I would like to make a different layout for OS X and to keep the compact one for Windows and Linux. I would like to ask you whether you could help me to find out the best way how to distinguish OS X from Linux in VLC Lua. It can be useful for other cases/extensions, too. Perhaps there is an environment variable that is available in all OS X systems and not available in Linux, or they have a different value. According to this link: http://www.cyberciti.biz/faq/set-environment-variable-unix/unix-env-printenv-set-command-to-display-environment-variables/ the OSTYPE could be the one I am looking for. Please check its value in OS X:Quote:-- some environment variables like "OS" and "windir" on Windows (OS=Windows_NT; windir=C:\WINDOWS). "OSTYPE" on OS X and Linux?
-- word "Application" in userdatadir on OS X, not on Linux?
d:add_html(tostring(os.getenv("OSTYPE")) .."<br />".. vlc.config.userdatadir(), 1,5,3,1)
Do the ampersands "&" in the buttons work as hotkeys (Alt+G, Alt+S, ...)? Probably not as they are not invisible there. I can remove them from OS X layout.
Which of the buttons is the "submit" button? While I am editing a string in a text_input field or selecting an item in the drop-down list on Windows, then the first button in the code "Time format" is automatically focused and ready for action by pressing the Enter key on keyboard.

Report

v3.0 (11.2.2018) 33721 10 months ago

- fixed time in microseconds for VLC 3;
- set 1/FPS as default value;

5 years ago

v2.1 (28.9.2015) 24717
- compact size layout of the dialog box (a trick with right buttons over spanned text input fields) caused troubles on OS X => no spanning now
- removed ampersands from buttons on OS X as they do not work as hotkeys there
- added "Pause/Play" button

Jump to time 2.0 (11.5.2015) 22382
- reworked and renamed "Previous frame" extension
- libvlc hotkeys (unsupported callbacks since VLC-2.1) replaced with dialog box hotkeys at least

Previous frame 1.0 (10.1.2013)

product-maker adamearle Jul 20 2018

+Maybe call it 1. Time Jumper 2. Time Jog 3. Time Shuffle Loven this.

product-maker 6 6

File (click to download) Version Description Packagetype Architecture Downloads Date Filesize DL OCS-Install
Pling
Details
license
GPLv2 or later
version
updated Aug 28 2018
added Jan 10 2013
downloads today
0
page views today 122
System Tags addon gplv2-later