Wowza Community

Few questions regarding VOD HLS Streaming

Hi,

I have a few questions about HLS VOD streaming.

  • Regarding target duration:

  • This is the .smil file:

    <smil>
    	<head>
    	</head>
    	<body>
    		<switch>
    			<video src="mp4:00800_1000.mp4" system-bitrate="980992"/>
    			<video src="mp4:00800_1400.mp4" system-bitrate="1413120"/>
    		</switch>
    	</body>
    </smil>
    
    

    And this is my URI: http://lab001.dyndns.org:1935/vod/smil:00800.smil/playlist.m3u8

  • This is the main playlist:

    #EXTM3U
    #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=980992
    http://lab001.dyndns.org:1935/vod/_definst_/mp4:00800_1000.mp4/playlist.m3u8?wowzasessionid=750677490
    #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1413120
    http://lab001.dyndns.org:1935/vod/_definst_/mp4:00800_1400.mp4/playlist.m3u8?wowzasessionid=750677490
    
    

    Opening one of the links would give me something like this:

    #EXTM3U
    #EXT-X-TARGETDURATION:12
    #EXT-X-MEDIA-SEQUENCE:1
    #EXTINF:12,
    media_1.ts?wowzasessionid=2146856501
    #EXTINF:11,
    media_2.ts?wowzasessionid=2146856501
    #EXTINF:11,
    media_3.ts?wowzasessionid=2146856501
    #EXTINF:11,
    media_4.ts?wowzasessionid=2146856501
    #EXTINF:10,
    media_5.ts?wowzasessionid=2146856501
    

    My first questions is: Why is the duration of each chunk different? Shouldn’t all of them be equal to 12 in this example?

  • Regarding streaming behavior:

  • I wanted to see the streaming behavior using WireShark, and this is what I got when the streaming started:

  • What I expected to see, is something like this:

    My second question is: Since I’m using HLS, why am I seeing “macromedia-fcs” instead of HTTP GET commads of the .ts files?

  • Regarding KeyFrame Interval settings:

    My final question is: What’s the recommended value when encoding at multiple bitrates? And how’s it related to the value of #EXT-X-TARGETDURATION?

    I’d really appreciate any explanation to the above.

    Thanks in advance,

    Wiaam.

Hi

The duration of each chunk is different because the encoding is not always a fixed size for each one, as long as the chunk value is close the the Max chunk value but not over it you should be fine.

macromedia-fcs is the port number that is 1935 in this instance.

WireShark just transforms the port number to a name.

Each port has a normal use name and 1935 is macromedia-fcs

in the same way that port 80 is HTTP.

Your last question is answered here,

https://www.wowza.com/docs/how-to-configure-apple-hls-packetization-cupertinostreaming

Jason

Chunks are broken on key frames. So depending on the key frame interval and target duration the chunk sizes can differ. The target duration in the playlist is always the size of the largest chunk.

Charlie

If you use the multi-bitrate encoding in the MS Expression Encoder and encode the files in the same session from the same source then yes they should be chunked the same. If the files are from different sessions or use a different source then Expression encoder might be using screen frame detection to insert key frames at scene changes and this might cause a variation between files.

Charlie

I am not sure what you think is wrong. If I open all four renditions they are chunked exactly the same. All four renditions are broken up into chunks exactly the same way. If you are expecting each rendition’s chunk size to be exactly 10 seconds this is not going to happen unless the key frame interval is perfectly broken on values that match the chunk duration. If you make the key frame interval a factor of the chunk size such as 2, 5 or 10 then this might work. Then again it might not lead to prefect chunk sizes because the encoder might inject key frames off the key frame interval due to scene change detection or the key frame interval might be off by one frame due to how it interprets the interval. Either way it doesn’t matter. What is important is that the four files are broken up the same way.

Charlie

Hi,

Thanks a lot.

Everything’s clear now except one thing:

The #EXT-X-TARGETDURATION: value varies from source media file to another - Why’s that, and is that normal?

For example:

  • If I open the link:

    http://lab001.dyndns.org/vod/definst/mp4:00800_1000.mp4/playlist.m3u8?wowzasessionid=750677490

    I would get something like that:

    #EXTM3U
    #EXT-X-TARGETDURATION:12
    #EXT-X-MEDIA-SEQUENCE:1
    #EXTINF:12,
    media_1.ts?wowzasessionid=2146856501
    #EXTINF:11,
    media_2.ts?wowzasessionid=2146856501
    #EXTINF:11,
    media_3.ts?wowzasessionid=2146856501
    #EXTINF:11,
    media_4.ts?wowzasessionid=2146856501
    #EXTINF:10,
    media_5.ts?wowzasessionid=2146856501
    
  • On the other hand, if I open other link for other media, like this:

    http://lab001.dyndns.org/vod/definst/mp4:CA_1.2Mbps.mp4/playlist.m3u8?wowzasessionid=1389479844

    I would get something like this:

    #EXTM3U
    #EXT-X-TARGETDURATION:20
    #EXT-X-MEDIA-SEQUENCE:1
    #EXTINF:15,
    media_1.ts?wowzasessionid=1389479844
    #EXTINF:10,
    media_2.ts?wowzasessionid=1389479844
    #EXTINF:12,
    media_3.ts?wowzasessionid=1389479844
    #EXTINF:11,
    media_4.ts?wowzasessionid=1389479844
    #EXTINF:12,
    media_5.ts?wowzasessionid=1389479844
    

    That is when I use HLS VOD streaming at all times.

    I checked the link you posted, and although it’s relevant to Live Streaming, there’s a note about VOD.

    I tried to apply it by adding the following property to HTTPStreamer/Properties in [install-dir]/conf/vod/Application.xml file, but the behaviour didn’t change.

    <Property>
    	<Name>cupertinoChunkDurationTarget</Name>
    	<Value>10000</Value>
    	<Type>Integer</Type>
    </Property>
    

    What am I missing?

    Wiaam.

Ideas? :slight_smile:

Hi,

As I understand, this means it depends entirely on the source and the way it was encoded - Please correct me if I’m wrong.

Therefore, if I encoded my source at multiple bit-rates with the same key frame interval, why would I still get different chunk sizes?

By the way, I’m using MS Expression Encoder 4 Pro.

Thanks a lot.

Wiaam.

That’s the thing… It’s the same session. And nonetheless, I still get different chunk sizes.

  • This is my preset.

  • This is my .smil file.

  • Opening the first link from the .smil file would show me something like this:

    #EXTM3U
    #EXT-X-TARGETDURATION:18
    #EXT-X-MEDIA-SEQUENCE:1
    #EXTINF:11,
    media_1.ts?wowzasessionid=595218866
    #EXTINF:13,
    media_2.ts?wowzasessionid=595218866
    #EXTINF:10,
    media_3.ts?wowzasessionid=595218866
    #EXTINF:14,
    media_4.ts?wowzasessionid=595218866
    

    What do you think?

    Wiaam.

Got it.

Cool… Thanks a lot.