Go to advanced search

by DanR
Wed Sep 16, 2020 9:45 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: H264 Encoder quality settings - are there any
Replies: 1
Views: 162

H264 Encoder quality settings - are there any

Hi All,

Are there any settings to change the quality of the captured video through MMAL as I can't seem to find anything relating to this, specifically reducing the quality to save storage space?

Kind Regards,

Dan
by DanR
Fri Aug 14, 2020 7:24 am
Forum: C/C++
Topic: Assertion Failure from MMAL - Help!
Replies: 6
Views: 667

Re: Assertion Failure from MMAL - Help!

In case this is useful to anyone it seems that at 1080p50 you can only use the video encoder without adding an image encoder. If you add an image encoder the best I can get from it for a long period of time is to use a resolution of 1280x1024p50. It appears as though a higher resolution uses a highe...
by DanR
Wed Jul 29, 2020 8:35 am
Forum: C/C++
Topic: Assertion Failure from MMAL - Help!
Replies: 6
Views: 667

Re: Assertion Failure from MMAL - Help!

Ok so this doesn't happen on a pi 4B, that's strange but very noteworthy. Is there something broken in Raspberry Pi OS that is killing the gpu??? I have no idea and can't find out so I thought I'd post this in case someone picks it up and finds the issue for others.... I suspect no one will take thi...
by DanR
Fri Jul 24, 2020 9:48 am
Forum: C/C++
Topic: Assertion Failure from MMAL - Help!
Replies: 6
Views: 667

Re: Assertion Failure from MMAL - Help!

Well it still happens just a lot later than it did.

So @6by9, what does the assertion failure mean, I can't find anywhere what it means and why or what causes it. This is the root cause of my issue I believe and once I've sorted it or had help to sort it I should be golden....

Cheers,

Dan
by DanR
Thu Jul 23, 2020 4:50 pm
Forum: C/C++
Topic: Assertion Failure from MMAL - Help!
Replies: 6
Views: 667

Re: Assertion Failure from MMAL - Help!

Hmm, seems as though sending the ISP output to both the video encoder and the image encoder at the same time is a bad idea, the gpu on the pi3b+ just cannot handle it and randomly falls over. So, the things that can be done to eliminate this are as follows: 1) Interleave the frames between encoders,...
by DanR
Wed Jul 22, 2020 2:35 pm
Forum: C/C++
Topic: Assertion Failure from MMAL - Help!
Replies: 6
Views: 667

Re: Assertion Failure from MMAL - Help!

I have some more debug output if that helps? I've set the number of buffers everywhere to 8 by the way and it's still crashing. Here is the result of "sudo vcdbg msg log" after running "sudo vcgencmd vcos log set mmalsrv trace": I've inserted a blank line where I think it all starts to go wrong whic...
by DanR
Wed Jul 22, 2020 9:34 am
Forum: C/C++
Topic: Assertion Failure from MMAL - Help!
Replies: 6
Views: 667

Assertion Failure from MMAL - Help!

Hi, I have modified 6by9's yavta code from github.com/6by9/yavta and added a jpeg encoder and all the other parts such as buffer copying, thread on videocore etc etc. It runs fine for about 1 hour ish and then fails with this error: assertion failure:/home/pi/userland/interface/mmal/vc/mmal_vc_clien...
by DanR
Tue Jul 21, 2020 8:52 am
Forum: C/C++
Topic: Writing to a pipe stalls if it's not read
Replies: 9
Views: 832

Re: Writing to a pipe stalls if it's not read

Hi 6by9, I'm having trouble with my version of yavta at the moment (added image encoder functionality) and I can't seem to find the cause of one of two errors listed below which happen around 57mins to 1hr20. Do you have any suggestions on where to look? What does the assertion failure error mean? E...
by DanR
Fri Jul 10, 2020 7:55 am
Forum: C/C++
Topic: Writing to a pipe stalls if it's not read
Replies: 9
Views: 832

