Recording high quality video using a local buffer?

View: New views
6 Messages — Rating Filter:   Alert me  

Recording high quality video using a local buffer?

by Grant-45 :: Rate this Message:

| View Threaded | Show Only this Message

Currently I have video recording working, but since I need higher
quality video I was trying to keep a buffer on the client side and
then wait for the buffer to upload after the recording stops. The
problem is I don't know what net status event to wait for to know when
the buffer has finished uploading.

Right now when a person clicks the stop recording button I set the
camera and audio on the NetStream to null, and then wait for a
NetStream.Record.Stop event, but I never get it. Should I wait for a
NetStream.Buffer.Empty event instead? Or is there a better way to
record higher quality video?

I know this can't be that complicated.

[red5]Java heap space, out of memory

by Yann JAMAR-2 :: Rate this Message:

| View Threaded | Show Only this Message

Hi all ,
I have got this error i don't understand the meaning of this , the server
has crashed and every stream has been stopped.
How can i avoid this type of crash ?
Best regards.
Yann.


[ERROR] [NioProcessor-2]
org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Last header null not
new, headerSize: 2, channelId 33
[WARN] [NioProcessor-2] org.red5.server.net.rtmp.codec.RTMPProtocolDecoder -
Unknown object type: 0
[ERROR] [NioProcessor-2]
org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Last header null not
new, headerSize: 1, channelId 32
[ERROR] [NioProcessor-2]
org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Last header null not
new, headerSize: 3, channelId 37
[WARN] [NioProcessor-2] org.red5.server.net.rtmp.codec.RTMPProtocolDecoder -
Unknown object type: 0
[WARN] [NioProcessor-2]
org.apache.mina.core.filterchain.DefaultIoFilterChain - Unexpected exception
from exceptionCaught handler.
java.lang.OutOfMemoryError: Java heap space
[WARN] [NioProcessor-2]
org.apache.mina.core.filterchain.DefaultIoFilterChain - Unexpected exception
from exceptionCaught handler.
java.lang.OutOfMemoryError: GC overhead limit exceeded
[WARN] [NioProcessor-2]
org.apache.mina.core.filterchain.DefaultIoFilterChain - Unexpected exception
from exceptionCaught handler.
java.lang.OutOfMemoryError: Java heap space
[WARN] [NioProcessor-2]
org.apache.mina.core.filterchain.DefaultIoFilterChain - Unexpected exception
from exceptionCaught handler.
java.lang.OutOfMemoryError: Java heap space
[ERROR] [NioProcessor-2]
org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Last header null not
new, headerSize: 3, channelId 63
[WARN] [NioProcessor-2] org.red5.server.net.rtmp.codec.RTMPProtocolDecoder -
Unknown object type: 0
[WARN] [NioProcessor-2] org.red5.server.net.rtmp.codec.RTMPProtocolDecoder -
Unknown object type: 0
[WARN] [NioProcessor-2] org.red5.server.net.rtmp.codec.RTMPProtocolDecoder -
Unknown object type: 0
[WARN] [NioProcessor-2] org.red5.server.net.rtmp.codec.RTMPProtocolDecoder -
Unknown object type: 0
[ERROR] [NioProcessor-2]
org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Last header null not
new, headerSize: 1, channelId 47
[WARN] [NioProcessor-2]
org.apache.mina.core.filterchain.DefaultIoFilterChain - Unexpected exception
from exceptionCaught handler.
java.lang.OutOfMemoryError: Java heap space




Re: [red5]Java heap space, out of memory

by Walter Tak :: Rate this Message:

| View Threaded | Show Only this Message

Increase the amount of memory for the JVM in the startup file of Red5.

E.g. (old post) http://forums.whirlpool.net.au/forum-replies-archive.cfm/1237793.html
or http://javahowto.blogspot.com/2006/06/fix-javac-java-lang-outofmemoryerror.html

W.


