slavavdovichenko / MediaLibDemos

98 stars 25 forks source link

Changing Video Bitrate Crashes Library #8

Open imclean opened 11 years ago

imclean commented 11 years ago

Changing the video bitrate after the initialisation of the upstream crashes the app because the codec seems to have been deallocated.

dkondrat commented 11 years ago

I have experienced exactly the same problem.

slavavdovichenko commented 11 years ago

Hi, I've fixed this bug - you can pull the fixed libs

imclean commented 11 years ago

Pulled and tested, not fixed, still crashes. just put this after the upstream is created: [upstream setVideoBitrate:32000];

slavavdovichenko commented 11 years ago

I can not reproduce this crash ((

I've added [upstream setVideoBitrate:32000]; just after upstream instance creation, and in camerasToggle: method - all works! Can you describe you crash scenario in detail?

And bit rate = 32000 is wrong value - the default value for RESOLUTION_LOW is 272000

imclean commented 11 years ago

OK, here is the crash:

All I have is this: upstream = [[BroadcastStreamClient alloc] initWithClient:socket resolution:RESOLUTION_LOW]; [upstream setVideoBitrate:272000];

Crashes on [BroadcastStreamClient sendVideoFrame:]

2013-08-15 16:28:30.690 RTMPStreamComeback[8843:907] audio codec context: bit_rate = 128000, sample_rate = 16000, channels = 1, sample_fmt = 3, frame_bits = 0 2013-08-15 16:28:32.954 RTMPStreamComeback[8843:4003] $$$$$$ stateChangedEvent: sender = BroadcastStreamClient, 1 = RTMP.Client.isConnected 2013-08-15 16:28:33.459 RTMPStreamComeback[8843:4003] $$$$$$ stateChangedEvent: sender = BroadcastStreamClient, 2 = RTMP.Client.Stream.isCreated 2013-08-15 16:28:34.652 RTMPStreamComeback[8843:1103] *\ -[VideoCodec frameRGBImage:size:width:height:timestamp:]: message sent to deallocated instance 0x2105b780

Does this mean we cant go any lower than 272000 ? which seems a bit high for mobile live streaming.

imclean commented 11 years ago

Hi,

Can you please let me know if you are going to use my test server for testing on, thanks.

Iain

slavavdovichenko commented 11 years ago

Hi,

You can update & test again

Slava

On Mon, Aug 26, 2013 at 2:49 PM, imclean notifications@github.com wrote:

Hi,

Can you please let me know if you are going to use my test server for testing on, thanks.

Iain

— Reply to this email directly or view it on GitHubhttps://github.com/slavavdovichenko/MediaLibDemos/issues/8#issuecomment-23257480 .

imclean commented 10 years ago

Still Crashes

ankushdhawan commented 10 years ago

When i set RESOLUTION_MEDIUM it going crash after 4 to 5 second and it gives memory warning.