[Libav-user] Timing Issues Only With Windows Media Player

Stephen H. Gerstacker stephen at napkinstudio.com
Fri Mar 14 14:34:31 CET 2014

I’m constructing a video file from pre-encoded packets. Video is H.264, Audio is AAC, and the container is MP4.

As an example, I have:
- 20 seconds of video
- 10 seconds of audio, starting at 5 seconds in.

I’m checking PTSs and writing with av_write_frame in the proper order. The resulting file works great in VLC and QuickTime, but if I open the video in Windows Media Player, that audio starts playing immediately. Everything else about the audio is fine, it just starts at the wrong time.

Any idea on why this would be happening? Is there a proper way to push audio in to a video file that doesn’t start immediately?

I’ve also tried av_interleaved_write_frame, but that didn’t change anything.

- Stephen

More information about the Libav-user mailing list