diff options
author | dakkar <dakkar@thenautilus.net> | 2020-07-25 11:31:23 +0000 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2020-07-25 11:56:19 +0000 |
commit | c6ab41dc8c9816a2a457f61b5d90d2436dfbb471 (patch) | |
tree | c34b53e7d2dd8f151ad2b638b194a816b427c24d /gst | |
parent | maybe new deps? mah (diff) | |
download | rtwatch-c6ab41dc8c9816a2a457f61b5d90d2436dfbb471.tar.gz rtwatch-c6ab41dc8c9816a2a457f61b5d90d2436dfbb471.tar.bz2 rtwatch-c6ab41dc8c9816a2a457f61b5d90d2436dfbb471.zip |
changes from another guy
https://github.com/ahamlinman/rtwatch/commit/eb91a43eeccc5959ea981dbc6eef10978d5179fb
Diffstat (limited to 'gst')
-rw-r--r-- | gst/gst.go | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -31,9 +31,31 @@ type Pipeline struct { var pipeline = &Pipeline{} var pipelinesLock sync.Mutex +var pipelineFmtStr = ` +filesrc location="%s" +! decodebin name=demux + +demux. +! queue +! videoconvert +! videoscale +! video/x-raw,width=800,height=600 +! x264enc bframes=0 speed-preset=veryfast key-int-max=60 +! video/x-h264,stream-format=byte-stream +! appsink name=video + +demux. +! queue +! audioconvert +! audioresample +! audio/x-raw,rate=48000 +! opusenc bitrate=128000 +! appsink name=audio +` + // CreatePipeline creates a GStreamer Pipeline func CreatePipeline(containerPath string, audioTrack, videoTrack *webrtc.Track) *Pipeline { - pipelineStr := fmt.Sprintf("filesrc location=\"%s\" ! decodebin name=demux ! queue ! x264enc bframes=0 speed-preset=veryfast key-int-max=60 ! video/x-h264,stream-format=byte-stream ! appsink name=video demux. ! queue ! audioconvert ! audioresample ! opusenc ! appsink name=audio", containerPath) + pipelineStr := fmt.Sprintf(pipelineFmtStr, containerPath) pipelineStrUnsafe := C.CString(pipelineStr) defer C.free(unsafe.Pointer(pipelineStrUnsafe)) |