How to send video file from one peer to other and play this video file on both user's screen in loop

36 views
Skip to first unread message

Muhammad Zaid Ali

unread,
Oct 4, 2021, 6:50:18 AMOct 4
to discuss-webrtc
Hi, I want to send a video file from one peer to other as a form of Video Track and play on other user's screen in android. Is there any kind of code you can provide me.

I have done simple video communication between two peers but I want to send a local video file from device storage using webrtc media stream.

Alexander Abagian

unread,
Oct 4, 2021, 10:46:42 AMOct 4
to discuss-webrtc
For Windows, you could use a virtual web camera, like AlterCam or Magic Camera. They both let you play a video file in a loop.

Muhammad Zaid Ali

unread,
Oct 4, 2021, 2:21:48 PMOct 4
to discuss-webrtc
I don't wanna use the webcam, to record the video. I just want to send the mp4 file from one peer and play it on the other peer as it was playing the webcam video live.

Eric Davies

unread,
Oct 4, 2021, 2:45:19 PMOct 4
to discuss-webrtc
Use datachannels to send the file contents and then play.
If you google for "datachannel  file transfer", you should find a few examples. 

Muhammad Zaid Ali

unread,
Oct 4, 2021, 4:02:35 PMOct 4
to discuss-webrtc
Well. We can send it via a data channel but I don't wanna use a data channel, I want to use the Video Channel as I am using it for live video calling. Is that be possible to set the Video file as a Video source then send this track?

Philipp Hancke

unread,
Oct 4, 2021, 4:05:02 PMOct 4
to discuss...@googlegroups.com
captureStream

Eric Davies

unread,
Oct 4, 2021, 4:45:23 PMOct 4
to discuss...@googlegroups.com
Oh, then you want a custom video capture that reads from a file instead of a camera.
take a look at https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/sdk/android/api/org/webrtc/FileVideoCapturer.java

--

---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/D3gM8b6tNMA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/8e45e5fe-f211-4699-809b-c46c8c4b8800n%40googlegroups.com.


--
Eric Davies

Muhammad Zaid Ali

unread,
Oct 5, 2021, 2:06:36 AMOct 5
to discuss-webrtc
That's right, I want a custom video capture. I will give it a try 
Reply all
Reply to author
Forward
0 new messages