Thanks. example_basic_1.c now works when I adjusted the resolution to the video resolution. I am using 640x360 video resolution and notice the output of the decoder at 640x368. It seems that it will automatically adjust the frame size to the next multiple of 32 for x and 16 for y. Does that mean I d...
And now example_basic_2.c works and is retrieving decoded frames. However, example_basic_1.c hangs, showing a bunch of "sending 1920 bytes" but no decoded frames returned.
I got the clumsy data structure working and I haven't seen any alignment traps after running for a few days. There are two processess sending information via mmap. One is the capture daemon that is sending vector data and the other is the analysis daemon which is checking to see if the vectors are i...
I wonder if this has something to do with the issue I am having. A frame that has resolution of 704x480 when converted to jpeg from RGB shows horizontal green lines on the Right side from top to bottom. If the frame size was 640x360, it encodes to jpeg fine without any artifacts. I do notice that fo...
I am actually at that point. I made sure to make the optimizations in a different branch. The program I am working on has a performance bottleneck and the raspberry has limited memory. I am trying to solve both issues but I did think more than twice about making the code more complex in order to gai...
I will be using memcpy to load values into a buffer and read from it. I therefore need to create a buffer of uint32_t* to be assured that I am given an address that is 4 byte aligned. Instead of saving a 4 byte word and using bit operations, use a struct with 4 members that are one byte size. In the...
I need to save memory for a program that I am working on. It deals with a series of int8_t value pairs. If I put two of these pairs in a struct ( the pairs are unrelated and really should be dealt with individually in a loop iteration) , so that the struct is 4 bytes long, would that still incur a p...
What is the use of the extra column? If I calculate coordinates as the top left of the macroblock, the last column's coordinates would be past the size of the frame.
I am using it on ZoneMinder to see if motion vectors could be used as alternative means for detecting motion. Right now they use pixel analysis. Don't know if motion vector analysis will ever be practical. I am trying to ferret out alignment trap errors so I am making sure that I have not made wrong...
For a specific resolution such as 704x480, there would be ( 704+16 )/16 = 45 tiles in a horizontal row and 480/16 = 30 rows. So to see if motion did happen in a macroblock, I just need to check if the absolute value of the x_vector and absolute value of the y_vector is greater than zero. If its grea...
I get the proper buffer format from vc.ril.isp and I can stream the data in jpeg format with a timestamp. However, the timestamps are erratic, jumping forward and backward. If I use swscale, there is no problem. I wonder if there is something that I initialized wrong. Utility functions: void FfmpegC...
I guess for anyone going down this road, there is vc.ril.isp which is a component that does resizing as well but with support for RGBA, RGB24 and I420 format conversion. That's what I ended up using.
I cant seem to get the pipeline working form MMAL_ENCODING_RGB24 or MMAL_ENCODING_BGR24. It works for MMAL_ENCODING_RGBA. MMAL_COMPONENT_T *resizer = 0; MMAL_ES_FORMAT_T *format; MMAL_PORT_T *input_port = NULL, *output_port = NULL; MMAL_POOL_T *pool_rin = 0, *pool_rout = 0; //create the camera compo...
Is there any benefit to aligning data bytes to 64 bytes in the rasberry pi 3? This is running raspbian. if(((unsigned long)shared_mbuff % 64) != 0) { // Align images buffer to nearest 64 byte boundary Debug(3,"Aligning shared memory buffer to the next 64 byte boundary"); shared_mbuff = (uint8_t*)((u...
I think both the resizer and the splitter can do format conversions from yuv to rgb or gray. In that case, If I want to replace ffmpeg's swscale routine which does both scaling and format conversion, all I need is the resizer? I want to try to minimize cpu overhead and gpu memory as much as possible...
I was looking over raspivid source and if I understand things correctly, a splitter component can be created to perform format conversions. I have an h264 camera being decoded in hardware and feeding YUV420 buffers to the h264 encoder. I am thinking that I could create a splitter component and feed ...
Now I have 5 cameras at 640x360 running hardware decode and encode. I don't dare add another one because It might start swapping. Load : load average: 1.59, 1.69, 1.98 Memory utilization is at : KiB Mem: 766876 total, 718944 used, 47932 free, 31084 buffers KiB Swap: 102396 total, 40036 used, 62360 f...
I have been trying different combinations and was successfully able to activate 4 cameras at 704x480 using hardware decode and encode after I adjusted the gpu memory to 256. It is a balancing act as at this resolution, zmc and zma consume 10-13% memory each which only leaves less than 20% for other ...
@6by9 Good to hear from you again. For some reason, I can only use the hardware decoder and encoder on three cameras. If I try the fourth camera, I get errors. I am using 640x360x24 right now. So that yields 124416000 / 5529600 or 22 streams. If I count each encode and decode separately, thats just ...
I managed to get the code up and running on a fork of ZoneMinder. The code is on github: https://github.com/cmisip/ZoneMinder Thanks especially for 6by9's insights, who seem to have decided not to talk to me anymore... in this thread. Perhaps I should have started a new thread. :) Looking forward to...
Well I did confirm that it works by overlaying the motion vectors on video. I was able to coordinate sending YUV420 data and receiving motion vectors for each particular frame. The way I did it was to send an EOS to the encoder after I get the side info buffer. The encoder responded with an EOS. I j...
I think my assumption was pretty near accurate. The video frame is tiled by 16x16 macroblocks left to right and then from top to down row by row with the extra column spilling out of the right side. I just needed a bit more imagination to recognize the moving shapes in front of the camera. I couldn'...