0

When I stream with the picturebox, there is a decrease in performance. I'm looking for a library that supports 4k 30fps. I think Opengl will support it. I shared my code below. I need a higher performance viewer instead of Picturebox. Are examples of this available for Opengl?

I have a c ++ dll. I convert the 4k 30fps data from gstreamer to bitmap and print it to the screen.

pt = DLLWrapper.WrapperSingleCameras (0) is returning the 4k30fps frame from the stream as a pointer.

pt = DLLWrapper.WrapperSingleCameras(0);
    BitmapSingleImage = new Bitmap(rsSplitWidth, rsSplitHeight, rsSplitWidth, System.Drawing.Imaging.PixelFormat.Format8bppIndexed, (IntPtr)pt);
                             
    ColorPalette _palette = BitmapSingleImage.Palette;
    System.Drawing.Color[] _entries = _palette.Entries;

    for (int m = 0; m < 256; m++)
    {
        System.Drawing.Color b = new System.Drawing.Color();
        b = System.Drawing.Color.FromArgb((byte)m, (byte)m, (byte)m);
        _entries[m] = b;
    }

    BitmapSingleImage.Palette = _palette;

    videosGUI.videoPictureBox.Image = BitmapSingleImage;
    videosGUI.videoPictureBox.Refresh();
  • You keep asking the same question over and over. You keep going the wrong way. Stop using the bitmap. Edit the stream directly. Gstreamer already offer filters which apply filter to the video. Your stream will stay a stream and all you will have to do is send that stream to a video player and it will display at the resolution and bitrate it is sending as. If you keep it a stream you can display in a winform wmp control, in a web page, in VLC, in OBS. It will be a standard format – Franck Aug 13 '20 at 18:00
  • @Franck I have to get it as a bitmap. I'll add other things in the future. I will do operations on the frame I read. so I need to get the final bitmap. – Muratakaydin Aug 13 '20 at 21:43
  • Do what you want but you do not need to convert all these frame to bitmap like this to add anything to a video. You want to add a picture in the corner, banner, animated video, sepia, black and white filter, everything is doable with filters. Plus it's still a stream and you can stream somewhere else, save to disk, etc. – Franck Aug 14 '20 at 12:15
  • Are there any examples for this? Streaming the mat frame from the c ++ code to the GUI in c #. @Franck – Muratakaydin Aug 14 '20 at 13:26
  • [Here's](https://gstreamer.freedesktop.org/documentation/video/gstvideooverlay.html?gi-language=c) an example of drawing overlay. [That](https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good/html/gst-plugins-good-plugins-gdkpixbufoverlay.html) is a plugin to display an image on top of your pipeline. And [here](https://stackoverflow.com/questions/43916330/display-gstreamer-sharp-video-stream-in-winforms) a very simple example to display the gstreamer stream to a video player in winforms – Franck Aug 14 '20 at 13:43
  • @Franck Thank you for patiently answering my questions. :) I'm trying with opentk right now. I think I can display the bitmap yield without changing. Another problem occurred, I asked him under the new heading. – Muratakaydin Aug 18 '20 at 13:30
  • @Franck do you have any idea for this ? https://stackoverflow.com/questions/63469704/opentkopengl-bitmap-data-format-problem – Muratakaydin Aug 20 '20 at 08:35
  • No i do not write any texture on anything other than triangles or Quads in OpenGL. anyhow drawing texture is too slow for animation – Franck Aug 20 '20 at 12:10
  • all right. Thank you very much for your answers. @Franck – Muratakaydin Aug 21 '20 at 05:23

0 Answers0