STBT detect_motion

33 views
Skip to first unread message

Pedro Craveiro

unread,
Nov 14, 2017, 7:51:52 AM11/14/17
to stb-t...@googlegroups.com
Hi there!

I'm trying to make a Python script to detect if there is motion on set-top box or not. When there is motion the script runs ok but when the box is off this error appears:


--------------------------------------------------------------------------------------------------------------------------------------
 File "/home/altran/testing/stb-tester/_stbt/core.py", line 991, in detect_motion
    for frame, _ in self.frames(timeout_secs):
  File "/home/altran/testing/stb-tester/_stbt/core.py", line 1221, in frames
    max(10, timeout_secs), since=timestamp)
  File "/home/altran/testing/stb-tester/_stbt/core.py", line 2007, in get_frame
    raise UITestError(str(self.last_frame))
UITestError: gst-resource-error-quark: Resource not found. (3): Resource not found.
gstrtspsrc.c(5590): gst_rtspsrc_send (): /GstPipeline:pipeline1/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source:
Stream Not Found

FAIL: testcases/motion_test_meo.py: UITestError: gst-resource-error-quark: Resource not found. (3): Resource not found.
gstrtspsrc.c(5590): gst_rtspsrc_send (): /GstPipeline:pipeline1/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source:
Stream Not Found
--------------------------------------------------------------------------------------------------------------------------------------


this is the part of my code that makes de motion detection:


--------------------------------------------------------------------------------------------------------------------------------------
    def _make_test(self):
        print "MotionTest MAKE TEST"
        for motion_result in detect_motion():
            assert bool(motion_result) == motion_result.motion
            if not motion_result:
                self.remote.send_key_once(MeoRemote.POWER)
                time.sleep(4)
                self.remote.send_key_once(MeoRemote.BTN_5)
            else:
                self.remote.send_key_once(MeoRemote.BTN_9)
                break
--------------------------------------------------------------------------------------------------------------------------------------


Can you help please?


Best regards!


--
Pedro Craveiro

Lewis Haley

unread,
Nov 15, 2017, 4:58:35 AM11/15/17
to stb-tester
Presumably, because the box you are testing is powered off, there is no video input on your stream. This will cause Gstreamer to raise the error it has (essentially, you're trying to make it play a stream that doesn't exist ("Resource not found")).

You can purchase HDMI devices which always output video, even if they are not receiving input (usually some kind of "no signal" message, like you might seen on a TV or monitor that is turned on but is not receiving input).
Reply all
Reply to author
Forward
0 new messages