id	summary	reporter	owner	description	type	status	priority	component	version	resolution	keywords	cc	blockedby	blocking	reproduced	analyzed
735	Incorrect DTS sync in OGG codec	zvi		"Hi,

I've noticed incorrect DTS values in OGG encoded audio streams (as part of an OGV file). This happened with a ffmpeg-0.8.7

These are the steps I have taken to reproduce it.

1. Convert a valid and working MP4 (h264/aac) as confirmed by ffprobe to an OGV file using:
{{{
ffmpeg -y -i vid.mp4 -vcodec libtheora -b 1000k -acodec libvorbis -ab 192k vid.ogv
}}}

2. Probing the ""vid.ogv"" file using ffprobe shows that during audio frames, the ""pos"" doesn't change - even for the video frames it seems to repeat ~10 times. See simplified format dump below.

3. While ""vid.ogv"" plays ok in VLC, after doing a zero transformation on it, it breaks completely and audio goes totally out of sync (video plays ok).
{{{
ffmpeg -y -i vid.ogv -vcodec copy -acodec copy new_vid.ogv
}}}

4. The '''new_vid.ogv''' file no longer plays correctly. Putting some debug prints in ffmpeg.c:output_packet(...) I see the following.[[BR]]
A sequence of consecutive audio frames gets the correct DTS values. From 0 to 10941 in steps of ~64.[[BR]]
Then there is a sequence of consecutive video frames. For video the DTS always appears to be correct.[[BR]]
The next sequence of consecutive audio frames now starts at 154048 - instead of being at ~11005[[BR]]

Also notice the negative '''duration''' value.

{{{
Input #0, ogg, from 'new_vid.ogv':
  Duration: -513359:-56:-35.41, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: theora, yuv420p, 960x540 [PAR 1:1 DAR 16:9], 29.97 tbr, 29.97 tbn, 29.97 tbc
    Stream #0.1: Audio: vorbis, 48000 Hz, stereo, s16, 192 kb/s
}}}

If you need any additional information, please let me know.

Thanks,
   TR

{{{
type=video index=0 dts=0 dts_time=0.000000  [100/2997] duration=1 pos=7414
type=video index=0 dts=1 dts_time=0.033367  [100/2997] duration=1 pos=7414
type=video index=0 dts=2 dts_time=0.066733  [100/2997] duration=1 pos=7414
type=video index=0 dts=3 dts_time=0.100100  [100/2997] duration=1 pos=7414
...
type=video index=0 dts=83 dts_time=2.769436  [100/2997] duration=1 pos=260411
type=audio index=1 dts=0 dts_time=0.000000  [1/48000] duration=0 pos=323479
type=audio index=1 dts=N/A dts_time=N/A [1/48000] duration=0 pos=323479
type=audio index=1 dts=N/A dts_time=N/A [1/48000] duration=0 pos=323479
...
type=audio index=1 dts=N/A dts_time=N/A [1/48000] duration=0 pos=323479
type=audio index=1 dts=N/A dts_time=N/A [1/48000] duration=0 pos=323479
type=video index=0 dts=84 dts_time=2.802803  [100/2997] duration=1 pos=260411
type=video index=0 dts=85 dts_time=2.836170  [100/2997] duration=1 pos=355961
type=video index=0 dts=86 dts_time=2.869536  [100/2997] duration=1 pos=355961
type=video index=0 dts=87 dts_time=2.902903  [100/2997] duration=1 pos=355961
type=video index=0 dts=88 dts_time=2.936270  [100/2997] duration=1 pos=355961
type=video index=0 dts=89 dts_time=2.969636  [100/2997] duration=1 pos=355961
type=video index=0 dts=90 dts_time=3.003003  [100/2997] duration=1 pos=355961
type=video index=0 dts=91 dts_time=3.036370  [100/2997] duration=1 pos=355961
type=video index=0 dts=92 dts_time=3.069736  [100/2997] duration=1 pos=355961
type=video index=0 dts=93 dts_time=3.103103  [100/2997] duration=1 pos=355961
type=video index=0 dts=94 dts_time=3.136470  [100/2997] duration=1 pos=355961
type=video index=0 dts=95 dts_time=3.169837  [100/2997] duration=1 pos=355961
type=video index=0 dts=96 dts_time=3.203203  [100/2997] duration=1 pos=355961
type=video index=0 dts=97 dts_time=3.236570  [100/2997] duration=1 pos=355961
type=video index=0 dts=98 dts_time=3.269937  [100/2997] duration=1 pos=419330
type=video index=0 dts=99 dts_time=3.303303  [100/2997] duration=1 pos=419330
type=video index=0 dts=100 dts_time=3.336670  [100/2997] duration=1 pos=419330
type=video index=0 dts=101 dts_time=3.370037  [100/2997] duration=1 pos=419330
type=video index=0 dts=102 dts_time=3.403403  [100/2997] duration=1 pos=419330
type=video index=0 dts=103 dts_time=3.436770  [100/2997] duration=1 pos=419330
type=video index=0 dts=104 dts_time=3.470137  [100/2997] duration=1 pos=419330
type=video index=0 dts=105 dts_time=3.503504  [100/2997] duration=1 pos=419330
...
type=video index=0 dts=148 dts_time=4.938272  [100/2997] duration=1 pos=545023
type=audio index=1 dts=154048 dts_time=3.209333  [1/48000] duration=0 pos=608173
type=audio index=1 dts=N/A dts_time=N/A [1/48000] duration=0 pos=608173
type=audio index=1 dts=N/A dts_time=N/A [1/48000] duration=0 pos=608173
}}}"	defect	closed	normal	undetermined	git-master	duplicate	ogg vorbis sync				1	0
