How to use custom video?


I’m a bit lost as to how to do custom video. My app uses the full screen to publish video, so I need the right aspect ratio. However, after reading this:,
I’m very confused. How do I use sendFrame() and sendSampleBuffer()?

Hi Vijay,

Have you tried running our examples? Do they work for you without any changes (other than app id and secret key)?


The examples don’t use custom video. I have a working app using VGA resolution, but I want to use custom video so I can use the right aspect ratio.


The support for video custom mode has been added in VideoService classes:

  1. MediaPublishOptions class:

// custom mode options

@property uint fps;

@property uint width;

@property uint height;
-(void)setCustomVideo:(uint)fps width:(uint)width height:(uint)height;

-(void)setAudioAndCustomVideo:(uint)fps width:(uint)width height:(uint)height;

2.MediaPublisher class:

-(BOOL)sendImage:(CGImageRef)image timestamp:(int64_t)timestamp;

You can try PhotoStreamer demo sample from to study these features.