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