On Wed, Jun 16, 2010 at 15:40, Yann JAMAR <yann.jamar@...> wrote:
Hi all ,
I have got this error i don't understand the meaning of this , the server has crashed and every stream has been stopped.
How can i avoid this type of crash ?
Best regards.
Yann.


[ERROR] [NioProcessor-2] org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Last header null not new, headerSize: 2, channelId 33
[WARN] [NioProcessor-2] org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Unknown object type: 0
[ERROR] [NioProcessor-2] org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Last header null not new, headerSize: 1, channelId 32
[ERROR] [NioProcessor-2] org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Last header null not new, headerSize: 3, channelId 37
[WARN] [NioProcessor-2] org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Unknown object type: 0
[WARN] [NioProcessor-2] org.apache.mina.core.filterchain.DefaultIoFilterChain - Unexpected exception from exceptionCaught handler.
java.lang.OutOfMemoryError: Java heap space
[WARN] [NioProcessor-2] org.apache.mina.core.filterchain.DefaultIoFilterChain - Unexpected exception from exceptionCaught handler.
java.lang.OutOfMemoryError: GC overhead limit exceeded
[WARN] [NioProcessor-2] org.apache.mina.core.filterchain.DefaultIoFilterChain - Unexpected exception from exceptionCaught handler.
java.lang.OutOfMemoryError: Java heap space
[WARN] [NioProcessor-2] org.apache.mina.core.filterchain.DefaultIoFilterChain - Unexpected exception from exceptionCaught handler.
java.lang.OutOfMemoryError: Java heap space
[ERROR] [NioProcessor-2] org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Last header null not new, headerSize: 3, channelId 63
[WARN] [NioProcessor-2] org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Unknown object type: 0
[WARN] [NioProcessor-2] org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Unknown object type: 0
[WARN] [NioProcessor-2] org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Unknown object type: 0
[WARN] [NioProcessor-2] org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Unknown object type: 0
[ERROR] [NioProcessor-2] org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Last header null not new, headerSize: 1, channelId 47
[WARN] [NioProcessor-2] org.apache.mina.core.filterchain.DefaultIoFilterChain - Unexpected exception from exceptionCaught handler.
java.lang.OutOfMemoryError: Java heap space




Re: [red5]Java heap space, out of memory

by Gergely Zayzon :: Rate this Message:

| View Threaded | Show Only this Message

It won't help, it's caused by a nasty memory leak, which is triggered
after a certain type of decompression error. Me (and probably some more
people on this list) circumvented the problem by changing the following
in org.red5.server.net.rtmp.codec.RTMPProtocolDecoder:

// Change this (around line 440):
        if (headerSize != HEADER_NEW && lastHeader == null) {
                log.error("Last header null not new, headerSize: {}, channelId {}",
headerSize, channelId);
                lastHeader = new Header();
                lastHeader.setChannelId(channelId);
                lastHeader.setTimerRelative(headerSize != HEADER_NEW);
        }
// Into this:
        if (headerSize != HEADER_NEW && lastHeader == null) {
                log.error("Last header null not new, headerSize: {}, channelId {}",
headerSize, channelId);
                return null;
        }

This change will trigger an error status (which will disconnect the
"offending" flash player) instead of bringing the whole server to its knees.


Regards,
Gergely Zayzon

On 2010.06.17. 19:18, Walter Tak wrote:

