Wowza Community

mp4 recorded live streams: audio gets out of sync

I’m using the developer version with Wirecast.

To record the live stream I’m using the “record-live” StreamType and use the mp4: prefix.

The audio in the recorded mp4s gets completely out of sync.

I didn’t try it yet without the mp4: prefix but I’ve recorded the raw live stream with rtmpdump and it doesn’t have any issues as suspected.

This is the media info of the server side recording:

http://pastebin.com/DSL2sTvK

This is the media info of the raw recording:

http://pastebin.com/TdtA0qi9

My guess is that Wowza doesn’t regard the variable frame rate when muxing the streams into the mp4 container.

I’m not sure if the sync issues also happen with the default server side recording. Gonna have to try it out.

Regards

This is generally a problem with the source, the encoder. You can enable this Property so you can debug alignment:

https://www.wowza.com/docs/how-to-debug-aac-or-mp3-timecode-issues-with-apple-hls-packetization

Richard

I don’t see output of the debug property in that log snip. It looks like this:

tc[difference]: [calculatedTimecode]:[packetTimecode]:[sampleRate]

Be sure to add “cupertinostreamingpacketizer” to /Streams /LiveStreamPacketizers

Can you clarify what you mean by out of sync? How out of sync? Does it drift out of sync over time and is back in sync if you stop playing and start again? What player are using to playback the stream? Is the stream out of sync when played back using Wowza Server?

What is the key frame interval set to? If it is very long that might be a problem. Try adding this Property to the Application.xml /Streams /Properties list:

<Property>
<Name>recordWaitForVideoKeyFrame</Name>
<Value>true</Value>
<Type>Boolean</Type>
</Property>

Richard

Try different settings in the encoder. Yesterday another user found that changing to 24fps video fixed audio sync issue. We don’t think that is a fix-all in other situations necessarily, but changing audio and video details is where I would start.

Richard

Did anyone ever figure out a solution to this or what to look for in the logs? For instance if there are timecode errors that show up what can be done about it?

Thank you Richard!

I’m gonna try it out.

Anyway, if the problem is the source then why doesn’t the sync issues arise with the live stream and the local recording?

Hi Richard,

I’ve added the debug properties and this is the output:

http://pastebin.com/L6gpGewH

There are two Timecode out of order warning for SanJose and Cupertino.

I’ve done a stream now with the mp4: prefix removed and Wowza created a perfectly working flv video without any sync issues.

So the default flv recording works. The mp4 recording does not.

Hi & thanks again for your reply!

I did add the following lines to Streams/Properties:

<Property>
	<Name>debugAACTimecodes</Name>
	<Value>true</Value>
	<Type>Boolean</Type>
</Property>

But the output doesn’t show any line starting with “tc”.

Be sure to add “cupertinostreamingpacketizer” to /Streams /LiveStreamPacketizers

This is already added by default.

Can you clarify what you mean by out of sync? How out of sync? Does it drift out of sync over time and is back in sync if you stop playing and start again? What player are using to playback the stream? Is the stream out of sync when played back using Wowza Server?

The audio and video drifts out of sync over time. When I jump to to end of the video the delay is much higher.

I have this issue with PotPlayer and Media Player Classic - HC. VLC seems to play the videos fine.

I’ve just tried JWPlayer through the VOD application and couldn’t observe any sync issues.

What is the key frame interval set to? If it is very long that might be a problem. Try adding this Property to the Application.xml /Streams /Properties list:

The keyframe interval is set to every 8 seconds. It’s the default setting. I think this should be fine since I’m not using SanJose.

Adding the “recordWaitForVideoKeyFrame” property seems to solve the sync problem for the standalone players.

Can it be problematic to simply leave this setting?

Thanks & regards,

Philipp