Announcement

Collapse

TGC Tour - Congratulations!

Congrats to @braycobb (NET) and @beau lester (GROSS) winning the TGC1 2020 SPRING TOUR - Valero Texas Open !

Join this weeks TGC1 2020 SPRING TOUR - Masters Tournament with 3 rounds at Magnolia National 2016 (ProTee) : https://golfsimulatorforum.com/forum...ers-tournament
See more
See less

automatic swing recording and slow motion playback with kinovea

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • automatic swing recording and slow motion playback with kinovea

    I figured I should start a new topic because the other thread has gotten a little long and confusing. Primarily I don't want anyone to think I am using ps3eye cameras for a dual recording setup. i've had a couple of people contact me after purchasing two ps3eyes cameras, asking how to get them working with the dual recording script. while you can get it to work, it is not easy to do. If you are looking to do a 2 camera setup, skip the ps3eye cameras. I would recommend the OV2710 usb cameras from eBay that will do 100fps at 640x480 (does not do 120fps as advertised). There are many lens options and what works for you will depend on how far away you will be placing the cameras. These run at around $40-50.

    If you are looking for a very cheap 1 camera setup the ps3eye is great. Picture quality and frame rate aren't the best and getting 2 to work in kinovea is a pain but they cost less than $10.

    you can run one ps3eye and one OV2710 camera together. i did this for a few months. in this video the ps3eye cam is on the right and the OV2710 is on the left. you can see that the ps3eye is grainy and at 60fps, it is not great but does the job. in addition to a sharper picture and increased fps, another reason I ended up getting two OV2710 cameras is because with one video at 60fps and one at 100fps I couldn't sync the videos up.
    https://youtu.be/d548aRYh5YY

    Here is what it looks like using 2 of the OV2710 cameras.
    https://youtu.be/T5yy5NFuB4Y

    the way it all works is based around kinovea's live delay feature. if you set the delay to 3 seconds, whatever the cameras see in real time shows up on screen 3 seconds later. if you only want to see your swing once, in real time, you could just run kinovea on a second monitor and set the delay to suit your needs. my autoit script automates the recording and playback process. the sound of impact triggers the script which starts and stops the recordings in kinovea, then opens the recordings in vlc. this means that two 6-7mb files are created every time you hit a ball, so you do need to watch your disk space. it works great for me and a few others here on this forum. before I did this, I took a lot of videos with my phone and while the video quality on any modern phone or tablet is far superior to the OV2710 cameras, it is so much more convenient this way.

    what you need to run a two camera setup is the following:
    a good computer (if it can run tgc smoothly, you should be ok)
    2 cameras (either 1 ps3eye and 1 OV2710 or 2 OV2710's)
    active usb extension cable
    audiozonetrigger https://www.zonetrigger.com/sound-detection/
    microphone
    kinovea version 0.8.15 (other versions will not work)
    vlc media player
    my autoit script

    the software is free except for audiozone trigger with costs $25. for hardware costs, you have 2 cameras at $50 each, a microphone for $10, and a usb active extension for $10, so all in $145.
    Attached Files
    Last edited by inorkuo; 12-11-2017, 05:49 PM.

  • Regarding the instructions of Kinovea 0.9.1 - setup I would like to make some comments due to the behavior that I found during testing the new version:
    1. Options/Preferences/Capture/General
      Setting the „Display framerate (fps)“ will NOT change the video acquisition rate. It exclusively influences the refresh-rate of the display (not the recorded video). This value normally should not be higher than 25. To reduce CPU-load it can set to i.e. 5 or even 1.
      Setting the video acquisition frame rate can only be done clicking the „configure camera“ - wrench-icon (bottom left for left camera) and changing the value in the configuration-menu. The resulting framerate that the camera will deliver can be found on the title of the capture-window under „Signal: XX fps“
    2. Options/Preferences/Capture/Memory
      If you allocate ALL available memory to Kinovea, there will be no more memory for the system (all other programs) to work. It may cause a crash of the system. Especially if you are using multiple Kinovea-instances: 1 for recording (it may take ALL memory), 1 for replay (no memory left).
      This memory value is exclusively necessary for the ring-buffer to store the acquired video frames. The necessary value to set here depends on the format and length of video you are recording. To find an adequate value it is the best, to record a video of the desired length using the actual settings and then look on the size of the video plus some „safe“ MB. If the video is i.e. 80MB, a value of 150MB should be far enough. If AVI-files are recorded, 1000MB may be necessary due to the large files that are created. If you use uncompressed files (MKV/AVI), a fast SSD is mandatory.
    3. Using the function „open replay folder observer“
      During testing this function, I found that it may be critical to a crash of Kinovea. It is more save to use 1 Kinovea with 1 Playback screen for EACH video that is created. Using this configuration, the system works very stable.
    4. Furthermore, I found that using 1 Kinovea for 1 recording camera is better than using 2 cameras inside 1 Kinovea. The noise-trigger can be used on multiple Kinovea at the same time, so it is possible to create the trigger on multiple Kinovea that starts at the same moment. Testing has shown a delay between 2 Kinovea of only some milliseconds.
      The reason it it more stable may be that the new version uses separate „threads“ on each function that can be distributed to separate cores of the CPU, working independently at the same time.
    5. There is a new function in Kinovea that helps to differentiate each running instance. If Kinovea is called using command line parameters, a specified environment can be used.
      The format is: path…\kinovea.exe -name CONFIGNAME
      If kinovea starts using this command-line, it will use the configuration of CONFIGNAME
      If Kinovea is recalled later using this command, it will reload the same configuration (Camera settings and ALL Options).

      An options to load 2 Kinovea Instances using 1 Camera each and 2 Kinovea instances using „replay folders“ each would be to load the following sequence:
      ...\Kinovea.exe -name Cam1
      ...\Kinovea.exe -name Cam2
      ...\Kinovea.exe -name Replay1
      ...\Kinovea.exe -name Replay2
      You could create 4 Links on the desktop to achieve this. After calling each, select the appropriate camera to Cam1 and Cam2 and select the replay folders to Replay1 and Replay2. In the Kinovea-Title, you could see the related setting in brackets after „Kinovea“.

      More advanced you could add the command-line option -workspace WORKSPACE
      for the Kinovea-instances doing the replay. Then, the replay function is recalled directly after startup. However, I haven’t tested it so far

    Comment


    • Thanks stell123 for the advise. Would the new kinovea be ok for the non tech savy or is the advise still to go third party? I also found a thread that was using obs with voice attack. Would one be easier for me or would I need to know computers well to make either work? Thanks

      Comment


      • wzjy47
        wzjy47 commented
        Editing a comment
        Hi Jdborg, I'm familiar with computers, but by no means an expert or on the level of a lot of the guys on this forum and I found that the newest version of Kinovea to be the best option. I've been using it for a couple of weeks without any issues. If you go back to post 104, I put together the steps I initially used to set it up. Please also read post 106 from Reiner. He has some additional recommendations on some of the settings. The only thing I haven't figured out yet, is how to get Kinovea to remember the settings so you don't have to set it up each time you open it. Reiner had a suggestion on how to do that on in post 106, step 5 but I haven't gotten it work yet. Another benefit of Kinovea is that it has the audio trigger built in now, so you don't have to buy Voice Attack...Good luck!

    • Originally posted by Reiner View Post
      Regarding the instructions of Kinovea 0.9.1 - setup I would like to make some comments due to the behavior that I found during testing the new version:
      1. Options/Preferences/Capture/General
        Setting the „Display framerate (fps)“ will NOT change the video acquisition rate. It exclusively influences the refresh-rate of the display (not the recorded video). This value normally should not be higher than 25. To reduce CPU-load it can set to i.e. 5 or even 1.
        Setting the video acquisition frame rate can only be done clicking the „configure camera“ - wrench-icon (bottom left for left camera) and changing the value in the configuration-menu. The resulting framerate that the camera will deliver can be found on the title of the capture-window under „Signal: XX fps“
      2. Options/Preferences/Capture/Memory
        If you allocate ALL available memory to Kinovea, there will be no more memory for the system (all other programs) to work. It may cause a crash of the system. Especially if you are using multiple Kinovea-instances: 1 for recording (it may take ALL memory), 1 for replay (no memory left).
        This memory value is exclusively necessary for the ring-buffer to store the acquired video frames. The necessary value to set here depends on the format and length of video you are recording. To find an adequate value it is the best, to record a video of the desired length using the actual settings and then look on the size of the video plus some „safe“ MB. If the video is i.e. 80MB, a value of 150MB should be far enough. If AVI-files are recorded, 1000MB may be necessary due to the large files that are created. If you use uncompressed files (MKV/AVI), a fast SSD is mandatory.
      3. Using the function „open replay folder observer“
        During testing this function, I found that it may be critical to a crash of Kinovea. It is more save to use 1 Kinovea with 1 Playback screen for EACH video that is created. Using this configuration, the system works very stable.
      4. Furthermore, I found that using 1 Kinovea for 1 recording camera is better than using 2 cameras inside 1 Kinovea. The noise-trigger can be used on multiple Kinovea at the same time, so it is possible to create the trigger on multiple Kinovea that starts at the same moment. Testing has shown a delay between 2 Kinovea of only some milliseconds.
        The reason it it more stable may be that the new version uses separate „threads“ on each function that can be distributed to separate cores of the CPU, working independently at the same time.
      5. There is a new function in Kinovea that helps to differentiate each running instance. If Kinovea is called using command line parameters, a specified environment can be used.
        The format is: path…\kinovea.exe -name CONFIGNAME
        If kinovea starts using this command-line, it will use the configuration of CONFIGNAME
        If Kinovea is recalled later using this command, it will reload the same configuration (Camera settings and ALL Options).

        An options to load 2 Kinovea Instances using 1 Camera each and 2 Kinovea instances using „replay folders“ each would be to load the following sequence:
        ...\Kinovea.exe -name Cam1
        ...\Kinovea.exe -name Cam2
        ...\Kinovea.exe -name Replay1
        ...\Kinovea.exe -name Replay2
        You could create 4 Links on the desktop to achieve this. After calling each, select the appropriate camera to Cam1 and Cam2 and select the replay folders to Replay1 and Replay2. In the Kinovea-Title, you could see the related setting in brackets after „Kinovea“.

        More advanced you could add the command-line option -workspace WORKSPACE
        for the Kinovea-instances doing the replay. Then, the replay function is recalled directly after startup. However, I haven’t tested it so far
      Hi Reiner, Thanks for the feedback! When I get a chance, I'll update the setup instructions...I tried the settings above and didn't have any issues. I didn't have any issues with what was in the setup instructions either for what its worth...I was not able to get step 5 to work (I'm guessing its my lack of understanding with respect to command line parameters), but could you possibly go into a little more detail? Here's what I did:

      -Created 4 copies of the Kinovea.exe file (kinovea.exe - Cam1, kinovea.ex. - Cam2...)
      -Created a shortcut on my desktop for each individual .exe file above

      When I go to open these instance again, they all startup from the beginning. They do not appear to be saving the settings (please see attached screen shots).

      Another question I do have with regards to this setup working on recalling the previous settings…With the file naming used, it appears to create a new folder every day, so how will the Replay Manager know to go to the next days folder or will that have to be changed every day? Do I just need to change the Sub Directory path?
      Thanks again for your help!
      Attached Files

      Comment


      • joan
        joan commented
        Editing a comment
        To pass command line arguments from the shortcut you need to right click the shortcut, go to Properties and edit the "Target" field.
        You will use the -name argument, so you need to add -name <NAME> at the end fo the target. Replace <NAME> with what you want but keep the "-name" flag in there.

        The workspace feature (to reload the screens state when running the instance) is a work in progress and just started, so at the moment it's very limited. It only works with playback screens, not cameras, and it doesn't support dynamic paths, so you won't be able to make it automatically point to the recording folder day after day.

    • Hi,
      Joan was faster
      However, you can find a more detailed instruction here that may help.

      using command line-parameters means, that you ALWAYS use the SAME Kinovea.exe but parse some information to the program.
      Do NOT create a new exe file. It is always the same EXE-file.

      Let's say your username is MILLER and Kinovea is installed in the Directory KINOVEA under your User-Account.
      Open Filemanager and navigate to your Kinovea.exe - file.
      Start navigating on c:\users...
      (eventually you have to tell your Filemanager in options to show all "hidden" files to find the directory)

      (by the way it makes things much easier if you have a separate drive letter, i.e. d:, and install Kinovea from the ZIP-File in
      d:\Kinovea, store your videos in d:\swing_videos1, d:\swing_videos2 etc.. If you have only one drive letter installed on your system,
      you might also use c:\Kinovea etc.)


      if Kinovea is installed under you username the path to Kinovea might be like this:
      c:\users\Miller\Kinovea\Kinovea.exe

      to create a LINK on the Desktop to that Kinovea.exe you can:

      Press ALT and Drag/Drop the kinovea.exe file to the desktop.
      A Link will be created on the desktop.
      Rename the link to i.e. Kinovea MASTER.

      Right click on this link and select properties.
      in the Target-Field you will find the Kinovea.exe file including the path.
      (for example c:\users\Miller\Kinovea\Kinovea.exe)

      Click in this field and go to the right end using the cursor.
      Append a space char and type -name Master
      Be shure that there is NO " (quotation mark) somewhere !!
      It the target field it should look like this:
      c:\users\Miller\Kinovea\Kinovea.exe -name Master

      Save the changes.

      If you now click this Link, Kinovea will start up and shows:
      Kinovea [Master]
      in the title bar.

      Select i.e. "one capture screen"
      Drag/Drop a camera to the record window
      Do some settings in Options/Preferences (i.e. Video directory, videoname etc.)
      Close Kinovea

      Recall it using the link you have created and you will see that all Options you have set at first call are still there.
      It also stores the last settings of the camera you selected, but does NOT store the assignment of a specific camera to a record panel.

      Repeat the LINK procedure for every instance of Kinovea you would like to create, giving different name.

      The "Master" above only is an example.
      Every Name can be used instead of MASTER (i.e. CAM1 or CAM2 etc.), but I would use allowed literals that can be used in filenames (a-z,A-Z,_) but no spaces.
      Also do NOT Use [,],-,.,{,},%,&,$,",! (maybe not a complete list).


      Comment


      • wzjy47
        wzjy47 commented
        Editing a comment
        Thanks! Unfortunately, I still couldn't get it to work...When I try to remove the "" around the path int he Target field (Properties of the shortcut created), it give me an error "The name "C:\Program Files\Kinovea\Kinovea.exe -name CAM1 specified in the target box is not valid...".When I add the "" back around the path ("C:\Program Files\Kinovea\Kinovea.exe" -name CAM1), it lets me save it and then when I open Kinovea using the link, I see Kinovea [CAM1] in the upper left corner of the screen. I tried to create 1 capture instance, changed the settings, closed the program and when I reopened it, none of the settings were saved. The "Kinovea [CAM1]" was still in the upper left corner, but everything else was back to the default settings. I tried to create a 3rd shortcut, as a playback instance. It didn't save its settings either. I named it REPLAY1, but the upper left corner said "Kinovea [3]"...I'm not sure where that came from...Thanks again for your help on this!
        Last edited by wzjy47; 01-15-2020, 11:02 PM.

    • Regarding your question .pdf

      To my taste I leave the "Sub Directory" field empty. It may be easier to find your videos.
      Fortunately, Kinovea numbers each new video file that is created.
      If you use the namespace function as described, Kinovea will store the last video-filename, so there is only small danger of having filename conflicts.

      Comment


      • Hi Inorkuo,
        First, thanks for all the posts you do on here. Was invaluable in getting my setup to where it is now!

        I've found your two camera instructions and downloads but I only have 1 camera behind - do you have a separate download for this?

        Thanks in advance,

        Mike

        Comment


        • inorkuo
          inorkuo commented
          Editing a comment
          use the latest beta version of kinovea. it has everything built in. my script is obsolete now.

        • Waheeden
          Waheeden commented
          Editing a comment
          Not sure what I will do with my AutoIt skills anymore!

      • Here's a OV2710 and OV4689 comparison that I have been meaning to post for a while:

        https://youtu.be/1OFAEtGBfSI

        OV2710 (170deg lens 640x480 120fps) vs OV4689 (180deg lens 1280x720 120fps - running fixed frame rate firmware)

        Cameras are about 5ft from the ball. The 180deg lens is only necessary with the long shaft of the driver. For 3W and shorter clubs, the 170deg lens can capture the full swing.
        Each camera records in its own instance of Kinovea 9.1. Both cameras deliver a true frame rate of 99fps (as verified with the running clock in the foreground, and the frame counter in the replay window: 247 frames / 2.5 seconds = 99fps).

        A third instance of Kinovea with two Replay Folder Observers is used for automatic replay.

        Comment


        • chicub15
          chicub15 commented
          Editing a comment
          Disregard- I found both the 2710 and 4689 with 170deg lens after some additional digging. Thanks!
          Last edited by chicub15; 02-10-2020, 09:00 PM.

      • Anyone and espec inorkuo

        Thanks for your comparison ^^^ Waheeden

        Is there a way to use a lengthy tethered micro-mic of some kind (or wireless mic?) set next to the ball to start swing recording vs. picking up background noise from the pc/cam mic? Way too much background noise here.

        Could the ProTee sensor mat's mic somehow be incorporated to be used as the mic to launch Kinovea recording?

        Thanks in advance.
        Last edited by DejaVu; 02-12-2020, 04:51 PM.

        Comment


        • Waheeden
          Waheeden commented
          Editing a comment
          I use the mic on an old USB Logitech webcam. I set it next to the Face On camera.

          The mic on the laptop does pick up too much background noise.

        • DejaVu
          DejaVu commented
          Editing a comment
          Thanks Waheeden My cams (2710's) should be in on Friday. Looking forward to getting them up and running, but with eyes squinting at it all if that makes any sense.

      • Hi all, I have my setup working per instructions and I can select my OV2710 cameras at 640x480 120fps. The issue is that when I record my iPhone stop watch (which shows 100ths of a second) I seem to actually be recording at 30fps or so (the 100ths numbers skip anywhere from .02 to .05 each frame). AM I missing a setting? Any help would be much appreciated!

        Thanks!

        Comment






        • Hi, it is a behavior of your iPhone. The display-refresh rate of the iPhone is below 100fps, so the recorded video doesn't show you the real fps-value. A better way to get the real fps-rate, record a video of a given time duration, i.e. 2 seconds. Set the Options to show you the number of recorded frames (see attachment). If you will find about 200 frames, the recording frame rate should be correct.
          Which version of Kinovea you are using?




          Click image for larger version

Name:	Kin-Options-Framenumber.JPG
Views:	194
Size:	21.9 KB
ID:	250978

          Comment


          • Originally posted by Reiner View Post



            Hi, it is a behavior of your iPhone. The display-refresh rate of the iPhone is below 100fps, so the recorded video doesn't show you the real fps-value. A better way to get the real fps-rate, record a video of a given time duration, i.e. 2 seconds. Set the Options to show you the number of recorded frames (see attachment). If you will find about 200 frames, the recording frame rate should be correct.
            Which version of Kinovea you are using?




            Click image for larger version

Name:	Kin-Options-Framenumber.JPG
Views:	194
Size:	21.9 KB
ID:	250978
            Thanks for taking the time to respond! I followed your suggestions and I am indeed getting about 100 fps. I also did the math and it seems like a club moving 70mph will move about 1 foot in 1/100 of a second. So I guess the blur I am seeing at impact is correct it is just that these cameras cannot "freeze" the motion at these speeds.

            Which leads me to a follow up: Does anyone have a camera suggestion for this Kinova setup which will enable a better freezing of motion? I'd really like to be able to see my downswing a little clearer if possible.

            And thanks again to Inorkuo for putting all of this together!

            Comment


            • pathfindr
              pathfindr commented
              Editing a comment
              To freeze the swing with no motion blur, use higher shutter speed. In Kinova, change the Exposure time for the camera to as short as possible. (Shorter exposure forces the camera to use faster shutter speed) I find that with OV2710 cameras, I have to increase the Gain and need to have a lot of light so that the video is not too dark. Unfortunately, I couldn't quite freeze the club when using the OV cameras. I heard that the black and white version seems to be able to handle low light better than the color version. I ended up using a GoPro Hero 7 Black to record my swing. (Not integrated with Kinova). With the Hero 7, I can manually change the shutter speed to 1/1920 second at 240 pfs at 720 and can freeze the club with no motion blur. I also added a 45kLM LED light. The light has a constant current driver and won't cause flickering when recording at high speed. This is the light I use. https://www.amazon.com/gp/product/B07XG37F14

          • Hi Gang! Great info here! I just upgraded to the beta of Kinovea and I can't click on the wrench to configure the camera settings so I have no video at all. Everything was working fine with the stable release but I wanted to try the audio trigger. Am I missing something silly here? I have a PS3 eye camera and an OV2710. Thanks in advance!!!

            Comment


            • joan
              joan commented
              Editing a comment
              The way to select and open cameras has changed. There is a camera tab in the explorer, at the left of the screens (View > File explorer in case it's hidden). This should list the available cameras and you can double click or drag and drop from there.

            • StodgyBarley
              StodgyBarley commented
              Editing a comment
              Thanks so much Joan! I'll check that out! Appreciate it!

          • I have been following this thread for a while now and am finally ready to order cameras. It seems like most people are using the OV2710 which I think is at least several years old. Are there any better cameras for swing capture in $100 price range?

            ​​

            Comment


            • inorkuo
              inorkuo commented
              Editing a comment
              Kayeton black and white global shutter 120fps usb camera on amazon or eBay.

            • StodgyBarley
              StodgyBarley commented
              Editing a comment
              Thanks Inorkuo! Sounds like black and white is better for picking up the swing then?? I'm also interested in some new cameras.

            • Reiner
              Reiner commented
              Editing a comment
              I’m using the OV2710 at 640x480, 100 fps and
              the following Kayeton GLOBAL shutter camera at constant 1280 x 720p, 120fps:

              https://www.amazon.com/Global-Shutte.../dp/B07GVDWB6R

              It also works under lighting of about 60-80 Watt (LED).

              Of course, both cameras show significant amount of blurring. I didn’t find a way to control the shutter speed.
              To get a real crisp image, you definitely need an IDS/Basler or equivalent AND a lot of flicker free lighting when going down to 500 or 200 microsecond shutter speed.

          • Question to post
            https://golfsimulatorforum.com/forum...964#post253964
            #116.1 pathfindr

            The LED light you mentioned has a very low price compared to the power. It sounds very interesting. Are you sure that it is driven by constant current? Looking at the specificiation there is nothing written. Also the flicker-index is not mentioned. Do you have an example-video using this light at 240fps without using additional daylight?
            Thanks

            Comment


            • Hi everyone! I have my 2710 camera working well in the beta version of Kinovea but I can no longer see my PS3 camera. I know the camera is working due to other software picking it up. Any help is appreciated. Thanks!!

              Comment

            Working...
            X