1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 from flumotion.component import feedcomponent
20
21 __version__ = "$Rev$"
22
23
24
25
26
27 -class Rtsp(feedcomponent.ParseLaunchComponent):
28
30 width = properties.get('width', 0)
31 height = properties.get('height', 0)
32 location = properties.get('location')
33 framerate = properties.get('framerate', (25, 2))
34 has_audio = properties.get('has-audio', True)
35 if width > 0 and height > 0:
36 scaling_template = (" videoscale method=1 ! "
37 "video/x-raw-yuv,width=%d,height=%d !" % (width, height))
38 else:
39 scaling_template = ""
40 if has_audio:
41 audio_template = "d. ! queue ! audioconvert ! audio/x-raw-int"
42 else:
43 audio_template = "fakesrc silent=true ! audio/x-raw-int"
44 return ("rtspsrc name=src location=%s ! decodebin name=d ! queue "
45 " ! %s ffmpegcolorspace ! video/x-raw-yuv "
46 " ! videorate ! video/x-raw-yuv,framerate=%d/%d ! "
47 " @feeder:video@ %s ! @feeder:audio@"
48 % (location, scaling_template, framerate[0],
49 framerate[1], audio_template))
50