Go to advanced search

by cmisip
Sat Oct 13, 2018 10:29 pm
Forum: Advanced users
Topic: JPEG encoder output tearing
Replies: 6
Views: 1027

Re: JPEG encoder output tearing

It seems the problem is a bit higher up in the code yet. Using libjpeg results in the same issue, so the RGB buffer is corrupted and the corrupted RGB buffer is sent to the jpeg block which therefore got blamed for the problem. The RGB buffer is created by vc.ril.isp from YUV420 packets provided by ...
by cmisip
Fri Oct 12, 2018 1:06 am
Forum: Advanced users
Topic: JPEG encoder output tearing
Replies: 6
Views: 1027

Re: JPEG encoder output tearing

Here is a jpeg output that shows the problem. There seems to be a stair shaped seam in the middle of the images. https://ibb.co/gKMxzU https://ibb.co/bPNLKU The second I think is when the IP camera is switching to or from IR mode so there is a big lighting difference between the "merged" frames. Wil...
by cmisip
Fri Sep 28, 2018 1:07 am
Forum: Advanced users
Topic: Indexing into the motion vector array in C++
Replies: 2
Views: 661

Re: Indexing into the motion vector array in C++

I needed to change the value of private members of Coord class from another class that is neither a friend or derived. That line is a Coord class public member function call that returns a reference to the private member x or y that is assignable a value ( can be on the left side of an assignment op...
by cmisip
Mon Sep 24, 2018 11:33 pm
Forum: Advanced users
Topic: Direction of Motion Vectors from h264 stream
Replies: 3
Views: 937

Re: Direction of Motion Vectors from h264 stream

Thanks for the reply 6by9. I stopped working on this project last year and decided to pick it up again this year. The farthest I got then was visualizing the location of the blocks. Now I can see the direction. I am having a lot of fun working on it. This opens up new possibilities such as direction...
by cmisip
Sun Sep 23, 2018 5:17 pm
Forum: Advanced users
Topic: Direction of Motion Vectors from h264 stream
Replies: 3
Views: 937

Re: Direction of Motion Vectors from h264 stream

I changed the mmal_motion_vector struct into : struct mmal_motion_vector { int8_t x_vector; int8_t y_vector; int16_t sad; }; And that change resulted in motion vectors with arrows in the display pointing in the direction opposite the motion (pointing to where the macroblock moved FROM). I am now see...
by cmisip
Sat Sep 22, 2018 4:07 pm
Forum: Advanced users
Topic: Direction of Motion Vectors from h264 stream
Replies: 3
Views: 937

Direction of Motion Vectors from h264 stream

Hello again, I have been working on trying to visualize the motion vectors including their location and direction as displayed in an RGB buffer by modifying the buffer to draw pixels in the patterns of arrows going towards 8 directions. For some reason, I am only seeing arrows that are directed east...
by cmisip
Mon Sep 17, 2018 2:30 am
Forum: Advanced users
Topic: JPEG encoder output tearing
Replies: 6
Views: 1027

Re: JPEG encoder output tearing

Here is the jpeg encoder initialization: int FfmpegCamera::OpenMmalJPEG(AVCodecContext *mVideoCodecContext){ // Create the jcoder component. if ( mmal_component_create(MMAL_COMPONENT_DEFAULT_IMAGE_ENCODER, &jcoder) != MMAL_SUCCESS) { Fatal("failed to create mmal jpeg encoder"); } // CONTROL PORT SET...
by cmisip
Sun Sep 16, 2018 4:43 am
Forum: Advanced users
Topic: JPEG encoder output tearing
Replies: 6
Views: 1027

JPEG encoder output tearing

It's as if the jpeg encoder did not finish writing the frame but returned the output buffer anyway. The top half of the jpeg gets misaligned with the bottom half. It doesn't happen all the time. I'll look into it further.

Thanks,
Chris
by cmisip
Sun Sep 16, 2018 4:39 am
Forum: Advanced users
Topic: How do you compute the maximum combination of rtsp input video that the RPI can simultaneously service.
Replies: 4
Views: 875

Re: How do you compute the maximum combination of rtsp input video that the RPI can simultaneously service.

I seem to be getting some tearing with the jpegs produced by the jpeg encoder. Don't know what is causing this.

I'll start a new thread.

Chris
by cmisip
Sat Sep 15, 2018 9:23 pm
Forum: Advanced users
Topic: Indexing into the motion vector array in C++
Replies: 2
Views: 661

Indexing into the motion vector array in C++

I want to make sure that I am properly assigning coordinates to the motion vector frames. This is what I am doing. Get the number of macroblocks. For a 640x360 frame: int frame_width=monitor->Width()+16; //add the extra column, resulting in 656 int frame_height=((monitor->Height()+16)/16)*16; //make...
by cmisip
Sat Sep 15, 2018 4:46 pm
Forum: Advanced users
Topic: Getting lock memory failure on videocore with zero copy
Replies: 7
Views: 1248

Re: Getting lock memory failure on videocore with zero copy

I am using a RPI 3B. This is the output of uname a- Linux zoneminder 4.14.50-v7+ #1122 SMP Tue Jun 19 12:26:26 BST 2018 armv7l GNU/Linux I have been running the program off and on because I am working on other aspects of the program at this time but during the time that I have run it, I haven't seen...
by cmisip
Sat Sep 08, 2018 1:28 am
Forum: Advanced users
Topic: How do you compute the maximum combination of rtsp input video that the RPI can simultaneously service.
Replies: 4
Views: 875

Re: How do you compute the maximum combination of rtsp input video that the RPI can simultaneously service.

It is possible to run components in parallel processes. And in each process, you can chain multiple components. I was able to run 4 cameras simultaneously in 640x360 last year when I started looking into this. I'm just continuing the project, sans the multiple cameras which have shipped out. I have ...
by cmisip
Sat Sep 08, 2018 12:47 am
Forum: Advanced users
Topic: Getting lock memory failure on videocore with zero copy
Replies: 7
Views: 1248

Re: Getting lock memory failure on videocore with zero copy

Could the problem with zero copy be related to some calloc errors I notice in dmesg. I followed the instructions in another thread and added the following in config.txt gpu_mem=256 gpu_mem_256=160 gpu_mem_512=416 cma_lwm=16 cma_hwm=32 And then in cmdline.txt coherent_pool=6M smsc95xx.turbo_mode=N I ...
by cmisip
Thu Sep 06, 2018 11:29 pm
Forum: Advanced users
Topic: How do you compute the maximum combination of rtsp input video that the RPI can simultaneously service.
Replies: 4
Views: 875

Re: How do you compute the maximum combination of rtsp input video that the RPI can simultaneously service.

I am going to try to answer my own question here. Correct me if I am wrong. The video decoder and encoder share the same block. They share the same resource but not the same bandwidth. The decoder can do 1920x1080X60 or 124 Mpixels/s. 1080P60 decode is aided by automatically overclocking when the co...
by cmisip
Tue Sep 04, 2018 3:43 am
Forum: Advanced users
Topic: How do you compute the maximum combination of rtsp input video that the RPI can simultaneously service.
Replies: 4
Views: 875

How do you compute the maximum combination of rtsp input video that the RPI can simultaneously service.

I managed to get 1920x1080 motion vector detection in zoneminder with a ring buffer of 150 RGB frames ( it had to be big to avoid buffer overruns but I am also running all this on an sd card instead of a hard disk) at 15 fps ( I have throttled the source to 15 fps for now). Its early so there are pr...
by cmisip
Sun Sep 02, 2018 3:51 am
Forum: Advanced users
Topic: I am getting MMAL_EIO (Error 7) when trying to construct a H264 decoder.
Replies: 11
Views: 1786

Re: I am getting MMAL_EIO (Error 7) when trying to construct a H264 decoder.

You know what. I think the decoder input buffer size does not scale up properly with the higher resolution rtsp stream. It seems decoder->input[0]->buffer_size_recommended is not adequate for the job. It stays at 81920 despite the increased resolution. Ffmpeg's mmal_dec uses 512*1024 for input buffe...
by cmisip
Sun Sep 02, 2018 3:39 am
Forum: Advanced users
Topic: I am getting MMAL_EIO (Error 7) when trying to construct a H264 decoder.
Replies: 11
Views: 1786

Re: I am getting MMAL_EIO (Error 7) when trying to construct a H264 decoder.

I disabled zero copy for now. I updated the code to shift some computational overhead over to the capture process. In particular, the capture process is now doing the motion detection and sending the alarm_pixels over to the analyse process via shared mem. Since this is happening in the capture proc...
by cmisip
Sat Sep 01, 2018 3:26 pm
Forum: Advanced users
Topic: I am getting MMAL_EIO (Error 7) when trying to construct a H264 decoder.
Replies: 11
Views: 1786

Re: I am getting MMAL_EIO (Error 7) when trying to construct a H264 decoder.

Regarding the SPS and PPS data, it does not need to be sent in band as I thought. It is enough to set the extradata field. I decided to turn it off in zmc and it still worked. Must be some confusion in my earlier test programs.

Thanks,
Chris
by cmisip
Tue Aug 28, 2018 2:30 am
Forum: Advanced users
Topic: Getting lock memory failure on videocore with zero copy
Replies: 7
Views: 1248

Re: Getting lock memory failure on videocore with zero copy

Here is a little more info. I get this in the logs every now and then: [ERROR: PORT: vc.ril.video_decode:ctr:0 Type: 7 This is followed by a BUS error. I think this is coincident with these errors in dmesg: [ 272.234787] [vc_sm_ioctl_lock]: failed to lock memory on videocore (status: 0, trans_id: 30...
by cmisip
Tue Aug 28, 2018 2:03 am
Forum: Advanced users
Topic: Getting lock memory failure on videocore with zero copy
Replies: 7
Views: 1248

Re: Getting lock memory failure on videocore with zero copy

I'll post the mmal routines here. Maybe you can look it over to see if there are any obvious errors. OpenMMalDecoder. Why does it need 20 input buffers? int FfmpegCamera::OpenMmalDecoder(AVCodecContext *mVideoCodecContext){ // Create the decoder component. if ( mmal_component_create(MMAL_COMPONENT_D...
by cmisip
Mon Aug 27, 2018 1:15 am
Forum: Advanced users
Topic: Getting lock memory failure on videocore with zero copy
Replies: 7
Views: 1248

Getting lock memory failure on videocore with zero copy

This is the error I am getting occasionally. [vc_sm_ioctl_lock]: failed to lock memory on videocore (status: 0, trans_id: 52232) [vcsm_vma_fault]: failed to lock memory on videocore (status: 0) [vc_sm_ioctl_lock]: failed to lock memory on videocore (status: 0, trans_id: 52499) [vcsm_vma_fault]: fail...
by cmisip
Sat Aug 25, 2018 3:38 pm
Forum: Advanced users
Topic: I am getting MMAL_EIO (Error 7) when trying to construct a H264 decoder.
Replies: 11
Views: 1786

Re: I am getting MMAL_EIO (Error 7) when trying to construct a H264 decoder.

I was able to get parallel components of video encoder and video resizer ( vc.ril.isp for format conversion only ) up and running. The decoder output is sent to the encoder and the resizer in parallel. I did not want to use the splitter because I wanted to save bandwidth. As per your recommendation,...
by cmisip
Sat Aug 25, 2018 3:12 pm
Forum: Advanced users
Topic: Question about brcmjpeg implementation in a program.
Replies: 9
Views: 1177

Re: Question about brcmjpeg implementation in a program.

Thanks again 6by9. That fixed the issue. The lesson here then is to just copy from the output buffer what you need. Don't copy the entire output buffer as it padded in the case when the resolutions were adjusted upward to multiples of 32 or 16. I'm doing this with the rgb output of vc.ril.isp ( just...
by cmisip
Sun Aug 19, 2018 12:26 am
Forum: Advanced users
Topic: I am getting MMAL_EIO (Error 7) when trying to construct a H264 decoder.
Replies: 11
Views: 1786

Re: I am getting MMAL_EIO (Error 7) when trying to construct a H264 decoder.

Just an FYI for anybody else trying to write something like this. Order matters very much with setting up the mmal components. I spent the last few hours trying to figure out why the video encoder component was failing on port format commit of the output port with an EINVAL error. The reason was I e...
by cmisip
Sat Aug 18, 2018 3:28 am
Forum: Advanced users
Topic: Question about brcmjpeg implementation in a program.
Replies: 9
Views: 1177

Re: Question about brcmjpeg implementation in a program.

I am actually using imagemagick display to display the jpeg file. The test program I put together saves the jpeg output to a file. Connecting the decoder output to jpeg encoder directly results in a green band on the bottom. If I connect vc.ril.isp between the decoder and jpeg encoder to do an inter...

Go to advanced search