# Recorded MP4 audio out of sync

**URL:** <https://community.wowza.com/t/recorded-mp4-audio-out-of-sync/38928>\
**Category:** Wowza Streaming Engine\
**Created:** [July 6, 2012, 5:28pm UTC](https://community.wowza.com/t/recorded-mp4-audio-out-of-sync/38928 "2012-07-06T17:28:26Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adeel\_Raza](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@Adeel\_Raza](https://community.wowza.com/u/Adeel_Raza)\
**Post date:** [July 6, 2012, 5:28pm UTC](https://community.wowza.com/t/recorded-mp4-audio-out-of-sync/38928/1 "2012-07-06T17:28:26Z")

</div>

Hey guys,

I have a Flash application from which people can broadcast live. The stream is also recorded in MP4 using the LiveStreamRecord plugin. Since Flash does not support AAC/MP3 audio, the application broadcasts H264 video with SPEEX audio encoding. We are using Wowza transcoder to transcode the stream to H264/AAC and in multiple bit rates.

The problem is that audio is out of sync in MP4 recordings of all bitrates. Can someone tell me what we can do to fix this?

Thanks!

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [July 7, 2012, 12:41pm UTC](https://community.wowza.com/t/recorded-mp4-audio-out-of-sync/38928/2 "2012-07-07T12:41:17Z")

</div>

The LiveStreamRecord API has startOnKeyFrame. Set that to true when recording.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [July 21, 2012, 11:44am UTC](https://community.wowza.com/t/recorded-mp4-audio-out-of-sync/38928/3 "2012-07-21T11:44:04Z")

</div>

Try adding recordWaitForVideoKeyFrame to /Streams /Properties

```auto
<Streams>
<StreamType>live-record</StreamType>
<StorageDir>${com.wowza.wms.context.VHostConfigHom e}/content</StorageDir>
<KeyDir>${com.wowza.wms.context.VHostConfigHome}/keys</KeyDir>
<LiveStreamPacketizers>cupertinostreamingpacketize r, smoothstreamingpacketizer, sanjosestreamingpacketizer</LiveStreamPacketizers>
<Properties>
<Property>
<Name>recordWaitForVideoKeyFrame</Name>
<Value>true</Value>
<Type>Boolean</Type>
</Property>
</Properties>
</Streams>

```

You might consider using LiveStreamRecord API to record one stream instead of using StreamType “live-record” and recording all transcoded streams, which your disk might not be able to keep up with.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [July 23, 2012, 10:49pm UTC](https://community.wowza.com/t/recorded-mp4-audio-out-of-sync/38928/4 "2012-07-23T22:49:13Z")

</div>

What is the source? Is it a Flash app with h.264 video and Speex audio?

Is there sound when you play the stream live?

Have you seen this example?

[https://www.wowza.com/docs/how-to-convert-flash-player-11-output-from-h-264-speex-audio-to-h-264-aac-audio-using-wowza-transcoder](https://www.wowza.com/docs/how-to-convert-flash-player-11-output-from-h-264-speex-audio-to-h-264-aac-audio-using-wowza-transcoder)

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [July 24, 2012, 1:39pm UTC](https://community.wowza.com/t/recorded-mp4-audio-out-of-sync/38928/5 "2012-07-24T13:39:00Z")

</div>

Are using hdvr to record, or Wowza? Please detail the exact work-flow so I can understand what you are doing.

Have you tried to LiveStreamRecord package? Or are you still using StreamType “live-record” with the Transcoder enabled?

Are you using mp4: prefix in the stream name to instruct Wowza to write to mp4?

Are you testing the result file from the source, or transcoded stream? If source, are you playing back the mp4 in Flash, or other client? If other client, it doesn’t work because it is Speex audio. The transcoded streams should work, but you should use the LiveStreamRecord addon or API to record one stream, using StreamType “live” instead of “live-record”

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [July 25, 2012, 1:27pm UTC](https://community.wowza.com/t/recorded-mp4-audio-out-of-sync/38928/6 "2012-07-25T13:27:51Z")

</div>

Stop Wowza, rename or delete the access log. Then add “cupertinostreamingpacketizer” to the Application.xml /LiveStreamPacketizers, if it is not already there.

Then re-start Wowza and run through your tests: Publish from this application, and try to playback.

Then zip up and send the conf, logs and transcoder folders to support@wowza.com. Include a link to this thread for reference.

Richard

---

<div class="post-metadata">

**Author:** ![Prajosh\_vm](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@Prajosh\_vm](https://community.wowza.com/u/Prajosh_vm)\
**Post date:** [July 21, 2012, 1:22am UTC](https://community.wowza.com/t/recorded-mp4-audio-out-of-sync/38928/7 "2012-07-21T01:22:59Z")

</div>

Hi Richard

I also have same problem, video recording in mp4 format but no sound. I am also recording flv and it has sound.

We are using Transcoder Addon

Here is the xml configuration in Application.xml

live-record

${com.wowza.wms.context.VHostConfigHome}/content

${com.wowza.wms.context.VHostConfigHome}/keys

cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer

transcoder

hdfvr.xml

${com.wowza.wms.context.VHostConfigHome}/transcoder/profiles

${com.wowza.wms.context.VHostConfigHome}/transcoder/templates

can you please let me know where I need to add startOnKeyFrame ?

Thanks

Prajosh

---

<div class="post-metadata">

**Author:** ![Prajosh\_vm](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@Prajosh\_vm](https://community.wowza.com/u/Prajosh_vm)\
**Post date:** [July 22, 2012, 11:42pm UTC](https://community.wowza.com/t/recorded-mp4-audio-out-of-sync/38928/8 "2012-07-22T23:42:28Z")

</div>

Hi Richard,

It is recording MP4 but still no sound

Thanks

Prajosh

> Try adding recordWaitForVideoKeyFrame to /Streams /Properties
> 
> ```auto
> <Streams>
> <StreamType>live-record</StreamType>
> <StorageDir>${com.wowza.wms.context.VHostConfigHom e}/content</StorageDir>
> <KeyDir>${com.wowza.wms.context.VHostConfigHome}/keys</KeyDir>
> <LiveStreamPacketizers>cupertinostreamingpacketize r, smoothstreamingpacketizer, sanjosestreamingpacketizer</LiveStreamPacketizers>
> <Properties>
> <Property>
> <Name>recordWaitForVideoKeyFrame</Name>
> <Value>true</Value>
> <Type>Boolean</Type>
> </Property>
> </Properties>
> </Streams>
> 
> ```
> 
> You might consider using LiveStreamRecord API to record one stream instead of using StreamType “live-record” and recording all transcoded streams, which your disk might not be able to keep up with.
> 
> Richard

---

<div class="post-metadata">

**Author:** ![Prajosh\_vm](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@Prajosh\_vm](https://community.wowza.com/u/Prajosh_vm)\
**Post date:** [July 23, 2012, 11:51pm UTC](https://community.wowza.com/t/recorded-mp4-audio-out-of-sync/38928/9 "2012-07-23T23:51:00Z")

</div>

We are using [http://hdfvr.com/](http://hdfvr.com/) for client side

The video is saving in two format on server flv and mp4. Flv has sound but mp4 does not have sound.

Thanks

Prajosh

> What is the source? Is it a Flash app with h.264 video and Speex audio?
> 
> Is there sound when you play the stream live?
> 
> Have you seen this example?
> 
> [Wowza Streaming Engine](https://www.wowza.com/docs/how-to-convert-flash-player-11-output-from-h-264-speex-audio-to-h-264-aac-audio-using-wowza-transcoder)
> 
> Richard

---

<div class="post-metadata">

**Author:** ![Prajosh\_vm](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@Prajosh\_vm](https://community.wowza.com/u/Prajosh_vm)\
**Post date:** [July 25, 2012, 4:35am UTC](https://community.wowza.com/t/recorded-mp4-audio-out-of-sync/38928/10 "2012-07-25T04:35:27Z")

</div>

We are using HDFVR on client side and it is connected with wowza server installed on Amazon EC2

I am still trying StreamType ‘live-record’ with Transcoder enabaled. Actually we need to save the video on server and play back later.

Yes we are using mp4: prefix name to instruct wowza to write mp4

Transcoder template xml

true

aac

mp4:${SourceStreamName}

PassThru

${SourceVideoBitrate}

AAC

48000

Hope this will give u idea about our usage.

Thanks

Prajosh

> Are using hdvr to record, or Wowza? Please detail the exact work-flow so I can understand what you are doing.
> 
> Have you tried to LiveStreamRecord package? Or are you still using StreamType “live-record” with the Transcoder enabled?
> 
> Are you using mp4: prefix in the stream name to instruct Wowza to write to mp4?
> 
> Are you testing the result file from the source, or transcoded stream? If source, are you playing back the mp4 in Flash, or other client? If other client, it doesn’t work because it is Speex audio. The transcoded streams should work, but you should use the LiveStreamRecord addon or API to record one stream, using StreamType “live” instead of “live-record”
> 
> Richard

---

<div class="post-metadata">

**Author:** ![Prajosh\_vm](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@Prajosh\_vm](https://community.wowza.com/u/Prajosh_vm)\
**Post date:** [July 30, 2012, 11:20pm UTC](https://community.wowza.com/t/recorded-mp4-audio-out-of-sync/38928/11 "2012-07-30T23:20:15Z")

</div>

Hi Richard,

I have send the details to support@wowza.com

can you please let me know the status ?

Thanks

Prajosh

> Stop Wowza, rename or delete the access log. Then add “cupertinostreamingpacketizer” to the Application.xml /LiveStreamPacketizers, if it is not already there.
> 
> Then re-start Wowza and run through your tests: Publish from this application, and try to playback.
> 
> Then zip up and send the conf, logs and transcoder folders to support@wowza.com. Include a link to this thread for reference.
> 
> Richard

---

<div class="post-metadata">

**Author:** ![Steven\_Clarke](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Steven\_Clarke](https://community.wowza.com/u/Steven_Clarke)\
**Post date:** [December 6, 2012, 3:53pm UTC](https://community.wowza.com/t/recorded-mp4-audio-out-of-sync/38928/12 "2012-12-06T15:53:57Z")

</div>

What was the resolution for this issue? Using the same HDFVR program & Wowza. The end result .mp4 does not have audio.

Thanks.