Re: Writing to a pipe stalls if it's not read

Hi 6by9, What does this error relate to and how can I fix it: assertion failure:/home/pi/userland/interface/mmal/vc/mmal_vc_client.c:204:mmal_vc_lookup_client_context():client_context_pool.contexts[CLIENT_CONTEXT_MAGIC_MASK(index)].inuse Am I not giving the vc routines enough time to finish or is th...
by DanR
Thu Jul 02, 2020 11:15 am
Forum: C/C++
Topic: Writing to a pipe stalls if it's not read
Replies: 9
Views: 832

Re: Writing to a pipe stalls if it's not read

So I issued an fcntl to set the nonblocking mode after reading and or'ing the flags. That's not helped, actually it's worse! So I think my only option is to write a quick live555 app to connect locally to the RTSP stream server so the stdout pipe is consumed in a proper manner and prevents the corru...
by DanR
Thu Jul 02, 2020 10:30 am
Forum: C/C++
Topic: Writing to a pipe stalls if it's not read
Replies: 9
Views: 832

Re: Writing to a pipe stalls if it's not read

Hmm, the problem with using select is that it holds up the flow somewhat even with a really small timeout value set which means the stream gets borked with dropped frames. Can I fopen the pipe with a non blocking flag set instead? I've seen this with "open" but not with "fopen", so my question is re...
by DanR
Tue Jun 30, 2020 11:53 am
Forum: C/C++
Topic: Writing to a pipe stalls if it's not read
Replies: 9
Views: 832

Re: Writing to a pipe stalls if it's not read

Thanks jahboater, I'll give that a go! sorry I missed your previous post.

Kind Regards,

Dan
by DanR
Tue Jun 30, 2020 11:13 am
Forum: C/C++
Topic: Writing to a pipe stalls if it's not read
Replies: 9
Views: 832

Re: Writing to a pipe stalls if it's not read

Thanks for the replies! James wrote: So you want to throw away part of the H264 bitstream? How do you propose to deal with a datastream that has chucks missing? Just rely on it resyncing at some point in the future, hopefully the next I-frame? The sending process needs to check if the pipe is alread...
by DanR
Tue Jun 30, 2020 10:36 am
Forum: C/C++
Topic: Writing to a pipe stalls if it's not read
Replies: 9
Views: 832

Writing to a pipe stalls if it's not read

Hi All, I've come across an issue that I've no idea how to fix and after searching t'internet I'm none the wiser so I thought I'd ask the myriad of greatness, the forums here. So, when you pipe the output from an application such as "cat largefile.txt | readerapp" and the readerapp is busy, the cat ...
by DanR
Tue Jun 30, 2020 9:33 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Reading single frames piped from Raspivid in C/C++
Replies: 43
Views: 2510

Re: Reading single frames piped from Raspivid in C/C++

Hi 6by9, Well it was down to setting the MMAL_PARAMETER_JPEG_RESTART_INTERVAL parameter on the wrong encoder (video not the image encoder), what a wally I am!!! Just need to sort out saving the image data and adding a lock semaphore around the save bit so it's not running twice over ;) Thank you eve...
by DanR
Tue Jun 30, 2020 8:27 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Reading single frames piped from Raspivid in C/C++
Replies: 43
Views: 2510

Re: Reading single frames piped from Raspivid in C/C++

Hi 6by9, So the image encode component does connect up and get configured correctly as when I deliberately set it to MJPEG I can see a configuration error output with: sudo vcdbg log msg However with the image encoder parts added I get this only when I run the application in the vcdbg output 1603899...
by DanR
Mon Jun 29, 2020 2:13 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Reading single frames piped from Raspivid in C/C++
Replies: 43
Views: 2510

Re: Reading single frames piped from Raspivid in C/C++

