Wowza Community

Why chunk direction are not constant ?

We have created a Live application with following properties :

<LiveStreamPacketizer>
  <!-- Properties defined here will override any properties defined in conf/LiveStreamPacketizers.xml for any LiveStreamPacketizers loaded by this applications -->    

<Properties>

	<Property>
   		<Name>cupertinoChunkDurationTarget</Name>
		<Value>8000</Value>
		<Type>Integer</Type>
	</Property>
	<Property>
		<Name>cupertinoPlaylistChunkCount</Name>
		<Value>10</Value>
		<Type>Integer</Type>
	</Property>
</Properties>

</LiveStreamPacketizer>

Associated transcoder template is:

<?xml version="1.0" encoding="UTF-8"?>
<Root>
<Transcode>
<Description></Description>
<Decode>
<Video>
<Implementation>default</Implementation>
<Deinterlace>false</Deinterlace>
</Video>
</Decode>
<Encodes>
<Encode>
<Name>320x180</Name>
<Enable>true</Enable>
<Description>320x180</Description>
<StreamName>mp4:${SourceStreamName}_320x180</StreamName>
<Video>
<Codec>H.264</Codec>
<Implementation>default</Implementation>
<GPUID>-1</GPUID>
<Profile>baseline</Profile>
<Bitrate>226000</Bitrate>
<KeyFrameInterval>
<FollowSource>false</FollowSource>
<Interval>12</Interval>
</KeyFrameInterval>
<FrameSize>
<FitMode>crop</FitMode>
<Width>320</Width>
<Height>180</Height>
<Crop>0,0,0,0</Crop>
<SourceRectangle></SourceRectangle>
</FrameSize>
</Video>
<Audio>
<Codec>AAC</Codec>
<Bitrate>128000</Bitrate>
</Audio>
</Encode>
<Encode>
<Name>640x360</Name>
<Enable>true</Enable>
<Description>640x360</Description>
<StreamName>mp4:${SourceStreamName}_640x360</StreamName>
<Video>
<Codec>H.264</Codec>
<Implementation>default</Implementation>
<GPUID>-1</GPUID>
<Profile>main</Profile>
<Bitrate>1200000</Bitrate>
<KeyFrameInterval>
<FollowSource>false</FollowSource>
<Interval>24</Interval>
</KeyFrameInterval>
<FrameSize>
<FitMode>crop</FitMode>
<Width>640</Width>
<Height>360</Height>
<Crop>0,0,0,0</Crop>
<SourceRectangle></SourceRectangle>
</FrameSize>
<Parameters>
<Parameter>
<Name>mainconcept.bit_rate_mode</Name>
<Value>0</Value>
<Type>Long</Type>
</Parameter>
<Parameter>
<Name>mainconcept.bit_rate</Name>
<Value>1000000</Value>
<Type>Long</Type>
</Parameter>
<Parameter>
<Name>mainconcept.bit_rate_buffer_size</Name>
<Value>40000</Value>
<Type>Long</Type>
</Parameter>
</Parameters>
</Video>
<Audio>
<Codec>AAC</Codec>
<Bitrate>128000</Bitrate>
</Audio>
</Encode>
<Encode>
<Name>1024x576</Name>
<Enable>true</Enable>
<Description>1024x576</Description>
<StreamName>mp4:${SourceStreamName}_1024x576</StreamName>
<Video>
<Codec>H.264</Codec>
<Implementation>default</Implementation>
<GPUID>-1</GPUID>
<Profile>main</Profile>
<Bitrate>2100000</Bitrate>
<KeyFrameInterval>
<FollowSource>false</FollowSource>
<Interval>32</Interval>
</KeyFrameInterval>
<FrameSize>
<FitMode>crop</FitMode>
<Width>1024</Width>
<Height>576</Height>
<Crop>0,0,0,0</Crop>
<SourceRectangle></SourceRectangle>
</FrameSize>
</Video>
<Audio>
<Codec>AAC</Codec>
<Bitrate>128000</Bitrate>
</Audio>
</Encode>
<Encode>
<Name>416x234</Name>
<Enable>true</Enable>
<Description>416x234</Description>
<StreamName>mp4:${SourceStreamName}_416x234</StreamName>
<Video>
<Codec>H.264</Codec>
<Implementation>default</Implementation>
<GPUID>-1</GPUID>
<Profile>baseline</Profile>
<Bitrate>450000</Bitrate>
<KeyFrameInterval>
<FollowSource>false</FollowSource>
<Interval>12</Interval>
</KeyFrameInterval>
<FrameSize>
<FitMode>crop</FitMode>
<Width>416</Width>
<Height>234</Height>
<Crop>0,0,0,0</Crop>
<SourceRectangle></SourceRectangle>
</FrameSize>
</Video>
<Audio>
<Codec>AAC</Codec>
<Bitrate>128000</Bitrate>
</Audio>
</Encode>
<Encode>
<Name>240x135</Name>
<Enable>true</Enable>
<Description>240x135</Description>
<StreamName>mp4:${SourceStreamName}_240x135</StreamName>
<Video>
<Codec>H.264</Codec>
<Implementation>default</Implementation>
<GPUID>-1</GPUID>
<Profile>baseline</Profile>
<Bitrate>120000</Bitrate>
<KeyFrameInterval>
<FollowSource>false</FollowSource>
<Interval>12</Interval>
</KeyFrameInterval>
<FrameSize>
<FitMode>crop</FitMode>
<Width>240</Width>
<Height>135</Height>
<Crop>0,0,0,0</Crop>
<SourceRectangle></SourceRectangle>
</FrameSize>
</Video>
<Audio>
<Codec>AAC</Codec>
<Bitrate>128000</Bitrate>
</Audio>
</Encode>
<Encode>
<Name>1280x720</Name>
<Enable>true</Enable>
<Description>1280x720</Description>
<StreamName>mp4:${SourceStreamName}_1280x720</StreamName>
<Video>
<Codec>H.264</Codec>
<Implementation>default</Implementation>
<GPUID>-1</GPUID>
<Profile>main</Profile>
<Bitrate>3000000</Bitrate>
<KeyFrameInterval>
<FollowSource>true</FollowSource>
<Interval>0</Interval>
</KeyFrameInterval>
<FrameSize>
<FitMode>match-source</FitMode>
<Width>0</Width>
<Height>0</Height>
<Crop>0,0,0,0</Crop>
<SourceRectangle></SourceRectangle>
</FrameSize>
</Video>
<Audio>
<Codec>AAC</Codec>
<Bitrate>128000</Bitrate>
</Audio>
</Encode>
<Encode>
<Name>480x270</Name>
<Enable>true</Enable>
<Description>480x270</Description>
<StreamName>mp4:${SourceStreamName}_480x270</StreamName>
<Video>
<Codec>H.264</Codec>
<Implementation>default</Implementation>
<GPUID>-1</GPUID>
<Profile>baseline</Profile>
<Bitrate>680000</Bitrate>
<KeyFrameInterval>
<FollowSource>false</FollowSource>
<Interval>24</Interval>
</KeyFrameInterval>
<FrameSize>
<FitMode>crop</FitMode>
<Width>480</Width>
<Height>270</Height>
<Crop>0,0,0,0</Crop>
<SourceRectangle></SourceRectangle>
</FrameSize>
</Video>
<Audio>
<Codec>AAC</Codec>
<Bitrate>128000</Bitrate>
</Audio>
</Encode>
</Encodes>
</Transcode>
</Root>

