My favorites | Sign in
Project Home Downloads Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
MPEG-TS Plug-in
By: Paul Gregoire

The segmenter service must be configured in your red5-web.xml where the mpeg-ts streaming will be used.

<bean id="segmenter.service" class="org.red5.service.httpstream.SegmenterService">
<property name="segmentTimeLimit" value="2000" />
<!-- Location where segment files will be written -->
<property name="segmentDirectory" value="webapps/%s/WEB-INF/segments/" />
<!-- Whether or not to enable memory mapped access, segment files will not be created in this mode -->
<property name="memoryMapped" value="true" />
<!-- Time period that the worker sleeps when the queue is empty, in milliseconds -->
<property name="queueSleepTime" value="500" />
<!-- Maximum segments to keep in a segment facade -->
<property name="maxSegmentsPerFacade" value="8" />
</bean>

The segment directory property may be configured with a full path to where your segments will be written if you are using
file-based segments. If the "%s" is present when this is parsed, it will be replaced with your applications directory.

The web.xml for your application must also have the following servlets defined, which will provide the requested playlist and segments.

<servlet>
<description>Serves an HTTP streaming playlist</description>
<display-name>PlayList</display-name>
<servlet-name>PlayList</servlet-name>
<servlet-class>org.red5.stream.http.servlet.PlayList</servlet-class>
<init-param>
<param-name>minimumSegmentCount</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>startStreamOnRequest</param-name>
<param-value>true</param-value>
</init-param>
</servlet>

<servlet>
<description>Serves a segment</description>
<display-name>TransportSegment</display-name>
<servlet-name>TransportSegment</servlet-name>
<servlet-class>org.red5.stream.http.servlet.TransportSegment</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>PlayList</servlet-name>
<url-pattern>*.m3u8</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>TransportSegment</servlet-name>
<url-pattern>*.ts</url-pattern>
</servlet-mapping>

Lastly, if the playlist and segments are not defined in the primary web.xml for the server they will need to be defined in your
application web.xml as follows.

<mime-mapping>
<extension>m3u8</extension>
<mime-type>application/x-mpegURL</mime-type>
</mime-mapping>

<mime-mapping>
<extension>ts</extension>
<mime-type>video/MP2T</mime-type>
</mime-mapping>

Special thanks to Infrared5 Inc. for donating the initial code.

Change log

r4134 by mondain on Aug 25, 2010   Diff
Updated to use latest tip of xuggler
Go to: 
Project members, sign in to write a code review

Older revisions

r4132 by mondain on Aug 25, 2010   Diff
MPEG-TS streaming plugin
All revisions of this file

File info

Size: 2871 bytes, 68 lines
Powered by Google Project Hosting