[Libav-user] muxer ignoring my PTS audio values

Michael R. Hines michael at hinespot.com
Tue Jan 1 03:36:05 CET 2013


Following a few previous posts on libav-user, I've been trying to get
my audio and video synchronized using the dranger tutorial.

I'm transcoding (from mpeg2/ac3 to h264/ac3) to make a Blu-ray disc.

So, I scrounged up some code from the tutorial and this mailing list
and everything seems to be fine, except for the audio sync.

In my case, I'm just copying the audio packets (not decoding them).
Similar to this post:

I noticed the the audio packets are always off from the video by a
constant factor when I try to play the video.

So, naturally, I tried a binary search by "tweaking" the PTS value
by fixed offsets.

But when I validate the PTS values with "ffprobe -show_packets", the
muxer did not use the PTS values that I choose. 
Instead, the PTS values start from zero and continue up rather than
the values I chose.

The muxer did not print any errors - it wrote the "copied"
audio packets just fine - so I assumed my chosen PTS values would
have been written to.

Playing the audio on my desktop also works fine - it's just that
it has the wrong PTS values.

Is there something I need to do to "make" the muxer respect the
values I've chosen?


- Michael

More information about the Libav-user mailing list