Add H264 send/receive and packetization support

This commit is contained in:
John Bradley
2018-07-05 16:39:38 -05:00
committed by John R. Bradley
parent dfd08a5ac4
commit cfba14cfea
5 changed files with 138 additions and 3 deletions

View File

@@ -32,6 +32,8 @@ func CreatePipeline(codec webrtc.TrackType) *Pipeline {
pipelineStr += ", payload=96, encoding-name=OPUS ! rtpopusdepay ! decodebin ! autoaudiosink"
case webrtc.VP9:
pipelineStr += " ! rtpvp9depay ! decodebin ! autovideosink"
case webrtc.H264:
pipelineStr += " ! rtph264depay ! decodebin ! autovideosink"
default:
panic("Unhandled codec " + codec.String())
}

View File

@@ -38,6 +38,8 @@ func CreatePipeline(codec webrtc.TrackType, in chan<- webrtc.RTCSample) *Pipelin
pipelineStr = "videotestsrc ! vp8enc ! " + pipelineStr
case webrtc.VP9:
pipelineStr = "videotestsrc ! vp9enc ! " + pipelineStr
case webrtc.H264:
pipelineStr = "videotestsrc ! video/x-raw,format=I420 ! x264enc bframes=0 speed-preset=veryfast key-int-max=60 ! video/x-h264,stream-format=byte-stream ! " + pipelineStr
case webrtc.Opus:
pipelineStr = "audiotestsrc ! opusenc ! " + pipelineStr
default: