Video Encoding is driving me mad!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • John Winter
    Automated Home Sr Member
    • Dec 2007
    • 56

    Video Encoding is driving me mad!

    Hello Folks

    Apologies for the melodramatic thread title, but I have an issue with video encoding in Cortex that I hope you can provide suggestions for. I've been fiddling with this, on and off for months (years?) and despite this effort, I still have a problem.

    It goes like this - I have Cortex set to record video on 3 cameras around my house, activated by motion on external PIRs associated with each camera. This bit works fine. Cortex detects motion, and sets off the recordings as expected. The playback of said recordings is the problem. When I play the video back in Cortex, it plays at around 120% of normal speed, and only intermittently. When I play back the video in WMP, I get around 1-2 seconds of playback at the correct speed, then playback stops, freezing on a frame. When Cortex playback fails, it does so in the same manner as in WMP.

    Now, something that I just discovered today that I think is a symptom that may get me to the root cause - the duration of the clip, according to windows explorer, is massively over exaggerated, for instance a 10 second clip is tagged at 20mins, and a 1 minute clip at over 2 hours!

    This duration error ties in with a number of other behaviours. On WMP, the slider bar at the bottom of the screen is grossly exaggerated in line with the clip's apparent length, I think somehow causing the clip to stop when it realises the bar's out of sync with the real length. Also, in Cortex itself - and I think this may be important - the 'time' indicator in the bottom left of the video window in Cortex always seems to jump forward at a huge pace, whether recording or not - in 10 seconds it could move forward 2 hours.

    So in essence I think the duration of a clip is being tagged using incorrect information - making the clip freeze on playback.

    I've played with all sorts of codecs, 2 different capture cards, and 2 servers, to no avail, so any suggestions appreciated.

    Cheers

    John
    --------------------------

    www.nodeone.blogspot.com
  • Viv
    Automated Home Ninja
    • Dec 2004
    • 284

    #2
    Have you tried Recording Method | ASF?
    If so do you get the same problems?

    Viv

    Comment

    • John Winter
      Automated Home Sr Member
      • Dec 2007
      • 56

      #3
      Hi Viv

      Yes - unfortunately the same result I'm afraid. I ran with ASF for a while but I think the root cause is something to do with the fact that the 'Time' thingy is running away with itself...

      Could I have a duff quad video capture card or drivers? What would you recommend for reliable 25FPS capture?

      John
      --------------------------

      www.nodeone.blogspot.com

      Comment

      • Viv
        Automated Home Ninja
        • Dec 2004
        • 284

        #4
        As a guess perhaps the PC cannot handle processing 3 cameras at 25fps.
        The video windows can have the player controls visible in mosaic or full screen view.
        If you had all the cameras up in mosaic view and all recording then see if on the player controls it is reporting dropped frames. Check CPU usage in Windows task manager for Cortex under such circumstances. Processor usage for the Idranet is quite low. Cameras are by far the biggest user.
        Have you tried a lower frame rate and still have had the problems?
        I know it goes against the grain to have good cameras and a fast capture card and then have to reduce the frame rate but it may be necessary depending on PC capability.

        Viv.

        Comment

        • chris_j_hunter
          Automated Home Legend
          • Dec 2007
          • 1713

          #5
          we were wondering what frame rate might be best, and noticed that this:



          offers this as a rule of thumb :

          "for residential surveillance 1-3 fps is the norm; for light commercial surveillance applications like retail stores 3-5 fps is typical. For higher-end surveillance we commonly see between 7-15 fps. It’s ... fairly typical for research facilities and casinos to demand 20–30 fps ... "
          Our self-build - going further with HA...

          Comment

          • toscal
            Moderator
            • Oct 2005
            • 2061

            #6
            Have you tried playing the file in VLC media player or media player classic.

            And have you tried capturing video without using Cortex and does this produce the same results.
            Viv's idea of lowering the frame rate may also do the trick.
            What sort of PC do you have.
            IF YOU CAN'T FIX IT WITH A HAMMER, YOU'VE GOT AN ELECTRICAL PROBLEM.
            Renovation Spain Blog

            Comment

            • John Winter
              Automated Home Sr Member
              • Dec 2007
              • 56

              #7
              Hi Guys

              Thanks for your suggestions...

              In terms of PC performance, the server is running with a 64bit dual core Athlon, with 2Gb Ram and a fast HDD. I'm encoding 768x576@25fps using Xvid at over 4500Kbps on the fly - so when 2 cameras are recording CPU load is around 90%. I honestly don't think it's a performance issue as I did try reduced frame rates, and resolutions.

              Chris - in a previous life I ran a CCTV company so I guess my demands are higher than most... We used to cover everything from department stores to Pharma - I suppose the very least I'd settle for is 17fps as that's about when the human eye stops perceiving one frame after another, and sees smooth motion.

              I'm getting zero dropped frames on the encode - even with 3 cameras at 100% cpu load...

              I did try this file -



              on VLC, as it is a robust player designed to handle dodgy files, but no joy 1/2 second of video, then freezeframe...

              Notice though, the stats of the file - 1500 frames at 24fps. Should be around 60sec worth of video, but the tag on the file is 1hr 2mins!

              I also tried capturing video using amcap - no problems at all on playback.

              I'm sure it's something to do with the fact that the 'time' display on Cortex's video window just runs at huge rate, much faster than real time.

              Could it be my 'china special' video card? Has anyone had success with a quad SAA712x based board?

              Could it be a bug in the video implementation in Cortex?
              Last edited by John Winter; 7 July 2011, 11:11 AM.
              --------------------------

              www.nodeone.blogspot.com

              Comment

              • chris_j_hunter
                Automated Home Legend
                • Dec 2007
                • 1713

                #8
                >in a previous life I ran a CCTV company ...

                ah, then could I ask what cameras you'd recommend for use with Cortex etc ... ?

                we bought a 40GBP dome camera to get things going, but we don't expect much of it (we're busy wiring-up & installing, so it could be a while before we take it from its box to give it a go) ...

                for the real ones, the Y-cam IP bullet camera & the Mobotix Q24 seem to be good value (*) but we've yet to investigate compatibility with Idratek ...

                (*) not the same as affordable !!
                Last edited by chris_j_hunter; 7 July 2011, 07:43 PM.
                Our self-build - going further with HA...

                Comment

                • toscal
                  Moderator
                  • Oct 2005
                  • 2061

                  #9
                  Notice though, the stats of the file - 1500 frames at 24fps. Should be around 60sec worth of video, but the tag on the file is 1hr 2mins!
                  Its 62.5 seconds. So some where it seems to be changing the seconds to minutes hence the 1hr 2 mins or 62 minutes.

                  Do you have audio encoding on or off,
                  IF YOU CAN'T FIX IT WITH A HAMMER, YOU'VE GOT AN ELECTRICAL PROBLEM.
                  Renovation Spain Blog

                  Comment

                  • John Winter
                    Automated Home Sr Member
                    • Dec 2007
                    • 56

                    #10
                    Well spotted! Now that you've pointed it out it's so obvious..

                    I've just checked some other clips, and they all have the same symptom - seconds are being recorded as minutes...

                    I wonder if this could help in the troubleshooting process?

                    BTW I'm not encoding audio.
                    --------------------------

                    www.nodeone.blogspot.com

                    Comment

                    • John Winter
                      Automated Home Sr Member
                      • Dec 2007
                      • 56

                      #11
                      Just a brief update on my troubleshooting work - unfortunately it's led to nothing, but the extra information might help in finding a solution.
                      I've tried reducing the frame rates down to 5fps, turned off video rendering altogether, uninstalled all codecs and reinstalled them, uninstalled and reinstalled cortex, tried turning off the rollback frames feature on video capture, changed to reference video drivers for the Philips 713x chipset, and still get the 'time' indicator jumping forward both when recording video, and when not. Whenever the 'time' indicator jumps, then the recording becomes corrupt. I'm out of options here and think it's either a bug in Cortex or simply that the video capture card is not compatible. Has anyone had any success with a quad capture board and 4 cameras in Cortex?
                      --------------------------

                      www.nodeone.blogspot.com

                      Comment

                      • Karam
                        Automated Home Legend
                        • Mar 2005
                        • 863

                        #12
                        What's your video capture card? The one we usually recommend (in that we know it works ok) is the IVC-200, which is a 4 x 30fps card costing about £150 inc. VAT these days.

                        Comment

                        • John Winter
                          Automated Home Sr Member
                          • Dec 2007
                          • 56

                          #13
                          Hi Karam

                          As mentioned its a 'Chinese Special' from ebay using 4 x Philips SAA7134 capture chips, each capable of 25fps PAL capture or 30fps NTSC. The 713x series is pretty standard fare in the video capture market, used by manufacturers like Trident, Avermedia, Pinnacle, Terratec etc. as well as by the more generic Chinese manufacturers, so I thought it would be a pretty safe bet. The same can also be said of the chipset in the IVC-200 board - the Conexant BT878a is again, widely used in both branded and unbranded capture cards.

                          I can quite happily capture video from any of the 4 inputs with amcap with no problem, so I'm just wondering could there be a glitch in the video capture hooks somewhere in Cortex that is leading to my issue? I'm sure you'll understand that I'd rather not shell out £150 for a video card, when a software tweak might be all that's required. I wonder if anyone's had any luck at all with the 713x chipset?
                          --------------------------

                          www.nodeone.blogspot.com

                          Comment

                          • Karam
                            Automated Home Legend
                            • Mar 2005
                            • 863

                            #14
                            John,

                            Of course. It was just in reply to your question about any success with a quad capture board.

                            Comment

                            • John Winter
                              Automated Home Sr Member
                              • Dec 2007
                              • 56

                              #15
                              Sorry to resurrect this old thread but I'm *still* struggling on, and my problem has evolved somewhat....

                              So I capitulated and bought an IVC-200 capture board - and encoding is better (but still not perfect), but the main problem I have now, is that every reboot of the system results in loss of the capture settings, for example the input defaults back to NTSC at default video size, so every time I have to go in to 'configure source' and change back to PAL I at 752x576, for all four channels... deeply frustrating!

                              This behaviour never happened with the old card, and I've removed and reinstalled the supplied drivers, downloaded new drivers and tried those, to no avail, so I'm now wondering could it be a Cortex issue where the database loses the video settings on reboot.

                              Any suggestions appreciated...
                              --------------------------

                              www.nodeone.blogspot.com

                              Comment

                              Working...
                              X