VLC lua script to jump 1 second at the beginning of every video

Discuss your Lua playlist, album art and interface scripts.
urs
New Cone
New Cone
Posts: 2
Joined: 25 Sep 2017 09:48

VLC lua script to jump 1 second at the beginning of every video

Postby urs » 25 Sep 2017 10:07

Hi all,

I have a script the should jump 1 second at the beginning of every video.
The video should be played only from the second second on.
I have made a lua script, but it does not work yet:

skipper.lua placed in /home/USER/.local/share/vlc/lua/extensions

Code: Select all

require 'common' local input = vlc.object.input() if input then if skip() then common.seek(2) -- seeks to 2s -- common.seek("50%") -- seeks to middle of video end end
The lua script / extension shows under
Tools > Plugins and extensions > Addon Manager --> skipper.lua (installed)

But the lua script / extension does not show under
Tools > Plugins and extensions > Active Extensions

Can anybody please help? Thanks.

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: VLC lua script to jump 1 second at the beginning of every video

Postby mederi » 26 Sep 2017 10:42

Your script is not Extension. Check the structure here (function descriptor(), activate(), deactivate()):
https://forum.videolan.org/viewtopic.ph ... 44#p343091

urs
New Cone
New Cone
Posts: 2
Joined: 25 Sep 2017 09:48

Re: VLC lua script to jump 1 second at the beginning of every video

Postby urs » 26 Sep 2017 12:41

Hi mederi, OK, thanks for the feedback. I realized that, but is there a way to activated the script / code without going through the View > etc. Menu in VLC?

Anyway. I actually wanted to use the script to get rid of the microphone pop noise when I started the voice recording.
The real solution for my problem with the microphone recording was this (on Ubuntu 16.04, taken from https://askubuntu.com/questions/18958/r ... pulseaudio):

cd /etc/pulse
cp default.pa default.pa.original
sudo pluma /etc/pulse/default.pa

Add the following line anywhere on the file, but I recommend almost at the end where you will find a comment about Echo Cancellation stuff (~line 140):

#---------------------------------------------------------
#load-module module-echo-cancel
#load-module module-echo-cancel source_name=echocancel
#load-module module-echo-cancel source_name=echocancel source_properties=device.description=echocancel
#load-module module-echo-cancel aec_method=webrtc aec_args="analog_gain_control=0 digital_gain_control=1" source_name=echocancel source_properties=device.description=echocancel

load-module module-echo-cancel aec_method=webrtc aec_args="analog_gain_control=0 digital_gain_control=1" source_name=echocancel_source source_properties=device.description=echocancel_source sink_name=echocancel_sink sink_properties=device.description=echocancel_sink

set-default-source echocancel_source
set-default-sink echocancel_sink

##mate-volume-control or start menu 'sound', tab 'Input', set slider to ca. 40%, input level 4 (I I I I).
#---------------------------------------------------------

Have a nice day.
Urs


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 11 guests