Announcement

Collapse

TGC Tour 2021-2022

Join the most exciting Golf Simulator Tour!

Tournaments are open to golfers of all ages and skill levels. Get in on the excitement of Golf Simulator Tours, Challenges and Tournaments: https://golfsimulatortours.com
See more
See less

2021 Primer on Dual High-Speed Video Recording of a Golf Swing

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

  • 2021 Primer on Dual High-Speed Video Recording of a Golf Swing

    This topic has multiple entry threads going back years. I acknowledge pioneer Inor Kuo and folks behind Kinovea software (kinovea.org). Making dual high-speed video recordings of a golf swing is now much easier than it was a few years ago. This 2021 description updates and simplifies the procedure.

    Needed
    1. Two Video Cameras (requirements later. I use Daheng 1440 x 1080; 227 fps capable, monochrome with f/1.2 or 1.4 lenses - all important choices)
    2. Computer with two USB 3 ports
    3. Software: Kinovea (free download; Beta 0.9.3). Disregard older advice that the Beta does not work for the golf swing – it does now.
    No Longer Needed
    • Audio Zone Trigger – now built into Kinovea Beta
    • VLC Media Player (free download)
    • A separate microphone. I use my laptop microphone easily.
    Information below contains the following:
    1. Steps to Make Dual Recordings and Save to Sequential Files
    2. How to Review Kinovea Videos after Each Shot
    3. Equipment and Software
    4. Dual Video Recording with FSX 2020
    Steps to Make Dual Recordings and Save to Sequential Files
    1. Plug cameras into computer USB 3 ports.
    2. Start Kinovea program Beta 0.9.3.
      • Select two capture windows (“screens” in software, I use “windows” to avoid confusion with dual computer and projector screens of golf sims)
      • Open one camera on one window and the other on the other window. You should see real time videos, likely dark at first
      • Click top bar of each capture window to set camera acquisition: Exposure and Gain determine allowable frame rate. High frame rate makes bigger files and requires more buffer. To get 227 fps Exposure is under 4300 micro-seconds (1/framerate = 1/227 sec). My Gain with Exposure=4300 microseconds is 17-18 dB (out of max 24). Stop motion better with lower Exposure (e.g. 1000 microsec = 1/1,000 s) but more Gain (3 dB per doubling/halving). If I don’t need 227 fps, I set Exposure to 10,000; Gain to 8-10 for 100 fps (or 20,000 and 3 for 50 fps), so there are choices depending on requirements. A color camera needs 5 dB more Gain for a given shutter speed due to the color filter over the sensor.
    3. Set following Kinovea Options - Preferences
      • General Tab: allow multiple instances of Kinovea to review videos after each shot
      • Drawings Tab: tick Opacity box so drawings are visible for entire video
      • Most important settings are in Capture sub-menus:
        • Capture - General: Record uncompressed video (no time to compress); Uncompressed Video Format MKV.
        • Capture - Memory: Set Delay buffers. 1.5 GB allows 2 seconds delay each camera at 227 fps. Change here for other scenarios
        • Capture - Recording Mode DELAYED; I set high speed camera frame rate threshold = 235 with display framerate of 30
        • Capture - Video Naming: set for each camera Root Directory (e.g. Kinovea\Swing Videos folder in Documents); subdirectory for each day as %year-%month-%day; Video Name as e.g. “Rear 1” or “Front 1” (can be changed later; incremented automatically).
        • Capture - Automation CRITICAL: Enable Audio Trigger; choose input mic (I use laptop mic); set Threshold (start at 56); stop recording duration of 3.5 seconds; I check Ignore File Overwrite.
      • Save updated Preferences to remain as defaults.
    4. In each Capture Window, set Delay to 2 secs. Videos go into RAM buffer so impact activates sound trigger recording including the prior 2 seconds for a total of 3.5 seconds set in the Automation Tab of Capture Options. If buffer is too small, delay will be limited - must enlarge buffer. [To use cameras as two-way delayed “mirror”: turn off trigger and set delay to 4 seconds: then project video onto hitting screen , take swings and look to see two views at real speed 4s later.]
    5. In each Capture Window, make sure video saving labels for front and rear are correct for each camera. They easily get switched around depending on the order the computer found cameras or the order Kinovea connected. If starting a new session, with, e.g. a wedge, use “PW Front 1” and “PW Rear 1” in Capture Window Video Name boxes and they will be incremented after each save.
    Now swing and/or hit balls. You don’t have to do anything to Kinovea UNLESS you want to review videos for each shot – see later. THIS procedure rapidly saves a series of videos for subsequent examination. The later procedure is for looking at each video pair after each shot. Set up the computer for dual display and put Kinovea on the computer and your golf sim on the hitting screen and happily hit balls as long as HD space allows.

    If Trigger Threshold is too low, you may accidentally record unwanted 3.5 second clips. Usually the system carries on and numbering remains consistent. Once in a while, the two video file names get out of sync (e.g. “front 31” and “back 32”), so it is good to keep checking on capture windows.
    If Trigger threshold is too high, you can miss some swings like short wedges, so I set Options - Preferences - Capture - Automation Threshold to 25 for a series of short shots. For putting, speak loudly after the stroke.

    When you want to shut down, close Kinovea and unplug cameras.

    How to Review Kinovea Videos after Each Shot

    Best approach is to run two instances of Kinovea. Flipping back and forth from two capture windows to two playback windows in a single instance resets the Delay (sometimes video file name). To start 2nd instance I right click on Kinovea taskbar icon; select Kinovea.


    Equipment and Software

    Video Cameras

    Daheng MER2-160-227U3M cameras came from www.get-cameras.com. They are one of 3 types internally supported by Kinovea; 1/3 cheaper than others using Sony IMX273 sensor; global shutter for fast motion. With 10 ft USB 3 cables, tripod mount, CS lens mount, shipping, currency, duty and tax they cost Can $500 each. Options such as IO are not required. Get-cameras.com technical support is quick, thorough and effective.

    1440 x 1080 resolution and 227 FPS is the max combination of resolution and shutter speed to fill USB 3 carrying capacity. 1440 x 1080 allows zoom to see detail. U3M model is monochrome, but color U3C model is same $. Color needs 5 dB higher Gain (max is 24; I operate mono high speed at 18). 3.5s of uncompressed mono video at 227 fps is 1 GB. Color files may be larger. CHECK if it matters!

    Much cheaper and less functional cameras are available as discussed on older golfsimulatorform.com topics:Consult them for camera alternatives. Uneekor Swing Optix and Swing Catalyst use more expensive cameras based on the same Sony Sensor.

    Lenses
    Get-cameras.com does sell lenses but I got my CS mount lenses elsewhere: 2.8 mm f/1.2 (Can$12 from Alibaba) and 3.3-12 mm f/1.4. (Can$65 Arecont MPL33-12A from PC Canada). 3.8-4 mm suffices for cameras 8-10 ft from the golf swing (2.8 mm would work 4-5 ft away). All these lenses have some distortion (more with smaller focal lengths), so if accuracy is important to measure angles or distances, get a non-distortion lens (f-stop might go up to f/2.4). Low f number is important to limit Gain: f/2.4 vs f/1.4 costs 5 dB Gain. Color camera and f/2.4 lens might never achieve maximum frame rate. If frame rate is not important don’t buy these cameras.

    Lighting: My setup has 10,000 uneven lumens in a 20 x 20 ft room. Monochrome means I should wear medium tone clothing to separate myself from dark tones of green hitting mat.

    Monochrome CMOS Sensor IR sensitive: shows flashes from IR based Launch Monitors like GCQuad. Not good to aim a camera directly into GCQuad strobe.

    Computer: Dell G7 Gaming Laptop with 1 TB SSD, 16 GB of RAM, i7-10750H processor, Nvidia RTX 2060, built-in mic and 3 USB 3 ports.

    Software
    • Kinovea (free download from kinovea.org; Beta 0.9.3). Disregard older advice that the Beta does not work for the golf swing – it does now.
    • Daheng Galaxy (Free camera controller from Daheng or get-cameras.com). Use it to set Exposure, Gain and Focus before closing Galaxy and opening other software (e.g. FSX 2020) that can’t control the cameras. Two programs cannot demand access to the same cameras, so Galaxy must be closed after setting the parameters.
    Dual Video Recording in FSX 2020
    1. Using Kinovea or Daheng Galaxy open each camera and set the Exposure/Gain to achieve 30-60 fps. Close this program to release cameras
    2. Start up FSX 2020. Go to Setup Cameras menu. Refresh Cameras. Choose Cam 1. One of the options is Daheng 1 (first camera found by operating system) – choose it. Select the box for cam 2. I don’t know why Daheng Cam 2 is available (if you get DirectShowGX from get-cameras.com), but doesn’t show any image in FSX 2020. However, the laptop camera is available and could be used for front view. Select cam 2 and close Setup menu.
    3. Hit golf shots; videos are saved TEMPORARILY in Program Files (x86)\Foresight Sports Experience\Swing Videos as mp4 files YYYY_MM_DD_HH_MM_SS.00n where n is cam 1 or 2.
    4. Review videos for any shot within FSX 2020 during the session using normal shot analysis pages.
    5. To save videos, copy them elsewhere to avoid deletion BEFORE CLOSING FSX 2020. Foresight uploads videos to FSX Live (if connected), from where you can download them later. Save a round trip into cyberspace by copying them out before closing FSX 2020. Maybe someday Foresight will let us export directly from FSX 2020.

  • #16
    Great tutorial. Followed this to get my setup working. Only issue I have is my 2MP ELP camera is really bad. Looks like I need something at 180+ fps

    Comment


    • #17
      This is something that really needed to be done. Kinovea is a pretty daunting program, and the setup is not straightforward at all (things like "Drawings Tab: tick Opacity box so drawings are visible for entire video"). I got set up yesterday, and had to work off several different old threads when getting things up and running. This really captures the basics very cleanly. Great work!

      The thing that surprised me was that my laptop is DEFINITELY being taxed when recording and playing back in 2 separate instances - and I have an almost new MSI GP66 gaming laptop.

      Core i7-11800H 8 Core
      16GB (8G*2) DDR4 3200MHz

      My issue thus far:
      - When scrolling through replay in a second Kinovea instance - the video often cuts out / misses frames / freezes
      - When recording - the frames don't sync perfectly like I would expect (one camera is ~0.1 seconds ahead of the other). Each time I have to manually go frame by frame and sync the two views.

      Comment


      • Snipe
        Snipe commented
        Editing a comment
        Solved for the most part. The primary issue was that each of the cameras had a slightly different exposure setting leading to different streaming rates.

    • #18
      Snipe - did changing the exposure setting(s) fix all of your issues? I'd be curious what the specified requirements are for the Kinovea software you are using if you have an i7 - 8 core and 16 GB of RAM and are still having problems? Is your computer hard drive SSD and which brand? Working with tons of video would probably require SSD of some form to handle the rapid transfer of data from storage as you are working with it.

      Comment


      • #19

        Originally posted by Brettster View Post
        Snipe - did changing the exposure setting(s) fix all of your issues? I'd be curious what the specified requirements are for the Kinovea software you are using if you have an i7 - 8 core and 16 GB of RAM and are still having problems? Is your computer hard drive SSD and which brand? Working with tons of video would probably require SSD of some form to handle the rapid transfer of data from storage as you are working with it.
        I'm running an MSI GP66 Leopard I bought recently at Costco:

        https://www.costco.com/msi-leopard-g...100792120.html

        It has a 1TB NVMe Solid State Drive.

        I'm only recording 1.5 second clips - though I do have 2 instances of Kinovea running (one to record and one to auto-replay). The program is pretty buggy overall, but absolutely amazing given it's price tag. Just an amazingly generous piece of kit.

        Issues that persist:
        - Playing back video chokes pretty easily. I can't smoothly scroll through frames as it gets laggy or goes black
        - The "workspaces" don't load properly. I have two cameras set up, and without fail only one loads when I open the program. I have to manually go in and start the second
        - The frames never align perfectly. I *think* it's either because of slight variations with stream rates - or perhaps the program has to give the capture sequentially instead of in parallel? Idk - but I never get frames that align perfectly

        Overall I'm extremely impressed with the cheapo setup and amazing program, but that doesn't mean I don't want seamless perfection.

        Comment


        • pathfindr
          pathfindr commented
          Editing a comment
          From my experience, if you have 2 cameras with same name like "USBcam", workspaces won't load properly. Change the names of the cameras so that they are unique.

      • #20
        Playing back video chokes pretty easily. I can't smoothly scroll through frames as it gets laggy or goes black
        This is usually an available RAM issue. You can adjust the allocated RAM in the settings under Playback. Be careful though, depending on the file size of each playback you may need to increase system RAM. Otherwise, I would check the CPU utilization while you fast scrub a playback and see if you are peaking the CPU.

        The frames never align perfectly. I *think* it's either because of slight variations with stream rates - or perhaps the program has to give the capture sequentially instead of in parallel? Idk - but I never get frames that align perfectly
        I actually use three windows because I could never get them to sync in only one playback instance. Free is nice though right

        Comment


        • #21
          Originally posted by preludesam View Post

          This is usually an available RAM issue. You can adjust the allocated RAM in the settings under Playback. Be careful though, depending on the file size of each playback you may need to increase system RAM. Otherwise, I would check the CPU utilization while you fast scrub a playback and see if you are peaking the CPU.



          I actually use three windows because I could never get them to sync in only one playback instance. Free is nice though right
          Thanks for the tips. I'll take a look at CPU Utilization and see if perhaps 3 windows works better for me.

          I've experimented with increasing the allocated RAM (I believe) - as I was testing with recording longer clips. It didn't seem to help with the choking, but I'll give it another shot as well.

          Unfortunately there's not much I can do if the CPU ends up being the problem (I don't think?). I've tried prioritizing Kinovea in the task manager but that didn't seem to do much either.

          I'm not super comfortable on PC anymore as I've been on Mac exclusively for the last 12 years - but I'm trying!

          Comment


          • Snipe
            Snipe commented
            Editing a comment
            Task manager shows ~50% CPU Usage and 30% ram usage when trying to scrub a dual video playback frame by frame. This is where things get choppy and the scroll bar and video begins to lag / respond erratically.

            I increased the Playback Memory buffer / allocation - but no perceptible difference.

        • #22
          joan any ideas here? Thank you so much!

          Comment


          • #23
            Try to use uncompressed video format like AVI instead of MP4 for recording. It consumes quite a bit of CPU to compress the video and causes lag.

            Comment


            • #24
              Some recommendations on the setup of Kinovea:

              Recording instance of Kinovea
              • Always use ONE instance of Kinovea for each camera. To my experience, the 2 camera mode doesn’t work correctly. The total CPU-load is even lower if you use one instance for each camera. Loading of each camera using the workspace function works perfect if 2 instances are used.
              • In high FPS-recording always use uncompressed video AVI or MKV. If one camera is rotated, use MKV. The metadata of the AVI-files do not have information on the rotation and will be displayed without rotation. I use it for the down-the-line camera to get a better aspect ratio.
              • Setting recording mode to retroactive (options/preferences/capture/recording) will allow Kinovea to record the video to memory without any disk writing activity during recording.
              Playback instance of Kinovea
              • To replay 2 videos a dual replay mode in one Kinovea instances may be used to display the 2 videos side by side. In general the cpu-load for replay is rather low. Also memory allocation is not a topic
              • Try to activate „use motion synchronization mode“ (Options/preferences/playback/general) to get them synchronized

              The power of your notebook seems to be high enough to record 2 videos at the same time.
              Using an I7 CPU, one recording instance of Kinovea in retroactive mode will take about 30% CPU load, a dual replay about 10-15% or even less.
              Also your USB-controller is an USB 3.2 that will deliver enough bandwidth to transfer the videos from the camera to the computer.
              Use a direct USB-connection from each camera to the computer without any hub in between. Check if the USB-cable is of high quality or maybe faulty.

              So far, there is no information of your camera specifications. I suggest they are USB2. What is the stream format, image size and frame rate you could set? In general, the exposure time should not be of a concern and will not influence the consistency of the video if it is shorter than 1 second divided by the number of frames/second. Example: 180fps -> exposure time should be below 5555 microseconds. Inconsistency mainly is created when frames are dropped during recording.

              Go a step by step procedure to be sure that the setup for each single camera works fine.

              First of all, deactivate any background tasks like Virus scanner during the tests. They may interfere with the setup.
              Use the newest Kinovea version (0.9.5)

              Start with only one camera in 1 instance of Kinovea and repeat it with the second camera.

              During recording, take a look on the title bar of the recording window and check if the signal of your camera is what you have set in the camera settings (wrench icon) with respect to SIGNAL. Does it show the same fps?

              The „throughput“ should not be over 300-400MB/s, otherwise it may be over the transfer limit.

              To my experience most important is the dropping rate. If there are any drops during recording, the resulting video will not be as expected due to missing frames. If there are any drops, reduce the frame size, the fps-rate of the camera or switch to monochrome (if it is available in the camera settings)

              Check the resulting video frame by frame in a Kinovea replay instance to see if the video runs as expected.
              Check the CPU-load of one recording instance.

              Finally try to use all instances together and check if the above parameters work the same.

              Hope that helps

              Comment


              • preludesam
                preludesam commented
                Editing a comment
                Well the professionals arrived. Thanks Reiner!

              • Snipe
                Snipe commented
                Editing a comment
                Thank you so much for this.

                As I started to work through your suggestions, I realized that the choppiness seems to be an issue only with Replay Observer.

                If I open two videos in a new replay window - they scroll just fine.
                If I allow Replay Observer to open the same two videos - scrolling between frames becomes choppy / laggy / black / etc.

                The cameras I have currently are ELP OV4689 (1280X720 MJPEG@ 120fps).

                I believe I should be recording uncompressed MKV (Options > Preferences > Capture "Record uncompressed video" is checked and Uncompressed Video Format is MKV". HOWEVER - the files generated appear to be MP4 format in File Manager - but when I try to play them I get a message that "Can't play - This item was encoded in a format that's not supported. 0xc00d5212". I am able to play any videos I export as MP4 or MKV. Is this just a quirk of Kinovea?

                Obviously I have quite a bit to test yet - but thank you so much!

            • #25
              Don’t really understand the situation completely.

              1.
              did you open the 2 videos independently and separately in a single replay window and they work fine or did you use a 2 panel replay (left and right panel to replay) opening one video on the left and one on the right?

              There might be a synchronization problem. Try to open a dual panel replay, load one video on the left, the other on the right panel.
              deactivate synchronization in preferences.
              Activate the display of frames and time (preferences/playback/units top dropdown-list „time“, last entry).

              Are the values of fps (both title bars) and duration/frames (i.e. 2.50 (78)) nearly are the same?


              You will have 3 play-buttons. If you play the videos independently using the play button below each video, does it replay correctly?
              Clicking the play-button on the common-control (below both videos) should show the observed behavior.


              Finally, if any *.kva file is related to the video (with the same filename, i.e.: video1.mkv and video1.kva) rename the kea-files of both videos and reload them again if there is any difference.

              Do you have an opportunity to upload both example files? It would be interesting to see evaluate the properties.


              2.
              What do you mean by „the files generated appear to be MP4 format in File Manager“ ? The file extension should be MKV or AVI for uncompressed video.

              What program gives you the error message of „unsupported format“. Is it the default window-program that plays videos?

              The file extension doesn’t mean all in video formats. It is called the container format (i.e. MP4,AVI,MKV), but the encoder may be different inside each container. Kinovea uses 2 codecs: mjpeg for compressed files (MP4,AVI,MKV) and rawvideo for uncompressed files (AVI,MKV).

              Not all common video-player may play videos that have a "mjpeg" or „rawvideo“ codec. Therefore, in general, the standard window video player cannot replay uncompressed videos from Kinovea. You may use VLC, it plays most of the formats available.

              3.
              Did you check the videos if they are recorded in 2 independent Kinovea-instances?

              Comment


              • #26
                Originally posted by Reiner View Post
                Don’t really understand the situation completely.

                1.
                did you open the 2 videos independently and separately in a single replay window and they work fine or did you use a 2 panel replay (left and right panel to replay) opening one video on the left and one on the right?

                There might be a synchronization problem. Try to open a dual panel replay, load one video on the left, the other on the right panel.
                deactivate synchronization in preferences.
                Activate the display of frames and time (preferences/playback/units top dropdown-list „time“, last entry).

                Are the values of fps (both title bars) and duration/frames (i.e. 2.50 (78)) nearly are the same?


                You will have 3 play-buttons. If you play the videos independently using the play button below each video, does it replay correctly?
                Clicking the play-button on the common-control (below both videos) should show the observed behavior.


                Finally, if any *.kva file is related to the video (with the same filename, i.e.: video1.mkv and video1.kva) rename the kea-files of both videos and reload them again if there is any difference.

                Do you have an opportunity to upload both example files? It would be interesting to see evaluate the properties.


                2.
                What do you mean by „the files generated appear to be MP4 format in File Manager“ ? The file extension should be MKV or AVI for uncompressed video.

                What program gives you the error message of „unsupported format“. Is it the default window-program that plays videos?

                The file extension doesn’t mean all in video formats. It is called the container format (i.e. MP4,AVI,MKV), but the encoder may be different inside each container. Kinovea uses 2 codecs: mjpeg for compressed files (MP4,AVI,MKV) and rawvideo for uncompressed files (AVI,MKV).

                Not all common video-player may play videos that have a "mjpeg" or „rawvideo“ codec. Therefore, in general, the standard window video player cannot replay uncompressed videos from Kinovea. You may use VLC, it plays most of the formats available.

                3.
                Did you check the videos if they are recorded in 2 independent Kinovea-instances?
                Don’t really understand the situation completely.


                1.

                did you open the 2 videos independently and separately in a single replay window and they work fine or did you use a 2 panel replay (left and right panel to replay) opening one video on the left and one on the right?


                ================================================== ============================


                [I opened the two videos independently and separately in a 2 panel replay (single Kinovea instance using the “Dual Display” icon) and opened one video on the left and one on the right.


                ================================================== ============================


                There might be a synchronization problem. Try to open a dual panel replay, load one video on the left, the other on the right panel.

                deactivate synchronization in preferences.

                Activate the display of frames and time (preferences/playback/units top dropdown-list „time“, last entry).


                Are the values of fps (both title bars) and duration/frames (i.e. 2.50 (78)) nearly are the same?


                ================================================== ============================


                The sync issue seems to be during recording

                The FPS on the title bars are both the same

                The Duration / Frames are both the same


                ================================================== ============================


                You will have 3 play-buttons. If you play the videos independently using the play button below each video, does it replay correctly?

                Clicking the play-button on the common-control (below both videos) should show the observed behavior.


                ================================================== ============================


                When I load a previously recorded video (aka not the most recent video which the Folder Observer is automatically replaying) everything is smooth and I can scroll through the frames both forward and backward.


                When working with the most recently, automatically loaded video (via Replay Observer):

                If I play the video forwards it plays fine

                If I go frame by frame FORWARDS (with any of the 3 forward frame control buttons) it works just fine

                If I try to reverse frames either by clicking the back frame button or scrolling back - the lag gets very bad - and one screen usually goes black for a bit.


                Here are two videos of the same file.

                Played automatically with file observer directly after recording:

                https://youtube.com/shorts/BnPaLeMbz0A


                Played after being reloaded via Kinovea side window file browser:

                https://youtube.com/shorts/OqC1OvwMfLY?feature=share


                (Don’t judge the swing or hair too harshly. I’m making some swing changes trying to fix some old, deeply ingrained habits, and have been putting off getting a badly needed haircut)


                ================================================== ============================


                Finally, if any *.kva file is related to the video (with the same filename, i.e.: video1.mkv and video1.kva) rename the kea-files of both videos and reload them again if there is any difference.


                Do you have an opportunity to upload both example files? It would be interesting to see evaluate the properties.


                ================================================== ============================


                What do you suggest as the best way to upload?


                ================================================== ============================


                2.

                What do you mean by „the files generated appear to be MP4 format in File Manager“ ? The file extension should be MKV or AVI for uncompressed video.


                What program gives you the error message of „unsupported format“. Is it the default window-program that plays videos?


                The file extension doesn’t mean all in video formats. It is called the container format (i.e. MP4,AVI,MKV), but the encoder may be different inside each container. Kinovea uses 2 codecs: mjpeg for compressed files (MP4,AVI,MKV) and rawvideo for uncompressed files (AVI,MKV).


                Not all common video-player may play videos that have a "mjpeg" or „rawvideo“ codec. Therefore, in general, the standard window video player cannot replay uncompressed videos from Kinovea. You may use VLC, it plays most of the formats available.


                ================================================== ============================


                I changed the Video Format to MKV and now it records uncompressed MKV by default - but there is no difference in performance.


                Previously I had “Record Uncompressed By Default” checked - and I had “Uncompressed Video Format” dropdown set to MKV. However I had “Compressed Video Format” set to MP4. For some reason, it was recording in MP4 format (though Windows Media Player still would not recognize them directly from Kinovea. However - if I exported the video as MP4 - Windows media player recognized the files. Very odd but unimportant I guess)

                ================================================== ============================


                3.

                Did you check the videos if they are recorded in 2 independent Kinovea-instances?


                ================================================== ============================


                Yes - no difference.


                ================================================== ============================


                Comment


                • #27
                  Could reproduce the situation.

                  There is a difference of how Kinovea is reading and playing videos in „pure“ replay mode and observer mode.

                  If you actively load the videos to a replay window they are loaded fully into memory (a status bar occurs during reading). During scrubbing back and forth, Kinovea can load and display each single frame from memory. Therefore, the performance of the ssd is of no interest.

                  Using observer mode, the video remains on the disk and each frame is read sequentially.

                  Suggestion:
                  As the log.txt file shows, Kinovea is using a prebuffer to read some frames in advance (in forward direction). So if you scrub backwards, the actual position inside the video changes and triggers a new read of a prebuffer with each step backwards.

                  That may cause a delay and black frames due to that Kinovea still is working to load the frames of the forward prebuffer.

                  Prebuffering works perfect if you are scrolling forward. The next (expected) frames are already loaded to memory and can be displayed very fast.

                  So far I didn’t realize this behavior, perhaps due to using an i9 CPU and a second very fast NVM-SSD to store the videos (MSI Z390 mainboard).

                  To overcome the situation it might be better to click back on a desired position and start replay in forward mode.


                  Comment on the setup:

                  To reduce the replay speed it might be advantageous to use the fps-reduction property in options/preferences/capture/recording, setting the „framerate replacement threshold (fps)“ below the fps you are recording (in your case i.e. 90, see next paragraph) and the „replacement framerate (fps)“ to 30. That will reduce your replay speed to better visualize your swing.

                  The fps that is shown in the replay window doesn’t really mean that the recording has been performed of this speed. It rather is the signal the camera gives to Kinovea. However, in USB2-cameras the value might not be correct.

                  Look in the camera instance what is shown on the title bar on „signal“. This fps value is the real fps the camera records the video.


                  Comment on Export
                  If you export a video from the replay window, the created file is compressed using the codec: mpeg4
                  This codec can be read by most of the video players.
                  The original MP4-file has the codec „mjpeg“ and cannot be read by windows media player

                  The reason is that mjpeg stores each frame (single image) of the video in its original form. Therefore, it is much faster to display each frame of the video because it is already in a final format.

                  The mpeg4 codec stores differences between frames. So to display a specific frame, the keyframe „before“ the actual frame has to be searched and every change has to be calculated to get the full frame at a specific position.

                  Comment


                  • sorensen
                    sorensen commented
                    Editing a comment
                    I get completely breathless, I wish I was just as skilled :-)

                • #28
                  Originally posted by Reiner View Post
                  Could reproduce the situation.
                  To overcome the situation it might be better to click back on a desired position and start replay in forward mode.
                  Thank you. Would any hardware upgrades be worth looking into or would I essentially need to buy an entire new rig?

                  Comment on the setup:

                  To reduce the replay speed it might be advantageous to use the fps-reduction property in options/preferences/capture/recording, setting the „framerate replacement threshold (fps)“ below the fps you are recording (in your case i.e. 90, see next paragraph) and the „replacement framerate (fps)“ to 30. That will reduce your replay speed to better visualize your swing.

                  The fps that is shown in the replay window doesn’t really mean that the recording has been performed of this speed. It rather is the signal the camera gives to Kinovea. However, in USB2-cameras the value might not be correct.

                  Look in the camera instance what is shown on the title bar on „signal“. This fps value is the real fps the camera records the video.
                  Typically my signal shows ~120 FPS. I'm not sure I understand the value / impact of the fps-reduction property - but will give it a shot to see if it's useful. Thank you.

                  Comment on Export
                  If you export a video from the replay window, the created file is compressed using the codec: mpeg4
                  This codec can be read by most of the video players.
                  The original MP4-file has the codec „mjpeg“ and cannot be read by windows media player

                  The reason is that mjpeg stores each frame (single image) of the video in its original form. Therefore, it is much faster to display each frame of the video because it is already in a final format.

                  The mpeg4 codec stores differences between frames. So to display a specific frame, the keyframe „before“ the actual frame has to be searched and every change has to be calculated to get the full frame at a specific position.
                  This is really interesting. Thank you for the help and context!

                  Comment


                  • #29
                    Snipe
                    Checked the observer mode on different machines (i5,i9,Virtual machine Parallels on a Mac, which is rather slow, also using SSD and regular hard disk) but could not reproduce the delay.
                    So there might be something in the videos your cameras are creating.
                    Send you a PM with a link to upload videos for further evaluations.

                    Comment


                    • #30
                      Hi Snipe,
                      have observed your videos converting the following parameters singular and in each combination.

                      The following parameters have NO effect, the delay remains more or less the same:
                      • converting mjpeg (compressed video) to rawvideo (no compression)
                      • change the pixel-format from yuvj422p to yuv420p
                      The parameters that makes everything working fluently is:
                      • reducing the frame rate of the RESULTING video from 120fps to 30fps (factor of 4)
                      This increases the video-duration by the factor 4 from about 1.5x sec to 6.x seconds, keeping the number of totally recorded frames


                      So it seems to be important to use the fps-reduction in
                      preferences/Capture/Recording:
                      set the replacement threshold BELOW the value you are recording (in your case below 120fps)
                      • frame rate replacement threshold (fps): 100
                      • replacement frame rate (rps): 30
                      If the replacement fps-function is active, Kinovea is creating a *.KVA file with the same name as each recorded video, containing information on the fps-reduction. The replay instance will recognize the KVA-file and changes the display-parameters
                      This results in a correct display of your Kinovea-timeline and will reduce the timeline back to 1.5x seconds, showing the correct length.

                      To control the correct number of frames, you may select the last item in the dropdown-list in preferences/playback/units/time, showing time and frame number.

                      One further remark:
                      To prevent frames dropping during recording, use the „retroactive“ mode in preferences/capture/recording
                      The CPU-load will increase but will stay similar. So it is a valuable check to see if the CPU-power is high enough if both cameras are active.
                      The main effect is that this setting prevents any interference with hard disk writing during recording.

                      Let me know if that works for you

                      Comment

                      Working...
                      X