Coder Social home page Coder Social logo

Comments (4)

ThatWileyGuy avatar ThatWileyGuy commented on June 16, 2024

Tried to get this working with a non-pro Kiyo I had sitting around and couldn't get MJPG -> NV12 -> H264 to work (seems like the RPI can't decode 1080p MJPG?), but the hardware H264 encoder on the camera was flawless.

Flipped the Kiyo Pro over to hardware H264 and I still see corruption, but now it's clearly dropped frames post-encoder rather than corrupted frames getting fed into the encoder (instead of a tear line, I see smeared motion and such). My guess is that the USB3 controller on the RPi is having trouble and dropping frames between the camera and the RPi?

I modified the read loop to look like this:

            try:
                if not camera.sleeping:
                    camera.request_key_frame()
                cameraSleeper.add_client()
                mp4_writer = MP4Writer(self.wfile, config.width(), config.height(), config.timescale(), h264parser.sps, h264parser.pps)
                desired_frame_time = 1.0 / 30.0
                frame_start = time()
                while True:
                    nalus, frame_secs, frame_usecs = h264parser.read_frame()
                    read_done = time()
                    mp4_writer.add_frame(nalus, frame_secs, frame_usecs)

                    frame_end = time()
                    frame_time = frame_end - frame_start
                    if frame_time > 2 * desired_frame_time:
                        print("long frame: ", frame_time / desired_frame_time, " read: ", (read_done - frame_start) / desired_frame_time, " write: ", (frame_end - read_done) / desired_frame_time)
                    frame_start = frame_end
            except Exception as e:
                cameraSleeper.remove_client()
                self.log_message(f'Removed streaming client {self.client_address} {e}')

... and I see a steady stream of long frames that are 2-4 times the desired frame time, with nearly all the time spent waiting on the frame from the camera.

from fmp4streamer.

soyersoyer avatar soyersoyer commented on June 16, 2024

The Kiyo Pro firmware has issues. Sometimes it doesn't set the USB EOF bit and it causes delays on Linux. I opened tickets at Razer, but they only care about Windows. I tried with a Pi on USB2, it worked with YUYV in lower resolution/lower framerate. I don't have a Pi with free USB3 port yet.

from fmp4streamer.

ThatWileyGuy avatar ThatWileyGuy commented on June 16, 2024

Hilariously, there's actually an available firmware update for my camera (1.00 -> 1.05) which claims to have Fixed an issue where the image lags or freezes intermittently. Unfortunately, the updater utility tells me "To proceed with the update, please contact Razer Support" and from searching around, it sounds like Razer shipped an early hardware revision that can't take the firmware update and has to be replaced.

I'm torn between making Razer send me a replacement and just never buying any of their products again, but either way, this doesn't seem to be anything solvable in fmp4streamer.

Thanks!

from fmp4streamer.

ThatWileyGuy avatar ThatWileyGuy commented on June 16, 2024

Just wanted to confirm here in case anyone else uses one of these cameras - on the most recent firmware (1.05), this issue no longer occurs and my Kiyo Pro works fine with fmp4streamer.
If you have this problem, follow the instructions at https://mysupport.razer.com/app/answers/detail/a_id/4582
If the firmware updater refuses to update your camera, post in Razer's forums or message a member of their support team and they'll open an RMA to replace your camera.

from fmp4streamer.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.