I'm currently using an app called IP camera that send the live stream through a localhost link if the mobile and pc are connected to the same network. I would like to build a similar application because I want to add some functionalities to that
I recommend to use DroidCam. It is app for Andoid transmitting image to client in PC where the client emulates camera device. Thus in OpenCV you open the camera source just by VideoCap camera(id); Mat frame; camera >> frame; where id is 0,1,2,... if you have no camera on PC it is zero, usually you have one, so id is 1.