pion / rtwatch

Watch videos with friends using WebRTC, let the server do the pausing and seeking.
https://pion.ly/
304 stars 46 forks source link

how to support uvc? #20

Closed yunfan closed 4 years ago

yunfan commented 4 years ago

i have a usb camera which could be supprted by uvc driver very well and for mplayer i could use mplayer tv:// to got the video streaming

but rtwatch -container-path=tv:// failed

Sean-Der commented 4 years ago

https://github.com/pion/rtwatch/blob/master/gst/gst.go#L36 is the line you need to update.

I think your pipeline will end up looking something like

v4l2src device=/dev/video1 ! decodebin ! queue ! x264enc bframes=0 speed-preset=veryfast key-int-max=60 ! video/x-h264,stream-format=byte-stream ! appsink name=video audiotestsrc ! queue ! audioconvert ! audioresample ! opusenc ! appsink name=audio

You just need to feed two appsinks, one with the name of audio that is getting Opus, and another video that is getting H264.

You could do VP8 instead if you wanted.

yunfan commented 4 years ago

sorry i dont familliar with golang, thought i am learning recently. i thought it was supported , will check it after a new release

close