VideoCore-Inactive icon indicating copy to clipboard operation
VideoCore-Inactive copied to clipboard

Need to On and Off audio while streaming how can we achive that one

Open rayalarajee opened this issue 9 years ago • 6 comments

Need to On and Off audio while streaming how can we achive that one

rayalarajee avatar Jun 05 '16 17:06 rayalarajee

Simply,you can call this function in VCSimpleSession to On and Off audio m_micSource->interruptionBegan(); m_micSource->interruptionEnded();

bellchen avatar Jun 07 '16 04:06 bellchen

You can set micGain to 0.0f to achieve a mute. Unfortunately the initial value for micGain on VCSimpleSession seems to be 0.0f, but it should be 1.0f (probably a bug?). This causes the micGain = 0.0f to be ignored until you change micGain to a value different than 0.0f.

What I did was to implement the didAddCameraSource: delegate method and set the micGain property of that session to 1.0f (to make it "the default"):

- (void)didAddCameraSource:(VCSimpleSession *)session { [session setMicGain:1.0f]; }

After that, you can change the micGain property when streaming to 0.0f (muted) or 1.0f (normal volume).

alejandroivan avatar Oct 25 '16 16:10 alejandroivan

@alejandroivan Hi ! I am using video core (0.3.2). live video stream was buffering very slow (delay timstamp minmum 1 min.) when i was playing live stream. and one more The app is freezing on iphone 6, while click on disconnect during playing video. and it's working on iphone 5 perfectly. can you please tell me.

IOSDeveloperProgrammer avatar Oct 26 '16 05:10 IOSDeveloperProgrammer

@IOSDeveloperProgrammer I didn't code this library, but I think your buffering problem is due to the size of the image you're streaming. For example, 1280x720 is actually a very big image, and if you're using 60fps or so, it will take a lot of time to stream. Did you try something like 854x480 at 30 fps and 500 KB/s upload maximum (500 KB/s * 1024 B/KB * 8 b/B = 4,096,000 b/s -bits per second-)?

VCSimpleSession *session = [[VCSimpleSession alloc] initWithVideoSize:CGSizeMake(854, 480) frameRate:30 bitrate:4096000 useInterfaceOrientation:YES];

Algo using adaptive bitrate should help: session.useAdaptiveBitrate = YES;.

It's actually weird that your app is freezing on an iPhone 6. Mine works fine. I have a "toggle" method that checks for status and plays or stops the stream.

- (IBAction)toggleStartStopStreaming { switch( session.rtmpSessionState ) { case VCSessionStateNone: case VCSEssionStatePreviewStarted: case VCSessionStateEnded: case VCSessionStateError: { [session startRtmpSessionWithURL:<YOUR_URL> andStreamKey:<YOUR_STREAM_KEY>]; break; } default: { [session endRtmpSession]; break; } } }

alejandroivan avatar Oct 26 '16 13:10 alejandroivan

@alejandroivan Thanks for the response, sorry for the late reply. i'll applying your code and let you.

IOSDeveloperProgrammer avatar Oct 28 '16 05:10 IOSDeveloperProgrammer

@alejandroivan FYI , i had tested on 854x480 at 30 fps and 4,096,000 b/s -bits per second. it's did not upload image. even i also add everything what did you said on that. one more thing App was crashing at [EAGLContext setCurrentContext:current]; in VCPreviewView.mm file on Video core. it's crashing after disconnect stream .

IOSDeveloperProgrammer avatar Nov 02 '16 10:11 IOSDeveloperProgrammer