Wejn s.r.o.

Solving complicated IT problems is our hobby.

SMIL Playback Not Working in Wowza Media Server 3.5.2

Last night I’ve found strange issue (a bug) when working on a custom StreamNameAlias module.

Wowza 3.X will not properly handle SMIL requests over HLS in some circumstances.

Namely, when you have sample.smil file referencing mp4:sample video file and make the following request:

http://wowza.local:1935/vod/_definst_/smil:sample/playlist.m3u8

the playback won’t start (iOS player hangs on circle of death).

Funny thing is that following request:

http://wowza.local:1935/vod/_definst_/smil:sample.smil/playlist.m3u8

(notice the superfluous .smil extension) will be handled just fine.

So will be the “unqualified” request:

http://wowza.local:1935/vod/_definst_/sample.smil/playlist.m3u8

I’ve tested all this on clean installations of 3.1.0, 3.5.0 and 3.5.2.

I’ve already created ticket for this issue but so far I haven’t been able to clearly explain the issue and/or agree with Wowza support representative about the best plan of action to fix this.

In any case – I’m writing this post hoping it might save someone an hour or two of quality time with debug printouts. Because when I first stepped on this issue I re-checked the entirety of the IMediaStreamNameAliasProvider2 implementation I was working on before I even dared to think Wowza might be at fault.

If you want to test this issue yourself, make a clean installation of Wowza Media Server and install vod application (from examples). Then create content/sample.smil with contents:

1
2
3
4
5
6
7
8
9
10
<smil>
<head></head>
<body>
<switch>
  <video src="mp4:sample" system-bitrate="500000"
      system-screen-size="240x424" width="424" height="240">
</video>
</switch>
</body>
</smil>

Then create test page with contents:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<html>
<head>
<title>Wowza 3.X SMIL issue test page</title>
</head>
<body>
<h1>Wowza 3.X SMIL issue test page</h1>
<h2>smil:sample</h2>
<video controls>
<source src="http://wowza.local:1935/vod/smil:sample/playlist.m3u8" />
</video>

<h2>smil:sample.smil</h2>
<video controls>
<source
  src="http://wowza.local:1935/vod/smil:sample.smil/playlist.m3u8" />
</video>

<h2>sample.smil</h2>
<video controls>
<source src="http://wowza.local:1935/vod/sample.smil/playlist.m3u8" />
</video>
</body>
</html>

(replace wowza.local with hostname of your Wowza instance)

View it on your favorite HLS-playback-capable device and watch in horror how the first embedded video doesn’t work.

Update: The problem definitely goes away when you avoid using mp4:sample filenaming in your smil and use mp4:sample.mp4 instead. Still a bug, though.

Update 2013-03-15: After digging deeper I found out the problem significantly narrowed.