This message was deleted.
# helpdesk
s
This message was deleted.
✅ 1
d
Yeah it should be possible to. Which AR/filters library are you working with?
c
Any sample app or methods to integrate deepar filters in android client app.
hi, @eager-raincoat-52616, any suggestions or sample project for this?
e
@cold-camera-7729 you can pass in a
VideoProcessor
object into
LocalParticipant.createVideoTrack()
I’ll write up a quick example
c
that will really help alot
Just curious will it be able to add a static image to local video track as well(for purpose of watermark) with this VideoProcessor ?
e
You can do whatever you want with the video frames you receive
can’t really help you with the specifics of filters or adding images
c
thats completely ok, i will try with specifics, but couldn't find any sample code of using VideoProcessor
so any guidance or general/pseudo code will be helpful
e
Copy code
class ExampleVideoProcessor : VideoProcessor {
    private var sink: VideoSink? = null
    override fun onCapturerStarted(success: Boolean) {
    }

    override fun onCapturerStopped() {
    }

    override fun onFrameCaptured(frame: VideoFrame) {
        val processedFrame = process(frame)
        sink?.onFrame(processedFrame)
        // Make sure to release when you're done with frame.
        processedFrame.release()
    }

    private fun process(frame: VideoFrame): VideoFrame {
        val buffer = frame.buffer.toI420() ?: return frame

        // Modify video buffer as needed...

        return VideoFrame(buffer, frame.rotation, frame.timestampNs)

    }

    override fun setSink(sink: VideoSink?) {
        this.sink = sink
    }

}

fun publishProcessedVideo() {
  val videoTrack = localParticipant.createVideoTrack(
      videoProcessor = ExampleVideoProcessor(),
  )
  videoTrack.startCapture()
  localParticipant.publishVideoTrack(
      track = videoTrack,
  )
}
c
sure,thanks alot,will look into that.
b
@eager-raincoat-52616 this is very cool, I'm trying to port the gist to dart but running into obstacles. For example, in
publishProcessedVideo()
the
LocalParticipant
class (from LiveKit dart SDK) doesn't have a
createVideoTrack()
function. Any thoughts on how to proceed?