Windows Entertainment and Connected Home

How to organize, access and enjoy all of your media in and around your home

Implementing simple Fast Forward and Fast Rewind for any Video file on MCE

  • rated by 0 users
  • This post has 13 Replies |
  • 3 Followers
Page 1 of 1 (14 items)
  •  

    For those like me who want the ability to FFW and Rewind on any video file on XP Media Center, here is a simple solution using Autohotkey script. This would work for Vista too, but there is a more elegant plugin for Vista using FFDSHOW see here: http://damienbt.free.fr/ )

    First in case like me you did not realize you can use the SKIP button to move forward and backward in any video file, now you know. The Forward Skip (|>) is the same as Ctrl+F and the Backward Skip (<|) is the same as Ctr+B.

    By setting the interval in the registry to whatever time you want, this is by itself a good solution. The interval setting is located in the following registry keys:
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Media Center\Settings\VideoSettings]
    InstantReplayInterval is the interval for Skip Backward in millisecond (decimal value)
    SkipAheadInterval is the interval for Skip Forward in millisecond (decimal value)

    By default they are set at 8 and 7 seconds, I personally set Skip Ahead to 15 seconds.

    Now if you want to use that to move forward or backward for a large period of time, it becomes cumbersome to click hundreds of time on the Skip button.

    So below is an AutohotKey script that remaps keys 1, 2, 3 of the remote to RWD, Stop, FFW.  In order not to loose the ability to use the 1,2,3 keys, the script actually sends both the original key value, plus the FFW or Rewind command, so you can still use the number key to type in a channel number. I have that script installed in my startup folder so it runs automatically when the PC boots.
    When media center is running, the script will do the following:

    Typing 3 will send 3 but also starts sending up to 100 Forward Skips, typing 2 will send 2 and stop the FFW.

    Typing 1 will send 1 but also starts sending up to 100 Bacward Skips, typing 2 will send 2 and stop the RWD.

    Autohotkey script:

    --------------------------------------------------

    SetTitleMatchMode, 2
    DetectHiddenText, On
    #NoEnv
    #Persistent
    SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.


    #IfWinActive ahk_class eHome Render Window  ; So it only runs when Media center is active
    ~1:: RWD() ;Uses 1 key to fast rewind
    ~3:: FFW() ;Uses 3 key to Fast Forward
    return

    FFW()
    {
    loop 100
     {
         Send ^f
         Sleep 30  ; milliseconds between keystrokes defines the speed of FFW and RWD
     if getkeystate(2) = true ; Uses 2 Key to stop FFW or RWD
     break
     }
    }

    RWD()
    {
    loop 100
     {
         Send ^b
         Sleep 30  ; milliseconds between keystrokes defines the speed of FFW and RWD

     if getkeystate(2) = true ; Uses 2 Key to stop FFW or RWD
     break
     }
    }

    --------------------------------------------------------
    You can of course decide to use different keys to do the same, by editing the script (like use *, 0, #)

    Personally, I actually use * to switch DVD language, 0 to cycle through Zoom factors, and # to exit media center. So my actual script is:

    -------------------------------------------------------- 

    SetTitleMatchMode, 2
    DetectHiddenText, On
    #NoEnv
    #Persistent
    SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.


    #IfWinActive ahk_class eHome Render Window  ; So it only runs when Media center is active
    #::  ;Exit media center
    Send !{F4}
    *::  ;Switch Subtitles
    Send ^u
    0:: ;Cycle Zoom factors
    send ^+z
    ~1:: RWD() ;Uses 1 key to fast rewind
    ~3:: FFW() ;Uses 3 key to Fast Forward
    return

    FFW()
    {
    loop 100
     {
         Send ^f
         Sleep 30  ; milliseconds between keystrokes
    if getkeystate(2) = true ; Uses 2 Key to stop FFW or RWD
    break 

    }
    }

    RWD()
    {
    loop 100
     {
         Send ^b
         Sleep 30  ; milliseconds between keystrokes
    if getkeystate(2) = true ; Uses 2 Key to stop FFW or RWD
    break 

     }
    }

    -------------------------------------------------------------------

     If you do not want to install Autohotkey on your system, these scripts can be made into an executable. I can generate the executable and send it to you if you send me a personal message.

     

  •  

    Here is a new and improved version of the script, Implementing the full 3 speeds fuctionnality for FFW and RWD on any video and TV file.

    Press 3 once FFW at speed 1, second time speed 2, third time speed 3, 4th time stops FFW.

    Press 1 once RW at speed 1, second time speed 2, third time speed 3, 4th time stops RW.

    Pressing 2 at any time stops FFW or RWD and goes back to play

    Adjust speed by adjusting the timings in the script, and setting the Skip intervall in the registry (see previous post)

    -----------------------------------------------------

    SetTitleMatchMode, 2
    DetectHiddenText, On
    #NoEnv
    #Persistent
    SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.

    ; Forward Speeds (Skip interval timings in milliseconds)
    FW1 := 500
    FW2 := 150
    FW3 := 50

    ; RWD Speeds (Skip Interval timings in milliseconds)
    RW1 := 250
    RW2 := 80
    RW3 := 30


    Wait:   ;Monitor Media Center window to stop any remaining Timers
    WinWait, Media Center
    WinWaitClose, Media Center
    {
    SetTimer, FWS, % x := "off"
    SetTimer, RWS, % y := "off"
    Goto, wait
    }

    #IfWinActive ahk_class eHome Render Window
    ~2::   ; Remove the ~ not to send the 2
    SetTimer, FWS, % x := "off"
    SetTimer, RWS, % y := "off"
    return

    ~3::    ;Fast Forward (remove the ~ not to send the 3)
    SetTimer, RWS, % y := "off"
    If (!x || x = "off")
       x := FW1
    Else If (x = FW1)
       x := FW2
    Else If (x = FW2)
       x := FW3
    Else
       x = off
    SetTimer, FWS, %x%
    return

    ~1::    ;Rewind (remove the ~ not to send the 1)
    SetTimer, FWS, % x := "off"
    If (!y || y = "off")
       y := RW1
    Else If (y = RW1)
       y := RW2
    Else If (y = RW2)
       y := RW3
    Else
       y = off
    SetTimer, RWS, %y%
    return

    #IfWinActive

     

    FWS:
    Send, ^f
    Return

    RWS:
    Send, ^b
    Return

    ------------------------------------------------------

  •  

    This is a great solution, and works perfectly. I am using * # and 1 for RR/FF/Stop. Works great. Thanks for taking the time to post this!!!

  •  

    hi, how do i run this script at startup?  is this a .BAT file? i'm not a MCE expert, please help... thanks.

  •  

    http://www.autohotkey.com/ has all the information you need.

    Setup in Bio
  •  

    hi, thanks for your reply. i just looked and the instruction says:

    1. Find the script file, select it, and press Control-C.
    2. Right-click the Start button (typically at the lower left corner of the screen) and choose "Explore All Users".
    3. Navigate to the Startup folder inside the Programs folder.
    4. From the menu bar, choose Edit -> Paste Shortcut.  The shortcut to the script should now be in the Startup folder.

    However, Win 7 won't allow the shortcut in that folder. i could just copy the script file, the whole thing, but then i don't know what extension the script should be for Win 7 to run. Is it ".BAT" or ".EXE" or what is the extension?

     Thanks.

  •  

    Win7MCESSK
    what is the extension?

    .ahk

    Setup in Bio
  •  

    Doesn't Win7 support FF & RW on most formats natively out fo the box?

  •  

    no it does not. it has skip, but if you press it and hold it down then it'll go to the end of the file and player stops. it does have fast forward, but it does nothing for video files, only tv tuner it fast forwards.

  •  

    i guess i could put the .ahk of the script above and put it at startup, but it's not an exe or bat, so i'm not sure how Win 7 will launch this as a script...

  •  

    If you have installed AutoHotkey on your system, you just need to put the .ahk script file in the startup folder.

    If for some reason it does not accept it, Autohotkey comes with a utility called convert ahk to exe, that will create an executable (,exe) from the .ahk script, and you can then put this exe in the startup folder.

    Let me know if you have any problems

  •  

    thanks for your help. it did work, but #2 doesn't work very well. if #3 is pressed ONCE, #2 stops it, but if #3 is pressed twice or three times to speed up, #2 does NOT stop it. Is there a way around this?

    Thanks!

  •  

    Strange, as I do not have that issue. I am using the script without the ~, so Try removing the ~ at the beginning of the 1, 2 and 3 line (it will not send the characters). and see if it makes a difference.

    ~1::  becomes 1::

    ~2:: becomes  2::

    ~3:: becomes  3::

    Also, check if you have the problem with both double FFW and double fast rewind.

    If you are pressing the keys quickly one after the other make the test below to see if waiting between key press fixes the problem.

    start a movie. press 3 to start FFW, after a couple of seconds press 3 again to go double speed. After a couple of second press 2 and see if it goes back to play

    Then do the same for triple speed (wait a few seconds after triple speed is active before pressing 2), and see if it makes a difference.

    Then make the same test with the fast rewind (double and triple), waiting a couple of seconds before pressing 2.

    Let me know how it goes, and I'll see if I can think of something.

  •  

     having problems with #2

Page 1 of 1 (14 items)