http://keyj.emphy.de/files/projects/SA_paper.pdf. I don't know if another decoder could handle this better or if this is normal, but then the solution was to increase the frequency of the I frames. using "raspivid -g 1" the I frames are then sent every frame. Then the problem is solved because then I receive as new a frame as fast possible and my video queue is always at most 1 deep (unless whatever algorithm that is running on the server is too slow to consume the stream).
I added code in
https://github.com/arcanon/raspbot/blob/master/h264decoder.h
to detect the NAL markers and also check how full the frame queue was.
if ((data[i] == 0) &&(data[i+1] == 0) &&(data[i+2] == 0) &&(data[i+3] == 1)){NALCount++;nalFound = true;....}
and
if ((m_reader->framesInQueue()- start) > 1){falseCount+= (m_reader->framesInQueue()- start);printf("%s, error frames more %d size %d fa %d, nc %d fc %d\n", this->m_vid_server.c_str(), (m_reader->framesInQueue()- start), prevSize, framesAdded, NALCount, falseCount); }
1 comment:
I need to get the two raspberry pi's cameras out put on the same screen. How did you do that.
Thanks in advance.
Post a Comment