addPixelBufferSource streaming distorted image. [RESOLVED]
I noticed you added a new addPixelBufferSource method to add a UIImage on top of the video stream. But the image is all distorted once is live.
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
_session = [[VCSimpleSession alloc] initWithVideoSize:CGSizeMake(1280, 720) frameRate:30 bitrate:1000000 useInterfaceOrientation:NO];
[_session addPixelBufferSource:[UIImage imageNamed:@"flagpoll.png"] withRect:CGRectMake(100, 100, 486, 518)];
[self.previewView addSubview:_session.previewView];
_session.previewView.frame = self.previewView.bounds;
_session.delegate = self;
}
Apparently my image didn't had standard dimensions so I used a 512x512 image and it worked. Maybe only multiples of 2 ? I don't know.
It should work with oddly-sized images...could be a bug in the code converting the UIImage to a CVPixelBufferRef - maybe strides aren't being taken into account or something
did you ever find out the exact reason?
I can't find a pattern here... 512x512 works, 400x242 works, 526x526 doesn't, 600x600 doesn't. I can't find a pattern here...
@omarojo @jgh- I'm running into same problem as you are and only 512x512 works. is it possible to make it work for smaller image? I've created an issue if you have any suggestions:
https://github.com/jgh-/VideoCore/issues/300
seeing this same distortion, and it's over 1yr later -- please get someone on this issue
Just use regular dimensions. Dont use weird dimensions like 526x431 or such. Im doing 720p and works fine. Also square works
On Jun 21, 2017, 3:58 PM -0700, Van Carney [email protected], wrote:
seeing this same distortion, and it's over 1yr later -- please get someone on this issue — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.