> Increase the amount of memory for the JVM in the startup file of Red5.
>
> E.g. (old post)
> http://forums.whirlpool.net.au/forum-replies-archive.cfm/1237793.html
> or
> http://javahowto.blogspot.com/2006/06/fix-javac-java-lang-outofmemoryerror.html
>
> W.
>
>
> On Wed, Jun 16, 2010 at 15:40, Yann JAMAR <yann.jamar@...
> <mailto:yann.jamar@...>> wrote:
>
>     Hi all ,
>     I have got this error i don't understand the meaning of this , the
>     server has crashed and every stream has been stopped.
>     How can i avoid this type of crash ?
>     Best regards.
>     Yann.
>
>
>     [ERROR] [NioProcessor-2]
>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Last header
>     null not new, headerSize: 2, channelId 33
>     [WARN] [NioProcessor-2]
>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Unknown object
>     type: 0
>     [ERROR] [NioProcessor-2]
>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Last header
>     null not new, headerSize: 1, channelId 32
>     [ERROR] [NioProcessor-2]
>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Last header
>     null not new, headerSize: 3, channelId 37
>     [WARN] [NioProcessor-2]
>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Unknown object
>     type: 0
>     [WARN] [NioProcessor-2]
>     org.apache.mina.core.filterchain.DefaultIoFilterChain - Unexpected
>     exception from exceptionCaught handler.
>     java.lang.OutOfMemoryError: Java heap space
>     [WARN] [NioProcessor-2]
>     org.apache.mina.core.filterchain.DefaultIoFilterChain - Unexpected
>     exception from exceptionCaught handler.
>     java.lang.OutOfMemoryError: GC overhead limit exceeded
>     [WARN] [NioProcessor-2]
>     org.apache.mina.core.filterchain.DefaultIoFilterChain - Unexpected
>     exception from exceptionCaught handler.
>     java.lang.OutOfMemoryError: Java heap space
>     [WARN] [NioProcessor-2]
>     org.apache.mina.core.filterchain.DefaultIoFilterChain - Unexpected
>     exception from exceptionCaught handler.
>     java.lang.OutOfMemoryError: Java heap space
>     [ERROR] [NioProcessor-2]
>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Last header
>     null not new, headerSize: 3, channelId 63
>     [WARN] [NioProcessor-2]
>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Unknown object
>     type: 0
>     [WARN] [NioProcessor-2]
>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Unknown object
>     type: 0
>     [WARN] [NioProcessor-2]
>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Unknown object
>     type: 0
>     [WARN] [NioProcessor-2]
>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Unknown object
>     type: 0
>     [ERROR] [NioProcessor-2]
>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Last header
>     null not new, headerSize: 1, channelId 47
>     [WARN] [NioProcessor-2]
>     org.apache.mina.core.filterchain.DefaultIoFilterChain - Unexpected
>     exception from exceptionCaught handler.
>     java.lang.OutOfMemoryError: Java heap space
>
>
>

Re: [red5]Java heap space, out of memory

by Yann JAMAR-2 :: Rate this Message:

| View Threaded | Show Only this Message

thank you i will try this and see the results.

----- Original Message -----
From: "Gergely Zayzon" <gergoe@...>
To: <red5interest@...>
Sent: Thursday, June 17, 2010 11:29 PM
Subject: Re: [Red5] [red5]Java heap space, out of memory


