Comments (3)
Actually i can't reach it even like that since some of the fields for TrackLocalContext are private and i can't recreate it.
Am i missing something or ForceKeyFrame function cannot be used ?
from mediadevices.
I ran into the same issue initially. It would be nice if ForceKeyFrame
and SetBitRate
were more easily accessible when using the library outside of a WebRTC session or for more manual control generally.
That said, those functions are currently triggered in the library in response to RTCP messages when the track is used in a webrtc session. You can see the code that does that in track.go on line 236 and line 273 < Note these line links are code in my pull request fork but the changes will hopefully get merged soon.
One weird thing is the Pion examples suggest you also need to be reading the RTCP messages in your program to get Pion Mediadevices to handle them correctly (I'm assuming you are streaming with WebRTC in the first place). Many of the Pion examples have this code (in this case the videoTrack
would be a track inside the stream from mediadevices GetUserMedia()):
rtpSender, videoTrackErr := peerConnection.AddTrack(videoTrack)
if videoTrackErr != nil {
panic(videoTrackErr)
}
// Read incoming RTCP packets
// Before these packets are returned they are processed by interceptors. For things
// like NACK this needs to be called.
go func() {
rtcpBuf := make([]byte, 1500)
for {
if _, _, rtcpErr := rtpSender.Read(rtcpBuf); rtcpErr != nil {
return
}
}
}()
from mediadevices.
@Chimerax2 Do you have some context ? ForceKeyFrame
is accessible on a any encoder implementing it. Since all encoders doesn't implement this yet, so you have to do a type conversion like this :
keyFrameController, ok := encodedReader.Controller().(codec.KeyFrameController)
if ok {
keyFrameController.ForceKeyFrame()
}
@KW-M Yes, I don't think the examples have been reworked since PLI handling has been implemented. It is still better to do it, since the rtcp reading loop is started only if the used codec implements the Key Frame controller.
from mediadevices.
Related Issues (20)
- Closing media track causes panic
- Colour difference in generated video stream HOT 1
- How does screen capture work on Windows vs Linux? HOT 2
- Failed to start streaming: invalid argument HOT 5
- go build linux error HOT 3
- Add pion/.goassets
- GCC problem on Windows 10 HOT 1
- Display mouse cursor HOT 1
- Video not showing in video element in latest versions of chrome. HOT 5
- why does opening dev console in http example crash the server?
- rtp example problems
- Distorted audio capture on linux. HOT 5
- failed to find the best driver that fits the constraints to open usb camera HOT 1
- Multiple display for webcam device HOT 2
- use mediadevices.GetUserMedia() failed. err: failed to open device: failed to connect filters HOT 2
- jetson agx xavier ubuntu20.04 fail run HOT 2
- webrtc demo mic Sound tearing sensation
- Error in bridge.cpp when using openh264
- go1.22.2 - example/webrtc Audio works, but video doesnt HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mediadevices.