Hi 6by9, I've added a vc.ril.image_encode component to the "setup_mmal" function and added the buffer pool, set the input to the same as the vc.ril.video_encode input and then set the output port format to JPEG without any errors on startup. With these added I start the application and 2 buffers are...
by DanR
Mon Jun 29, 2020 9:17 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Reading single frames piped from Raspivid in C/C++
Replies: 43
Views: 2510

Re: Reading single frames piped from Raspivid in C/C++

Hi 6by9, I'm having difficulty determining what the difference is between the two functions video_save_image and save_thread in yavta as they both appear to do the same thing and have write calls. I'm guessing one saves the image or rather H264 stream out to a file so what does the other one do? Man...
by DanR
Fri Jun 26, 2020 8:05 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Reading single frames piped from Raspivid in C/C++
Replies: 43
Views: 2510

Re: Reading single frames piped from Raspivid in C/C++

Hi 6by9, Yes I meant the port->userdata sorry about that. You said you also want some additional condition for "and I want to capture a still encode of this image too" so does that mean I can't create a component of "vc.ril.image_encode" and set the trigger parameter just as I did in RaspiVid? Or do...
by DanR
Thu Jun 25, 2020 1:01 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Reading single frames piped from Raspivid in C/C++
Replies: 43
Views: 2510

Re: Reading single frames piped from Raspivid in C/C++

Hi 6by9, I tried v4l2_mmal which gave an appalling result, the stream was frame glitchy and had errors in the image encoding. Then I noticed you said yavta and not v4l2_mmal and that works a treat so all I need to do now is add the image encoder pipeline and callbacks. 2 questions though: 1) Should ...
by DanR
Wed Jun 24, 2020 1:34 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Reading single frames piped from Raspivid in C/C++
Replies: 43
Views: 2510

Re: Reading single frames piped from Raspivid in C/C++

Hi 6by9, Thanks for that, I'll switch off all debugging and check it before enabling the pipe to the stream server. I appreciate that the TC358743 and ADV7280A-M unicam drivers are unsupported. I can get the TC358743 to run as many times as I like in a row by using a gpio pin to pull the reset line ...
by DanR
Wed Jun 24, 2020 8:12 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Reading single frames piped from Raspivid in C/C++
Replies: 43
Views: 2510

Re: Reading single frames piped from Raspivid in C/C++

I really don't understand how the video just works for ages but then dies after I take a still capture, not during but after! I'm really really stuck at this point. Should I be looking at some parameter settings? The trouble is those have zero documentation though so I'm shooting in the dark. Is it ...
by DanR
Tue Jun 23, 2020 10:10 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Reading single frames piped from Raspivid in C/C++
Replies: 43
Views: 2510

Re: Reading single frames piped from Raspivid in C/C++

Hi 6by9, They do indeed pause but they never resume after the capture. Should I be setting a flag to pause the video, capture image and then resume after? Or should I be resetting the flag for the image capture once done? EDIT: Now tried both of these and no joy. I was writing to the sd card and the...
by DanR
Tue Jun 23, 2020 8:47 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Reading single frames piped from Raspivid in C/C++
Replies: 43
Views: 2510

Re: Reading single frames piped from Raspivid in C/C++

Hi 6by9 and anyone that can assist, Right, I have a big problem with this at the moment. I've managed to locate where the code loops normally when capturing video in "running = wait_for_next_change(&state);" so I changed the code to ignore that line and removed the "vcos_sleep(ABORT_INTERVAL);" and ...
by DanR
Mon Jun 22, 2020 2:33 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Reading single frames piped from Raspivid in C/C++
Replies: 43
Views: 2510

Re: Reading single frames piped from Raspivid in C/C++

Ok, it seems that if there is a video output capture set in RaspiVid args then the image capture fails. Ie if I use the following line: raspivid -w 1920 -h 1080 -fps 50 -n -b 6000000 -t 0 then a 10 second timeout sets the capture parameter and I get a 1.2Mb jpeg, fantastic! However, if I use this: r...

Go to advanced search