开发者

How to change the RGB value of the pixels, to read out and to save the changes of every frame on TV

开发者 https://www.devze.com 2023-03-29 12:12 出处:网络
I\'d like to make a C++ program that changes the RGB val开发者_JAVA技巧ue of the pixels of every frame of the MPEG2 file to be broadcasted, and reads out and saves the changed value of the pixels of e

I'd like to make a C++ program that changes the RGB val开发者_JAVA技巧ue of the pixels of every frame of the MPEG2 file to be broadcasted, and reads out and saves the changed value of the pixels of every frame on TV screen simultaneously with the broadcasting. Can it work simultaneously with the broadcasting if all the pixel value of the screen or the certain scanning line of the screen has to be read out and to be saved? And what is the best way of doing it and the hardware requirement? And would you give me some tip for my program?


The iceberg that typically sinks that Titanic is the sheer amount of data. Uncompressed mpeg2 in the main profile is 720 pixels hor x 576 ver x 3 bytes per pixel x 30 frames = 37 megabytes per second. Too much for a hard disk. And you can't spend more than 30 milliseconds per frame. And you'll easily lose more from a context switch. Focus on those basic constraints.


OpenCV will be able to perform the functions you need. Whether or not the stream I/O delay is going to be sufficiently small is dependent on your requirements and the hardware you have available.

Leveraging the processing onto graphics server via CUDA/OpenCL will probably be the best way to go.


When processing large amounts graphics (usually game graphics) people often use graphics card functionallity. Most graphics cards have a GPU (graphics processor unit) these GPU's can run programms called pixel shaders and vertex shaders they can process a large number of pixels very quickly.

I'm not sure how this may fit with what your trying to do but It may be worth your time looking into it to see if you can some how use the GPU instead of using the CPU.

I think OpenGL lib can be used to access the GPU functionallity but I'm no expert on that.

0

精彩评论

暂无评论...
验证码 换一张
取 消