Go to advanced search

by cmisip
Fri Aug 17, 2018 12:02 am
Forum: Advanced users
Topic: Question about brcmjpeg implementation in a program.
Replies: 9
Views: 1176

Re: Question about brcmjpeg implementation in a program.

Thanks for this info. Zoneminder uses multiple Monitor instances and if the access to the hardware JPEG encoder is serialized, then it will be slower than doing parallel software jpeg encodes with libjpeg. So this is not an avenue for optimization. Are there other components that are limited similar...
by cmisip
Thu Aug 16, 2018 7:42 pm
Forum: Advanced users
Topic: Question about brcmjpeg implementation in a program.
Replies: 9
Views: 1176

Re: Question about brcmjpeg implementation in a program.

You do really love finding all the old obscure code! I thought it was something you guys had around the corner yet to publish. :D So that's why I had to manually copy over the library and the include file. I think the first simple question is are you aiming to run on a 0/0W/A/B I will be running it...
by cmisip
Thu Aug 16, 2018 10:35 am
Forum: Advanced users
Topic: Question about brcmjpeg implementation in a program.
Replies: 9
Views: 1176

Question about brcmjpeg implementation in a program.

I tried a test program with brcmjpeg and it is awesome. I want to implement it in zoneminder and I need a little advice on how to do this. Zoneminder has a Monitor class object that is working on a lot of objects of class Image. There could be hundreds of Image objects being manipulated by a Monitor...
by cmisip
Thu Aug 16, 2018 3:47 am
Forum: Advanced users
Topic: I am getting MMAL_EIO (Error 7) when trying to construct a H264 decoder.
Replies: 11
Views: 1785

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

Thanks 6by9. I did mean decoder but I was thinking about the encoder as well. I really appreciate the time you spend answering these questions.

Chris
by cmisip
Wed Aug 15, 2018 12:50 am
Forum: Advanced users
Topic: I am getting MMAL_EIO (Error 7) when trying to construct a H264 decoder.
Replies: 11
Views: 1785

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

So I got this working. I am getting output buffers in the correct size. The stumbling blocks were: 1. The sps and pps data must be sent in band as the first packet to the decoder. I had assumed that setting the input format's extradata fields were enough but that was not the case. 2. The input and o...
by cmisip
Sun Aug 12, 2018 1:08 am
Forum: Advanced users
Topic: I am getting MMAL_EIO (Error 7) when trying to construct a H264 decoder.
Replies: 11
Views: 1785

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

I have avcodec opening an rtsp stream. It reads packets from the stream and then I copy them over to the buffer that I send to the input of the decoder. The extradata is copied over from avcodec as well. The packet returned by avcodec contains NAL units. The first NAL unit contains the SPS, PPS, and...
by cmisip
Sat Aug 11, 2018 6:19 am
Forum: Advanced users
Topic: Decoding H264 packets and format_in->extradata contents
Replies: 3
Views: 703

Decoding H264 packets and format_in->extradata contents

I'm using avcodec to read packets from an h264 rtsp stream and I am trying to decode with the mmal h264 decoder. I could send packets but not receive any. I verified that the packets being sent are valid NAL packets with the leading 0x00000001 start code. I formed format_in->extradata using avcodec'...
by cmisip
Fri Aug 10, 2018 4:48 am
Forum: Advanced users
Topic: Algorithm for writing H264 packets to mp4 file?
Replies: 4
Views: 1811

Re: Algorithm for writing H264 packets to mp4 file?

I finally have a working solution to writing mp4 files with pps and sps info in the avcc atom of the mp4 header using avcodec. It's a lot of work to get rid of one "Error while decoding frame!" but I learned a lot from it. I have a question for the devs though. I haven't written a parser for convert...
by cmisip
Wed Aug 08, 2018 4:32 am
Forum: Advanced users
Topic: Algorithm for writing H264 packets to mp4 file?
Replies: 4
Views: 1811

Re: Algorithm for writing H264 packets to mp4 file?

Well it seems a bit more complicated than I thought. MMAL sends annex b type NAL units and the header config bytes are actually SPS and PPS NAL units. Without these, the video will not play. Mplayer tries to decode the SPS and PPS but errors, however, this makes subsequent frames decodable. In the M...
by cmisip
Sun Aug 05, 2018 5:37 am
Forum: Advanced users
Topic: How to start the connection between container reader and video decoder?
Replies: 0
Views: 183

How to start the connection between container reader and video decoder?

I setup the container reader this way: (taken from mmalplay) //CONTAINER READER SETUP MMAL_STATUS_T status = MMAL_EINVAL; MMAL_COMPONENT_T *reader = 0; if (mmal_component_create(MMAL_COMPONENT_DEFAULT_CONTAINER_READER,&reader) != MMAL_SUCCESS ){ fprintf(stderr,"Could not create reader component\n");...
by cmisip
Sat Aug 04, 2018 11:07 pm
Forum: Advanced users
Topic: Algorithm for writing H264 packets to mp4 file?
Replies: 4
Views: 1811

Re: Algorithm for writing H264 packets to mp4 file?

Seems I just need the leading NAL unit (MMAL_BUFFER_HEADER_FLAG_CONFIG) to be saved once, at the beginning of the file but after the MP4 header. This got rid of the "Error while decoding frame!" errors that were repeating regularly. There is now only one such error at the beginning from having the C...
by cmisip
Sat Aug 04, 2018 4:23 pm
Forum: Advanced users
Topic: Algorithm for writing H264 packets to mp4 file?
Replies: 4
Views: 1811

Algorithm for writing H264 packets to mp4 file?