So you can see that all key frames internal are multiples of 8.

But as result, we have inconstant chunk duration :

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:1
#EXTINF:8.0,
https://XXXX/media_w955918613_b184000_slfr_1.ts?bearer=LTE&sid=f389f231-f5ca-484f-a5c3-36a83be0201a 

#EXTINF:8.75,
https://XXXXXXX/media_w955918613_b184000_slfr_2.ts?bearer=LTE&sid=f389f231-f5ca-484f-a5c3-36a83be0201a
#EXTINF:8.406,
https://XXXXXXX/media_w955918613_b184000_slfr_3.ts?bearer=LTE&sid=f389f231-f5ca-484f-a5c3-36a83be0201a
#EXTINF:7.5,
https://XXXXXXX/media_w955918613_b184000_slfr_4.ts?bearer=LTE&sid=f389f231-f5ca-484f-a5c3-36a83be0201a
#EXTINF:7.344,
https://XXXXXXX/media_w955918613_b184000_slfr_5.ts?bearer=LTE&sid=f389f231-f5ca-484f-a5c3-36a83be0201a
#EXTINF:8.906,
https://XXXXXXX/media_w955918613_b184000_slfr_6.ts?bearer=LTE&sid=f389f231-f5ca-484f-a5c3-36a83be0201a
#EXTINF:7.344,
https://XXXXXXX/media_w955918613_b184000_slfr_7.ts?bearer=LTE&sid=f389f231-f5ca-484f-a5c3-36a83be0201a
#EXTINF:7.844,
https://XXXXXXX/media_w955918613_b184000_slfr_8.ts?bearer=LTE&sid=f389f231-f5ca-484f-a5c3-36a83be0201a
#EXTINF:9.375,
https://XXXXXXX/media_w955918613_b184000_slfr_9.ts?bearer=LTE&sid=f389f231-f5ca-484f-a5c3-36a83be0201a
#EXTINF:7.5,
https://XXXXXXX/media_w955918613_b184000_slfr_10.ts?bearer=LTE&sid=f389f231-f5ca-484f-a5c3-36a83be0201a

We don’t understand why we have chunks of multiple durations.

We try to set input stream frame rate at 32 fps but it does not help.

You need to have your live encoder generate a stable keyframe distance which is also known as a Group of Pictures or GOP. Once you have your keyframe consistent from your encoder please change the chunk duration to match that value.