• 免费好用的星瞳AI云服务上线!简单标注,云端训练,支持OpenMV H7和OpenMV H7 Plus。可以替代edge impulse。 https://forum.singtown.com/topic/9519
  • 我们只解决官方正版的OpenMV的问题(STM32),其他的分支有很多兼容问题,我们无法解决。
  • 如果有产品硬件故障问题,比如无法开机,论坛很难解决。可以直接找售后维修
  • 发帖子之前,请确认看过所有的视频教程,https://singtown.com/learn/ 和所有的上手教程http://book.openmv.cc/
  • 每一个新的提问,单独发一个新帖子
  • 帖子需要目的,你要做什么?
  • 如果涉及代码,需要报错提示全部代码文本,请注意不要贴代码图片
  • 必看:玩转星瞳论坛了解一下图片上传,代码格式等问题。
  • 要上传视频流到服务器RTSP,通过浏览器浏览,JPEG不支持



    • # RTSP Video Server
      #
      # This example shows off how to stream video over RTSP with your OpenMV Cam.
      #
      # You can use a program like VLC to view the video stream by connecting to the
      # OpenMV Cam's IP address.
      
      import network, omv, rtsp, sensor, time
      
      # RTP MJPEG streaming works using JPEG images produced by the OV2640/OV5640 camera modules.
      # Not all programs (e.g. VLC) implement the full JPEG standard for decoding any JPEG image
      # in RTP packets. Images JPEG compressed by the OpenMV Cam internally may not display.
      
      # FFPLAY will correctly handle JPEGs produced by OpenMV software.
      
      sensor.reset()
      
      sensor.set_pixformat(sensor.JPEG) # Only supported by the OV2640/OV5640.
      sensor.set_framesize(sensor.UXGA)
      
      print("sensor set done")
      # Turn off the frame buffer connection to the IDE from the OpenMV Cam side.
      #
      # This needs to be done when manually compressing jpeg images at higher quality
      # so that the OpenMV Cam does not try to stream them to the IDE using a fall back
      # mechanism if the JPEG image is too large to fit in the IDE JPEG frame buffer on the OpenMV Cam.
      
      omv.disable_fb(True)
      
      # Setup Network Interface
      
      network_if = network.WLAN(network.STA_IF)
      network_if.active(True)
      #network_if.connect('your-ssid', 'your-password')
      
      # Setup RTSP Server
      
      server = rtsp.rtsp_server(network_if)
      
      # For the call back functions below:
      #
      # `pathname` is the name of the stream resource the client wants. You can ignore this if it's not
      # needed. Otherwise, you can use it to determine what image object to return. By default the path
      # name will be "/".
      #
      # `session` is random number that will change when a new connection is established. You can use
      # session with a dictionary to differentiate different accesses to the same file name.
      
      def setup_callback(pathname, session):
          print("Opening \"%s\" in session %d" % (pathname, session))
      
      def play_callback(pathname, session):
          print("Playing \"%s\" in session %d" % (pathname, session))
      
      def pause_callback(pathname, session): # VLC only pauses locally. This is never called.
          print("Pausing \"%s\" in session %d" % (pathname, session))
      
      def teardown_callback(pathname, session):
          print("Closing \"%s\" in session %d" % (pathname, session))
      
      server.register_setup_cb(setup_callback)
      server.register_play_cb(play_callback)
      server.register_pause_cb(pause_callback)
      server.register_teardown_cb(teardown_callback)
      
      # Track the current FPS.
      clock = time.clock()
      
      # Called each time a new frame is needed.
      def image_callback(pathname, session):
          clock.tick()
          img = sensor.snapshot()
          # Markup image and/or do various things.
          print(clock.fps())
          return img
      
      # Stream does not return. It will call `image_callback` when it needs to get an image object to send
      # to the remote rtsp client connecting to the server.
      
      server.stream(image_callback)
      


    • 补充一下,我买的是openMV4 H7 R2 Cam



    • RTSP本来浏览器就看不了,要用rtsp播放器。