Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Change Video Size dynamically even after changing Video Configuration #176

Open
sucharuhasija opened this issue Feb 13, 2017 · 3 comments

Comments

@sucharuhasija
Copy link

I am unable to resize the video dynamically while using in the App. I have tried it by changing video configuration file in my view controller file.

I have created a session using

var session: LFLiveSession = LFLiveSession(audioConfiguration: LFLiveAudioConfiguration.defaultConfiguration(for: LFLiveAudioQuality.medium), videoConfiguration: LFLiveVideoConfiguration.defaultConfiguration(for: LFLiveVideoQuality.medium2), captureType: LFLiveCaptureTypeMask.captureDefaultMask)!
method.

In my app i have a option to change the video size, I have tried by changing it by modifying Video Configuration File and also tested via debugging in Library it is uploading the right modified size,
But when i am testing on VLC at receiving end. Video size is not changed.

This particular thing is working when i am trying to change Video Configuration after killing the app as it is creating a new session for the streaming, but while i tried the same option of changing the video resolution during the app. It is not reflecting on server end?

Is there any way to recreate Session of the app?
suggestions please

@neerajkhosla
Copy link

I am getting the same issue, can somebody please provide some solution to it ? Thanks in advance.

@ianholing
Copy link

ianholing commented May 31, 2018

I spent some time doing research on this and I have a solution that actually works:

  1. Add a refreshVideoSource in LFLiveSession.m:
    -(void)refreshVideoSource {
    _videoCaptureSource = nil;
    _audioCaptureSource = nil;
    }
    1.5) Also add headers to LFLiveSession.h:
    -(void) refreshVideoSource;

  2. Change resolution like this:
    [self.session stopLive];
    [self.session setRunning:NO];
    [self.session refreshVideoSource];
    self.session = nil;
    // RECREATE HERE YOUR session OBJECT WITH THE NEW LFLiveVideoConfiguration
    [self.session setRunning:YES];
    [self.session startLive:stream];

That's it. it works!

@zj381652512
Copy link

it's nice! mark it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants