jgh- / VideoCore-Inactive

*No longer in development* Please see https://github.com/unpause-live/SwiftVideo
MIT License
1.48k stars 540 forks source link

VCSimpleSession: Resolution changes across sessions yield weird zooming behavior #71

Open dhilowitz opened 9 years ago

dhilowitz commented 9 years ago

Steps to reproduce:

  1. Initialize an RTMP session at 1280x720 (or any other resolution) using VCSimpleSession.
  2. Broadcast for a little bit.
  3. End the session with [_session endRtmpSession];
  4. Change the video size to 1920x1080.
  5. Start broadcasting.

Expectation: Since 720p and 1080p have the same aspect ratio, the video should look pretty much the same, except the quality for 1080p should be slightly nicer because there are more pixels.

Observed Behavior: The video size is zoomed in considerably. This is noticeable both in the RTMP video and in the preview. If, on the other hand, I destroy the session completely (_session = nil) and restart it at 1080p, it is not zoomed in.

dhilowitz commented 9 years ago

I can hack a fix for this by calling [self setupGraph]; in the startSession method. Not sure that this is really kosher, though. I'd be willing to bet that all of the objects that get instantiated in setupGraph should be cleaned up gracefully before calling setupGraph a second time.

jgh- commented 9 years ago

Interesting, ok. This could be a similar issue to #62 that you reported. Probably just need to make sure it refreshes the settings when reconnecting.

maxcampolo commented 9 years ago

@dhilowitz I know this is an old issue but were you able to work a fix for this? I am having the same problem - if I switch the resolution, the size of the camera preview changes but the stream still captures what's on the screen. So if I reduce the resolution I end up with black letterboxing all around the video for example and increasing the resolution extends the preview beyond the bounds of the preview view. Thanks.

dhilowitz commented 9 years ago

If memory serves, I just ended up reinitializing the session and restarting the broadcast. :(

On Mon, Jul 20, 2015 at 10:14 AM, Max Campolo notifications@github.com wrote:

@dhilowitz https://github.com/dhilowitz I know this is an old issue but were you able to work a fix for this? I am having the same problem - if I switch the resolution, the size of the camera preview changes but the stream still captures what's on the screen. So if I reduce the resolution I end up with black letterboxing all around the video for example and increasing the resolution extends the preview beyond the bounds of the preview view. Thanks.

— Reply to this email directly or view it on GitHub https://github.com/jgh-/VideoCore/issues/71#issuecomment-122899069.