ModalAI Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Poor vid quality on VOXL2 voxl-streamer (hardware encoding)

    Ask your questions right here!
    3
    13
    428
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      hmlow
      last edited by

      Hi devs

      I've only recently ported to VOXL2 from VOXL1.
      I believe on VOXL2, hardware encoding in voxl-streamer is turned on by default unlike VOXL1.

      The same IMX214 hires cam with all the same config/settings shows up very poorly on VOXL2 voxl-streamer. The video quality goes back to the quality im familiar with on VOXL1 only if i add the -s argument to enable software h264 encoder.

      Any ideas why and is there a fix?

      1 Reply Last reply Reply Quote 0
      • H
        hmlow
        last edited by

        In addition, once the -s argument is set to enable software h264 encoder, although the vid quality improves, the aspect ratio seems to be incorrect.

        A 640x 480 video becomes flattened and becomes more like 852 x 480 (i measured actual resolution displayed). However, VLC still reports 640 x 480 in the codec section (just reading off the metadata?)

        1 Reply Last reply Reply Quote 0
        • Zachary Lowell 0Z
          Zachary Lowell 0 ModalAI Team
          last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • Zachary Lowell 0Z
            Zachary Lowell 0 ModalAI Team
            last edited by Zachary Lowell 0

            Hi @hmlow. This should be addressed in the 4K streaming and encoding section of the voxl-camera-server documentation: https://docs.modalai.com/voxl-camera-server/

            let me know if this doesn't answer your questions. As for the -s flag, that is an auto generate flag that will ignore the config and use default values from HAL3 so that is why you are getting wonky frame sizes.

            H 3 Replies Last reply Reply Quote 0
            • H
              hmlow @Zachary Lowell 0
              last edited by hmlow

              @Zachary-Lowell-0 said in Poor vid quality on VOXL2 voxl-streamer (hardware encoding):

              Hi @hmlow. This should be addressed in the 4K streaming and encoding section of the voxl-camera-server documentation: https://docs.modalai.com/voxl-camera-server/

              let me know if this doesn't answer your questions. As for the -s flag, that is an auto generate flag that will ignore the config and use default values from HAL3 so that is why you are getting wonky frame sizes.

              @Zachary-Lowell-0, no, not at all unfortunately.

              The 4k streaming and encoding section is specific to 4k encoding (using "stream_width" and "stream_height" parameters), and i do not need to, and have never used it all along when i was on VOXL1. I experienced none of the issues below on VOXL1:

              To summarize again:

              With -s argument used with voxl-streamer-
              On VOXL2, the RTSP video quality streamed out by voxl-streamer is very poor (akin to extremely low bitrate video)

              Without -s argument used with voxl-streamer-
              On VOXL2, the RTSP video quality streamed out by voxl-streamer is ok (like the usual i see on VOXL1), but, the resolution/aspect ratio becomes incorrect and looks flattened.

              In both cases, the voxl-camera-server.conf and voxl-streamer config are as such:

              		}, {
              			"name":	"hires",
              			"enabled":	true,
              			"frame_rate":	30,
              			"type":	"imx214",
              			"camera_id":	2,
              			"preview_width":	640,
              			"preview_height":	480,
              			"snapshot_width":	3840,
              			"snapshot_height":	2160
              		}]
              }
              
              {
              	"input-pipe":	"hires",
              	"bitrate":	1000000,
              	"decimator":	1,
              	"port":	8900,
              	"rotation":	180
              }
              
              

              You also mentioned that the -s flag causes the frame sizes to get wonky. How do we prevent that?

              Thanks

              1 Reply Last reply Reply Quote 0
              • H
                hmlow @Zachary Lowell 0
                last edited by

                @Zachary-Lowell-0

                Also, do refer to this post on my other thread at:
                https://forum.modalai.com/post/8882

                I thought they were unrelated but now im suspecting that these two issues are connected..

                1 Reply Last reply Reply Quote 0
                • H
                  hmlow @Zachary Lowell 0
                  last edited by

                  @Zachary-Lowell-0 would appreciate it if you could take a second look at this pls

                  1 Reply Last reply Reply Quote 0
                  • Zachary Lowell 0Z
                    Zachary Lowell 0 ModalAI Team
                    last edited by Zachary Lowell 0

                    I am not following - what are you trying to accomplish here? Just higher quality streaming via RTSP? There is also a stream_bitrate parameter as well that will allow for more throughput as well.

                    You need to enable the stream width and height parameters for encoding to happen for better frames since the encoding now happens in the voxl-camera-server pipe and not voxl-streamer.

                    Also how are you viewing the RTSP stream? I am trying to recreate the issue on my end to see if I can see what you are seeing. Lastly, which SDK are you using on both systems? @hmlow

                    1 Reply Last reply Reply Quote 0
                    • Zachary Lowell 0Z
                      Zachary Lowell 0 ModalAI Team
                      last edited by

                      @hmlow ok so I was unable to recreate your issue. I have the m0025-2 running on both the voxl1 and voxl2 and have very similar outpuputs in terms of the rtsp stream. I am viewing via VLC and QGC.

                      Here is my setup:

                      1. VOXL2 connected to the hires camera (m0025-2).
                      2. Run voxl-camera-configure 8 (which is just hires for now)
                      3. Run voxl-streamer-configure -i hires
                      4. Ensure the output is what you are expecting via voxl-inspect-cam hires
                      5. Within VLC or QGC open the network stream at your rtsp://YOURIP:8900/live

                      I did this on both the voxl1 and voxl2 and had the same result for the output. I did not stream in 4K as that is something you said you did not need. Please let me if this is the setup you have been using.

                      This is what the video looks like in QGC, same thing in VLC:
                      c8189358-9bd4-4496-8e6e-981aecdbd046-image.png

                      H 2 Replies Last reply Reply Quote 0
                      • H
                        hmlow @Zachary Lowell 0
                        last edited by hmlow

                        @Zachary-Lowell-0

                        When you did your tests, did you take a good look at the quality of the video?

                        I'll let the screenshots below explain what i meant:

                        streamer comparisons.jpg

                        Output from voxl-camera-server are always 640x480.

                        Pic on left shows VOXL2 running voxl-streamer, bitrate 1Mbps, decimator 1. The video quality is actually quite bad. You can somewhat see the "patches" from the photo, but its much worse when its a moving video.

                        Exact same setup on the right, but with -s. The video quality is much better. This is the usual video quality i get when im using VOXL1. In addition, you would notice that the frame is incorrectly flattened/elongated horizontally.

                        To answer your earlier query of what i am trying to accomplish here:

                        I would like to achieve the same vid streaming quality that i used to see on VOXL1, without using software encoding (-s) on voxl-streamer because it adds more load on the CPU and generates more heat. Not that i could, since the use of software encoding messes up the frame.

                        Im running SDK0.9 on both VOXL1 and 2.

                        Hope you can help

                        1 Reply Last reply Reply Quote 0
                        • H
                          hmlow @Zachary Lowell 0
                          last edited by

                          @Zachary-Lowell-0 hi did you manage to investigate this further?

                          1 Reply Last reply Reply Quote 0
                          • Chad SweetC
                            Chad Sweet ModalAI Team
                            last edited by

                            We have posted a tutorial on 720p and 4k here: https://docs.modalai.com/voxl-streamer/#streaming-in-720p-and-4k

                            We are working on a more streamlined hw encoding data path, it may take a few weeks to get it published.

                            H 1 Reply Last reply Reply Quote 0
                            • H
                              hmlow @Chad Sweet
                              last edited by

                              @Chad-Sweet

                              Thank you for the guide.

                              Noted that the workaround to get decent video quality is to increase the bitrate - 3Mbps (h/w encoding) gives comparable quality to 1Mbps (s/w encoding).

                              Hope that the upcoming fix could overcome this problem (using encoded source from qmmf?). Looking forward to it.

                              Thanks

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post
                              Powered by NodeBB | Contributors