Hello, I'm new to the forums, so I apologize if I'm posting in the wrong place or for anything else that may be wrong. It is kind of a broad question, so this seemed like the right place to put it.
I am having a problem with working with video. I have a relatively simple concept; basically, I take several video streams and display/hide them as they are needed. I have no problems with this part. The tricky part is that I need to modify one of the video streams to add overlays to it. Again, not a problem. The problem comes in with the latest change to the overall system. All previous systems had been using analog cameras and converted to digital through USB. This works great with DirectShow, I could do everything I needed. The newest system uses IP cameras instead of analog cameras. Now all data is transferred over the network. I cannot, for the life of me, get this to work with DirectShow. I have tried several other approaches as well:
1. I tried using the ActiveX component supplied by the camera manufacturer (Grandstream Networks). This works great for displaying the video, uses up very little memory, and minimizes the complexity of the overall code. The problem here is I cannot create overlays. I can put picture boxes over the image, but I need to make parts of each overlay clear, and when I do that, the picturebox does not redraw the video, just the background of the ActiveX control. I tried accessing the ActiveX controls graphic, but I cannot access its paint event, so If I add the overlay, it disappears with the next frame. This ended up being a dead end.
2. I tried accessing the video stream directly and displaying it frame by frame, then modifying each frame before it is displayed. The obvious problem here is that as the image takes up more and more of the screen, more and more CPU is consumed. At about half of the required screen size, I am at 100% CPU. This approach is also not desired because it requires me to convert the data stream to mjpeg instead of the much smaller H264. Again, I hit a dead end. I also looked at using DirectX to display the images, I figured if I can unload the image processing to the graphics card, it would save the CPU and I could continue running the rest of the program. However, I am new to DirectX, and good documentation is rather hard to find, so it has been slow going. This approach may work, I just haven't figured out how to do it.
3. I tried to create a source filter for DirectShow to be able to keep all of my old code, and just modify the source. I cannot find any documents on how to do this, and all of the filters I have downloaded and tried do not work. It seams like this should be as easy as telling a standard source filter that the source is a URL and inserting a converting filter, but I have had zero luck with this approach.
If anyone has any advice on how I should continue, it would be much appreciated. I cannot waste anymore time just to find another dead end.
I am having a problem with working with video. I have a relatively simple concept; basically, I take several video streams and display/hide them as they are needed. I have no problems with this part. The tricky part is that I need to modify one of the video streams to add overlays to it. Again, not a problem. The problem comes in with the latest change to the overall system. All previous systems had been using analog cameras and converted to digital through USB. This works great with DirectShow, I could do everything I needed. The newest system uses IP cameras instead of analog cameras. Now all data is transferred over the network. I cannot, for the life of me, get this to work with DirectShow. I have tried several other approaches as well:
1. I tried using the ActiveX component supplied by the camera manufacturer (Grandstream Networks). This works great for displaying the video, uses up very little memory, and minimizes the complexity of the overall code. The problem here is I cannot create overlays. I can put picture boxes over the image, but I need to make parts of each overlay clear, and when I do that, the picturebox does not redraw the video, just the background of the ActiveX control. I tried accessing the ActiveX controls graphic, but I cannot access its paint event, so If I add the overlay, it disappears with the next frame. This ended up being a dead end.
2. I tried accessing the video stream directly and displaying it frame by frame, then modifying each frame before it is displayed. The obvious problem here is that as the image takes up more and more of the screen, more and more CPU is consumed. At about half of the required screen size, I am at 100% CPU. This approach is also not desired because it requires me to convert the data stream to mjpeg instead of the much smaller H264. Again, I hit a dead end. I also looked at using DirectX to display the images, I figured if I can unload the image processing to the graphics card, it would save the CPU and I could continue running the rest of the program. However, I am new to DirectX, and good documentation is rather hard to find, so it has been slow going. This approach may work, I just haven't figured out how to do it.
3. I tried to create a source filter for DirectShow to be able to keep all of my old code, and just modify the source. I cannot find any documents on how to do this, and all of the filters I have downloaded and tried do not work. It seams like this should be as easy as telling a standard source filter that the source is a URL and inserting a converting filter, but I have had zero luck with this approach.
If anyone has any advice on how I should continue, it would be much appreciated. I cannot waste anymore time just to find another dead end.