Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

VLC - Copy Current Timecode to Clipboard


  • Please log in to reply
3 replies to this topic
Jebus
  • Members
  • 5 posts
  • Last active: Nov 13 2015 03:38 PM
  • Joined: 14 Aug 2015

Just wondering if anyone knows a simple way to take the current time position from VLC and copy that to the clipboard?

 

Thanks



Jebus
  • Members
  • 5 posts
  • Last active: Nov 13 2015 03:38 PM
  • Joined: 14 Aug 2015

Anyone?



garry
  • Spam Officer
  • 3219 posts
  • Last active: Sep 20 2018 02:47 PM
  • Joined: 19 Apr 2005

example with videolan vlc.exe in GUI with progressbar , see playing time and total time

;modified=20151102
name1=Videolan_ActiveX_Test
;xx=C:\Programme_Standalone\VideoLan_VLC\vlc-2.1.3\vlc.exe
xx=%a_programfiles%\VideoLAN\VLC\vlc.exe

Gui,2:default
Gui,2:Font,Cdefault,Fixedsys
Gui,2:Color,Black
Gui,2:Color,ControlColor, Black

Gui,2:Add,ActiveX, x10   y10  w1200 h700 vVlcx, Videolan.VLCPlugin.2

;--------- progressbar ---------------------------
Gui,2:Add, Edit,      x510 y730 w500 h20  readonly
Gui,2:Add, Progress,  x510 y730 w500 h20 vPRBAR backgroundFF7200 range0-100

Gui,2:Add,Edit, cGray right  readonly   x10    y735 w90   h20  vI4            ;--  Playing status
Gui,2:add,text, x400  y732 w35 cWhite right vProcentx
Gui,2:add,text, x445  y732 w64 cWhite       vPlayedTimex
Gui,2:add,text, x1015 y732 w66 cWhite       vLenghtx
Gui,2:add,text, x1    y760 w1219  center cWhite vC1x                           ;-- show playing filename
Gui,2:add,button, x1230 y40   h25 w100 gT1,ONION
Gui,2:Show,x1 y1 w1600 h800 ,%name1%
settimer,aas1,1000
settimer,aas1,off
gosub,T1
Return

2GuiClose:
ExitApp


play1:
gosub,clearx
GuiControl,2:Text,C1x,%f1%
vlcx.playlist.add(F1,"","""""")
vlcx.playlist.next()
return

clearx:
GuiControl,2:Text,C1x,
GuiControl,2:,PRBAR,0
GuiControl,2:Text,Procentx   ,0`%
GuiControl,2:Text,I4,
GuiControl,2:Text,PlayedTimex,00:00:00
GuiControl,2:Text,Lenghtx    ,00:00:00
vlcx.playlist.stop()
vlcx.playlist.items.clear()
return


T1:    ;-- Stream-Video Test
F1=http://videos.theonion.com/onion_video/auto/14309/sony-releases-new-stupid-piece-of-shit-that-doesnt-flv.mp4
settimer,aas1,on
gosub,play1
return


;=========== settimer progressbar ==================
aas1:
gui,2:submit,nohide
bc:=vlcx.input.length
ac:=vlcx.input.time

acc:=(ac//1000)
bcx:=(bc//1000)


if (acc=0 or bcx=0)
   return

SetFormat, float, 02

hours1   := (acc//3600)
minutes1 := (acc - hours1 * 3600)// 60
seconds1 := (acc - hours1 * 3600 - minutes1 * 60)
hours1  +=0.00
minutes1+=0.00
seconds1+=0.00
acc=%hours1%:%minutes1%:%seconds1%
;------- played-time ---------------

hours   := (bcx//3600)
minutes := (bcx - hours * 3600)// 60
seconds := (bcx - hours * 3600 - minutes * 60)
hours  +=0.00
minutes+=0.00
seconds+=0.00
bcx=%hours%:%minutes%:%seconds%
;----- total-time ----------------


ay:=vlcx.input.state
if (ay=0)
   cy=Idle
if (ay=1)
   cy=Opening
if (ay=2)
   cy=Buffering
if (ay=3)
   cy=Playing
if (ay=4)
   cy=Paused
if (ay=5)
   cy=Stopping
if (ay=7)
   cy=Error
if (ay=6)
   {
   cy=Ended
   GuiControl,2:Text,I4,%cy%
   settimer,aas1,off
   GuiControl,2:,PRBAR,100
   GuiControl,2:Text,Procentx   ,100`%
   return
   }
GuiControl,2:Text,I4,%cy%

    RES1:=Round((100*AC)/BC)
    GuiControl,2:,PRBAR, %res1%
GuiControl,2:Text,Procentx   ,%res1%`%
GuiControl,2:Text,PlayedTimex,%acc%
GuiControl,2:Text,Lenghtx    ,%bcx%
return
;=========== END settimer progressbar ===============

;==================== END script ==================================================



Jebus
  • Members
  • 5 posts
  • Last active: Nov 13 2015 03:38 PM
  • Joined: 14 Aug 2015

Thank-you very much for the reply garry. I've played around with what you posted for a bit, and wasn't able to get anything to work. I'm going to abandon this and stick with VirtualDub. I was hoping for a simple solution. I guess this is just over my head if I can't figure it out. Thanks again though!