I've been doing some research on this and as far as I can understand, it seems all you have to do is to save the data buffers you receive from the encoder to a file. Basically, after you have setup the encoder and receiving encoded packets in the output buffer. Init_MP4("camera.mp4"); //In the loop ...
by cmisip
Mon Jul 30, 2018 4:00 am
Forum: Advanced users
Topic: How to use "MMAL_COMPONENT_DEFAULT_CONTAINER_WRITER"
Replies: 1
Views: 212

How to use "MMAL_COMPONENT_DEFAULT_CONTAINER_WRITER"

I assume this is for writing containers such as mp4, avi,etc. Basically feed it a buffer in the format of whatever encoding format it is set at. Is there an example code for creating this component and enabling it? I would assume that it is created like any other component, with setting input and ou...
by cmisip
Sat Jul 28, 2018 4:01 am
Forum: Advanced users
Topic: Can't seem to be able to implement a resizing component.
Replies: 4
Views: 477

Re: Can't seem to be able to implement a resizing component.

I spotted the problem in my code. vc.ril.isp does work with no issues now. I was sending it an I420 frame from avcodec but with the wrong buffer size ( size was based on output dimensions instead of input dimensions so data gets truncated except when input and output dimensions are the same. ) Thank...
by cmisip
Sat Jul 28, 2018 3:54 am
Forum: Camera board
Topic: What is the preferred component to use for format conversion?
Replies: 4
Views: 872

Re: What is the preferred component to use for format conversion?

resize supports cropping whilst isp doesn't
What do you mean by resize supporting cropping?

Thanks,
Chris
by cmisip
Sat Jul 28, 2018 3:49 am
Forum: Advanced users
Topic: There is no automatic cropping to unpadded buffer size?
Replies: 3
Views: 392

Re: There is no automatic cropping to unpadded buffer size?

the encoded size is specified on the OUTPUT port Could you elaborate on this? I don't see any difference with specifying just width and height or vcos aligned width and height in either format_out->es->video or format_out->es->video.crop. When sending a resolution such as 640x360 with format I420 t...
by cmisip
Fri Jul 27, 2018 4:35 am
Forum: Camera board
Topic: What is the preferred component to use for format conversion?
Replies: 4
Views: 872

Re: What is the preferred component to use for format conversion?

Forget about this issue. It was a hardware problem. I will be sending back the camera.

Thanks,
Chris
by cmisip
Fri Jul 27, 2018 4:10 am
Forum: Advanced users
Topic: Can't seem to be able to implement a resizing component.
Replies: 4
Views: 477

Re: Can't seem to be able to implement a resizing component.

It seems the problem is with vc.ril.isp. If the output port resolution is different from the input port resolution, it does not return any buffers. It allows a port commit, port enable and component enable with no complaints. I tried saving PPM and JPEG and both work if the resolution is not changed...
by cmisip
Fri Jul 27, 2018 3:25 am
Forum: Advanced users
Topic: Can't seem to be able to implement a resizing component.
Replies: 4
Views: 477

Can't seem to be able to implement a resizing component.

I tried connecting vc.ril.isp to the jpeg encoder and if I dont change the output dimensions of vc.ril.isp to a new resolution, then the jpeg encoder returns a valid jpeg buffer. If I change the output resolution of vc.ril.isp, then jpeg encoder does not return any buffers. This works, creating vali...
by cmisip
Fri Jul 27, 2018 2:10 am
Forum: Advanced users
Topic: There is no automatic cropping to unpadded buffer size?
Replies: 3
Views: 392

There is no automatic cropping to unpadded buffer size?

I am seeing a green band on the lower border of jpeg images I created using the hardware jpeg encoder when the resolution is 640x360 which is padded to 640x368. I don't see the band when the resolution is 1280x720 which results in an unpadded buffer. I thought the crop setting when setting video inp...
by cmisip
Thu Jul 19, 2018 3:18 am
Forum: Advanced users
Topic: Is there a default rtsp reader?
Replies: 0
Views: 210

Is there a default rtsp reader?

I tried the example_connections.c program and it uses the default reader to open files. However, it does not open rtsp streams. Is it currently possible to open rtsp streams directly without having to use libavcodec?

Thanks,
Chris
by cmisip
Thu Jul 19, 2018 3:15 am
Forum: Camera board
Topic: What is the preferred component to use for format conversion?
Replies: 4
Views: 872

What is the preferred component to use for format conversion?

I am using "vc.ril.isp". However I am having issues with a particular resolution 704x480 displaying alternating green lines on the Right side. It works fine with 640x360, 1280x720. Here is the code: if ( mmal_component_create("vc.ril.isp", &resizer) != MMAL_SUCCESS) { Fatal("failed to create mmal re...
by cmisip
Thu Jul 19, 2018 2:45 am
Forum: Advanced users
Topic: The mmal example programs in github won't call the output callback
Replies: 10
Views: 1046

Re: The mmal example programs in github won't call the output callback

That kinda took me into the forest with no clear way back. I think what you are saying is that the components will always pick what is appropriate for width and height, aligning as necessary. But to make sure I use the cropped dimensions when reading the buffer data. Am I still in the forest? Incide...
by cmisip
Wed Jul 18, 2018 3:32 pm
Forum: Advanced users
Topic: The mmal example programs in github won't call the output callback
Replies: 10
Views: 1046

Re: The mmal example programs in github won't call the output callback

If I understand correctly then the even if the width and height supplied to input format is not a multiple of 32,16 respectively they are rounded up. If I don't set a crop value, the default crop value is automatically the supplied width and height ( not the vcos_aligned values ) ? This is what I se...

Go to advanced search