Announcement

Collapse

TGC Tour - Congratulations!

Congrats to @Wes B45 (NET) and @Chris Knoop (GROSS) winning the TGC 2018/2019 WINTER TOUR - ATT Pebble Beach Pro-Am !

Join this weeks TGC 2018/2019 WINTER TOUR - Genesis Open with 2 rounds at Riviera Country Club White Tees : https://golfsimulatorforum.com/forum...r-genesis-open
See more
See less

Automatic swing recording with OBS Studio

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

  • #16
    Originally posted by FaultyClubs View Post
    My previous post showed OBS reducing my 120 fps camera down to 60 fps for recording and slow motion playback. I explained in the comments to that post what appeared to be happening.

    I had some time today to perform more tests as described below.

    I tested with my 120 fps global shutter camera. I picked this because it has only one video mode which is 1280x720 at 120 fps. It has no other modes or speeds which can be mistakenly used to confuse the test results. I then set OBS internal frame rate to 30 fps (Settings/Video/FPS) so the speed difference would be obvious (120 vs 30) if OBS re-encodes the camera down to that rate at any point.

    1) First test was the one I asked HT to do above (although I wanted him to use his 330 fps camera). Run OBS at 30 fps (Settings/Video/FPS=30) and my camera at 120 fps. Then dump the replay's memory buffer. It will be at 120 fps if OBS is capturing at the full rate. Otherwise it'll be 30 fps.

    Result: Rate is 30 fps.

    2) Second test was the stop watch test. I recorded my phones digital stop watch. At 120 frames per second there will be 12 frames for every 0.1 second tick over. 30 fps will have 3 frames every 1/10 of a second. I then dumped the replay memory buffer and stepped through it frame by frame counting how many frames per 1/10 of a second tick mark.

    Result: 3 frames every 1/10 of a second tick mark = 30 fps

    3) Third test was only looking at the slow motion replay. I set the playback speed to 1%. At 120 frames per second this means there will be 1.2 frames per second (or 2.5 seconds for three frames). At 30 fps there will be 0.3 frame per second (or 10 seconds for three frames). I then captured a moving object (big arm wave) to make it easy to see when a new frame occurs and measured the time for three frames.

    Result: 10 seconds for three frames = 30 fps

    4) I redid test #1 and #3 with OBS set at 60 fps (you have to exit and restart OBS for the new setting to take effect). Results were 60 fps.


    CONCLUSION:

    My 120 fps camera has been re-encoded to run at the OBS rate. There is no setting to turn this off.

    As I said in earlier post, OBS can run at a maximum of 120 fps. So those of us with 120 fps cameras should be OK, just be sure to set OBS to 120 fps. Leaving OBS at the default 30 or 60 fps will result in your 120 fps camera being dumbed down to the lower rate.

    This data suggests there is no point running cameras faster than 120 fps...they will be dumbed down to at least 120 fps or lower depending on the OBS frame rate setting.

    Anyway, that consumed an hour of my life, I'm not sure it was worth it. Definitely exceeds my interest level but I had started it so thought I should try to finish. I'll leave it to others to confirm or deny these results (or figure out what any of it means if HT's results are correct where he says OBS is working at the faster rates above 120 fps).
    Use the fractional value, i have it set to 2000 fps waiting on new camera

    Comment


    • #17

      Comment


      • #18
        Hehe, I never looked at the fractional. Just assumed it was fractions of the 1-120. So the integer fps stops at 120 and the fractional goes forever? Craziness!

        That's good though. Let us know how it works out. The OBS screens and everything are running at whatever rate you set, it's not just the cameras. My laptop was max'ed out and became unresponsive at 154 fps with two 120 fps cameras and replay running full screen. My TGC computer max'ed out at 334 fps with the same conditions. Didn't look at how jittery the video was at that loading...just a quick fps limit test.
        Last edited by FaultyClubs; 02-03-2019, 04:32 AM.

        Comment


        • #19
          FaultyClubs Been working with OBS Dev of Replay Input. We got the issues worked out about fps, the plugin now writes directly to memory instead of being processed by OBS, we are working on getting a sound trigger put in. We already got a delay added similar to Kinovea. Any other suggestions to improve it will be greatly appreciated.

          Comment


          • #20
            htdumps what size lens did you get? I ordered 2 of these (https://www.amazon.com/gp/product/B0...?ie=UTF8&psc=1) which is the same as yours (from the same seller) it just has a nice case on it.

            The 2.1mm lens has the widest FOV, however I could have probably done a 2.8mm to pull in tighter. I am about 5-6 ft from one camera and about 7 from the other and a 2.1mm lens is a bit too wide of a FOV. Once I mount my cameras (waiting on a long USB cable) I'll post some pictures.

            Thank you for the write up and I do believe this is a very good, affordable solution!

            Comment


            • htdumps
              htdumps commented
              Editing a comment
              You can rotate the cameras then flip the image in OBS, Which changes the FOV to more vertical. Im really close to my cameras my room is only 13'x12', so I must have the 2.1mm.
              Last edited by htdumps; 02-05-2019, 10:40 PM.

          • #21
            HT: Sounds like you're on the case. Adding audio trigger is good OBS has the audio streams and understands Python so should be doable.

            An option to automatically save the replay buffer would be nice. OBS has no analysis capability but Kinovea does. Kinovea reads the OBS files just fine for downstream analysis.

            I'm seeing a bit of jitter in slow motion playback. Might be a replay source issue. Keep an eye out for that in your testing.

            Comment


            • htdumps
              htdumps commented
              Editing a comment
              Im using some alpha builds I'll let you know once he puts them up on git

          • #22
            Got audio trigger working, updated version of tutorial and plugin soon.

            Comment


            • #23
              Here's a video with my 2 live cams with a slow mo replay. This works better than I expected. Thanks htdumps. I am using the keyboard right now to trigger a slow mo replay, but I will probably setup a bluetooth headset + Voice Attack until those Alpha mods come through.

               

              Comment


            • #24
              Huge update. We now have sound detection and full fps playback with OBS and Replay source. This has been a huge amount of work on the developers part, if you like it please feel free to donate to him. He is very responsive and can tweak the plugin even more. paypal.me/exeldro

              Ok I'm going to assume you are somewhat comfortable with Obs, you can add camera inputs, and install plugins.

              Step 1 Installing Replay Source OBS

              1. Download from https://github.com/exeldro/obs-replay-source/releases

              2. Unzip the download in the 64 bit plugins folder for example: C:\Program Files (x86)\obs-studio\obs-plugins\64bit

              Step 2 OBS

              1. Create a new scene

              Step 3 OBS

              1. Add one video capture source name it DTL, make sure to adjust the camera and set it to highest fps

              2. Add an audio input source, name it MIC

              3. Add "ReplayInput" source, name it DTL slow, then select DTL and change the following values:
              Check Capture Internal Frame
              Select Your mic for the audio source.
              Duration 4000
              Load Delay 1000
              Maximum replays 1
              Speed Percentage change to your preference
              Threshold db change to how loud you need it so it will only capture the ball strike. I have it set to -11.00

              4. Click OK.


              Hit some balls.


              Here is an example: https://www.youtube.com/watch?v=S9IL0moAgJU
              Last edited by htdumps; 02-11-2019, 07:11 AM.

              Comment


              • jrz
                jrz commented
                Editing a comment
                Thank you htdumps. By chance did you complete your camera testing? I'm curious as to what your thoughts are on the different models you tested.

              • htdumps
                htdumps commented
                Editing a comment
                Still testing will do a review soon.

              • davidK
                davidK commented
                Editing a comment
                Strong work.

                To open the Threshold db, I clicked Sound trigger load replay.

            • #25

              I lose my breath here. You don't have a day job ?
              Last edited by sorensen; 02-12-2019, 02:40 AM.

              Comment


              • htdumps
                htdumps commented
                Editing a comment
                Day job luckily is IT related

            • #26
              For anyone looking for a microphone to use with this, I liked this one (I used it with AZT and Kinovea). I lay it on the ground right next to my SkyTrak and it works great without being noticeable.

              Sony ECMCS3 Clip Style Omnidirectional Stereo Microphone, Silver
              https://smile.amazon.com/dp/B0058MJX..._VlKyCbY4Y377Z
              Last edited by jrz; 02-12-2019, 05:52 AM.

              Comment


              • #27
                Here Is a dual camera Slomotion Setup: https://youtu.be/pWOlpgoiyH0

                Comment


                • htdumps
                  htdumps commented
                  Editing a comment
                  Its because the ball camera is set to capture for 125ms with a load delay of 90 ms while the other camera is set for 3000ms capture with a 1000ms load delay.

                • jrz
                  jrz commented
                  Editing a comment
                  Is that because you're trying to minimize the length of the recording of the ball? If so, is it safe to assume you can get them pretty close to synced?

                • htdumps
                  htdumps commented
                  Editing a comment
                  Yea you can get them to sync, it just takes time adjusting the length, load delay, and start delay.
              Working...
              X