Skip to content

VideoTrack is not getting invoked on windows #145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
SFX123456 opened this issue Jun 5, 2024 · 2 comments
Open

VideoTrack is not getting invoked on windows #145

SFX123456 opened this issue Jun 5, 2024 · 2 comments
Assignees

Comments

@SFX123456
Copy link

Hello
Underneath is the code that should work in my opinion. It works with audio and datachannels, but video is not working.
I have 1 camera and the camera gets registered fine and also the track.
List captureDevices = MediaDevices.getVideoCaptureDevices();
System.out.println("amojuntof capture devices " + captureDevices.size());
VideoDeviceSource videoDeviceSource = new VideoDeviceSource();
videoDeviceSource.setVideoCaptureDevice(captureDevices.get(0));
System.out.println("created video device source ");
VideoTrack videoTrack = peerConnectionFactory.createVideoTrack("video",(VideoTrackSource) videoDeviceSource);
ArrayList g = new ArrayList<>();
g.add("video");
System.out.println("video set up 1");
videoTrack.addSink(new VideoTrackSink() {
@OverRide
public void onVideoFrame(VideoFrame videoFrame) {
System.out.println("video frame ");
}
});
videoTrack.setEnabled(true);
System.out.println("is enabled video" + videoTrack.isEnabled());

@acherner
Copy link

acherner commented Jan 21, 2025

similar problem here, host machine is AVD Windows 11, have following lines that not getting invoked:
VideoDeviceSource videoSource = new VideoDeviceSource();
VideoTrack videoTrack = factory.createVideoTrack("videoTrack", videoSource);
videoTrack.addSink(new VideoTrackSink() {
@Override
public void onVideoFrame(VideoFrame frame) {
log.info("Video got!");
log.info(frame.timestampNs);
}
});
log.info("Video track id:"+videoTrack.getId()+" is enabled:"+videoTrack.isEnabled());
to overcome the problem I've built docker with this code, built with .so for linux, docker failed to launch because of Audio device initialization, so I solved it by installing Pulse Audio server on host to emulate linux audio, docker started, connected to video stream but "Video got!" still not invoked, any advice? should I try the same flow on Mac?

@liusuyi2021
Copy link

liusuyi2021 commented May 9, 2025

I also have a similar problem, unable to obtain video frames, but audio can be obtained

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants