Stream of camera doesn't work for Restful API

I want to request multipart streaming by using API of Python and show it on the entity of the camera…
This url can work on the web, it can show a video stream on the web, and when I can
request it, it will return bytes of the stream, but I don’t know to extract frames from the stream data,
So I use package of pyav, and it can extract the frame successfully. I know it’s not a good
solution, but I have no idea to fix it, and I use it to create a camera. Then the image can show
on the entity, but the stream of camera doesn’t work, it only refreshes once ten second, what
can I modify my code that my entity can work successfully. I’ve been researching a lot of documentation and examples and have been stuck for over a week…
Please help me, thanks…

I implement it after reading the doc of camera, but the function "handle_async_still_stream" and "async def handle_async_mjpeg_stream" seems that it doesn’t work or won’t even execute, why? And I don’t know the request of function have to supply what. Any discussion and suggestion is helpful.

    @property
    def is_streaming(self):
        """Return true if the device is streaming."""
        return self._attr_is_streaming

    def camera_image(self, width, height):
        content = "http://111.11.1.111:1234"
        with av.open(content) as container:
            stream = container.streams.video[0]
            for frame in container.decode(stream):
                img = frame.to_image()
                buf = BytesIO()
                img.save(buf, format='JPEG')
                byte_im = buf.getvalue()        
                break
        return byte_im

    async def async_camera_image(self, width = 480, height = 360):
        return await self.hass.async_add_executor_job(
            partial(self.camera_image, width=width, height=height)
        )

    async def handle_async_still_stream(self, request, interval):
        return await async_get_still_stream(
            request, self.async_camera_image, self.content_type, interval
        )

    async def handle_async_mjpeg_stream(self, request):
        return await self.handle_async_still_stream('Get', 0.1)

Solved with code below, it can show the stream on pop-up window.
But the stream on main web UI is still refreshes once ten second.
How to let the web UI can show the stream fluently?

    async def handle_async_mjpeg_stream(self, request):
        ffmpeg_manager = get_ffmpeg_manager(self.hass)
        stream = CameraMjpeg(ffmpeg_manager.binary)
        await stream.open_camera(
            "http://111.11.1.111:1234",
            extra_cmd= "-pred 1",
        )
        try:
            stream_reader = await stream.get_reader()
            return await async_aiohttp_proxy_stream(
                self.hass,
                request,
                stream_reader,
                ffmpeg_manager.ffmpeg_stream_content_type,
            )
        finally:
            await stream.close()

We can change the camera view of card in dashboard, then the stream can show in the preview of entity.