Skip to content
/ rtsp Public

A Clojure based, asynchronous client and server for the Real Time Streaming Protocol (RTSP) as described by RFC 2326.

Notifications You must be signed in to change notification settings

nogden/rtsp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

rtsp

A Clojure based, asynchronous client and server for the Real Time Streaming Protocol (RTSP) as described by RFC 2326.

Installation

Available on Clojars:

[Clojars Project] (http://clojars.org/multimedia.streaming/rtsp)

Documentation

Full API and implementation documentation is available here.

Usage

(ns example
  (require [multimedia.streaming.rtsp.client :refer :all]))

;; Create an RTSP session
(def peer (session "rtsp://192.168.1.73"))
peer ;=> #Session{:url {:protocol "rtsp",
                        :port 8554,
                        :host "192.168.1.73"},
                  :version "RTSP/1.0"}

;; Issue requests as ring-like request maps
(def response (request! peer {:method "DESCRIBE"
                              :path "media/stream-1"}))

;; Or use the provided convenience functions
(def response (describe! peer "media/stream-1"))

;; All communication is asynchronous and non-blocking.
;; Requests return [manifold](https://github.com/ztellman/manifold) deferreds.
response ;=> #<Deferred@19c15de7: :not-delivered>

@response ;=> {:version "RTSP/1.0",
               :status 200,
               :reason "OK",
               :headers {:c-seq "4",
                         :content-base "rtsp://192.168.1.73:554/media/stream-1/",
                         :content-length "979",
                         :content-type "application/sdp",
                         :date "Fri, Nov 06 2015 16:00:16 GMT"},
               :body "v=0\r\no=- 1446825616551909 1 IN IP4 192.168.1.73\r\n..."}

;; Optional manual closing of connections
(close! peer)

Still to Come

  1. Server functionality
  2. UDP (rtspu) transport support

License

Copyright © 2015 Nick Ogden

Distributed under the Eclipse Public License, the same as Clojure.

About

A Clojure based, asynchronous client and server for the Real Time Streaming Protocol (RTSP) as described by RFC 2326.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published