golanggohlsrtmpwebrtcmedia-serverobs-studiortcprtmp-proxyrtmp-serverrtprtsprtsp-proxyrtsp-relayrtsp-serversrtstreamingwebrtc-proxy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
342 B
19 lines
342 B
package test |
|
|
|
import "os" |
|
|
|
// CreateTempFile creates a temporary file with given content. |
|
func CreateTempFile(byts []byte) (string, error) { |
|
tmpf, err := os.CreateTemp(os.TempDir(), "rtsp-") |
|
if err != nil { |
|
return "", err |
|
} |
|
defer tmpf.Close() |
|
|
|
_, err = tmpf.Write(byts) |
|
if err != nil { |
|
return "", err |
|
} |
|
|
|
return tmpf.Name(), nil |
|
}
|
|
|