> It won't help, it's caused by a nasty memory leak, which is triggered
> after a certain type of decompression error. Me (and probably some more
> people on this list) circumvented the problem by changing the following in
> org.red5.server.net.rtmp.codec.RTMPProtocolDecoder:
>
> // Change this (around line 440):
> if (headerSize != HEADER_NEW && lastHeader == null) {
> log.error("Last header null not new, headerSize: {}, channelId {}",
> headerSize, channelId);
> lastHeader = new Header();
> lastHeader.setChannelId(channelId);
> lastHeader.setTimerRelative(headerSize != HEADER_NEW);
> }
> // Into this:
> if (headerSize != HEADER_NEW && lastHeader == null) {
> log.error("Last header null not new, headerSize: {}, channelId {}",
> headerSize, channelId);
> return null;
> }
>
> This change will trigger an error status (which will disconnect the
> "offending" flash player) instead of bringing the whole server to its
> knees.
>
>
> Regards,
> Gergely Zayzon
>
> On 2010.06.17. 19:18, Walter Tak wrote:
>> Increase the amount of memory for the JVM in the startup file of Red5.
>>
>> E.g. (old post)
>> http://forums.whirlpool.net.au/forum-replies-archive.cfm/1237793.html
>> or
>> http://javahowto.blogspot.com/2006/06/fix-javac-java-lang-outofmemoryerror.html
>>
>> W.
>>
>>
>> On Wed, Jun 16, 2010 at 15:40, Yann JAMAR <yann.jamar@...
>> <mailto:yann.jamar@...>> wrote:
>>
>>     Hi all ,
>>     I have got this error i don't understand the meaning of this , the
>>     server has crashed and every stream has been stopped.
>>     How can i avoid this type of crash ?
>>     Best regards.
>>     Yann.
>>
>>
>>     [ERROR] [NioProcessor-2]
>>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Last header
>>     null not new, headerSize: 2, channelId 33
>>     [WARN] [NioProcessor-2]
>>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Unknown object
>>     type: 0
>>     [ERROR] [NioProcessor-2]
>>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Last header
>>     null not new, headerSize: 1, channelId 32
>>     [ERROR] [NioProcessor-2]
>>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Last header
>>     null not new, headerSize: 3, channelId 37
>>     [WARN] [NioProcessor-2]
>>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Unknown object
>>     type: 0
>>     [WARN] [NioProcessor-2]
>>     org.apache.mina.core.filterchain.DefaultIoFilterChain - Unexpected
>>     exception from exceptionCaught handler.
>>     java.lang.OutOfMemoryError: Java heap space
>>     [WARN] [NioProcessor-2]
>>     org.apache.mina.core.filterchain.DefaultIoFilterChain - Unexpected
>>     exception from exceptionCaught handler.
>>     java.lang.OutOfMemoryError: GC overhead limit exceeded
>>     [WARN] [NioProcessor-2]
>>     org.apache.mina.core.filterchain.DefaultIoFilterChain - Unexpected
>>     exception from exceptionCaught handler.
>>     java.lang.OutOfMemoryError: Java heap space
>>     [WARN] [NioProcessor-2]
>>     org.apache.mina.core.filterchain.DefaultIoFilterChain - Unexpected
>>     exception from exceptionCaught handler.
>>     java.lang.OutOfMemoryError: Java heap space
>>     [ERROR] [NioProcessor-2]
>>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Last header
>>     null not new, headerSize: 3, channelId 63
>>     [WARN] [NioProcessor-2]
>>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Unknown object
>>     type: 0
>>     [WARN] [NioProcessor-2]
>>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Unknown object
>>     type: 0
>>     [WARN] [NioProcessor-2]
>>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Unknown object
>>     type: 0
>>     [WARN] [NioProcessor-2]
>>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Unknown object
>>     type: 0
>>     [ERROR] [NioProcessor-2]
>>     org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Last header
>>     null not new, headerSize: 1, channelId 47
>>     [WARN] [NioProcessor-2]
>>     org.apache.mina.core.filterchain.DefaultIoFilterChain - Unexpected
>>     exception from exceptionCaught handler.
>>     java.lang.OutOfMemoryError: Java heap space
>>
>>
>>




Re: Recording high quality video using a local buffer?

by Charles Palen :: Rate this Message:

| View Threaded | Show Only this Message

Grant,

I don't think there is a event associated with this.  I have had to
use a timer to determine with the Netstream's bufferlength reaches
zero.  That's when you want to finally close your Netstream.  I
haven't every been able to increase or control the speed at which the
buffer empties to the server though; even when doing the entire
implementation on localhost.

On Jun 16, 9:24 am, Grant <grant1...@...> wrote:

> Currently I have video recording working, but since I need higher
> quality video I was trying to keep a buffer on the client side and
> then wait for the buffer to upload after the recording stops. The
> problem is I don't know what net status event to wait for to know when
> the buffer has finished uploading.
>
> Right now when a person clicks the stop recording button I set the
> camera and audio on the NetStream to null, and then wait for a
> NetStream.Record.Stop event, but I never get it. Should I wait for a
> NetStream.Buffer.Empty event instead? Or is there a better way to
> record higher quality video?
>
> I know this can't be that complicated.