Baptiste Coudurier <[EMAIL PROTECTED]> added the comment:

Michael Niedermayer wrote:
> Michael Niedermayer <[EMAIL PROTECTED]> added the comment:
> 
> On Mon, Oct 29, 2007 at 10:38:51AM -0000, Baptiste Coudurier wrote:
>> Baptiste Coudurier <[EMAIL PROTECTED]> added the comment:
>>
>> I won't trust a program printing false messages.
> 
>> The file clearly does not contain any timestamp discontinuity, 
> 
> true
> 
>> and current code
>> in ffmpeg.c modifies subsequent pts and dts so code is wrong. This is:
> 
> if the code wouldnt modify the pts/dts then it would be wrong and an
> important bug as then it would generate invalid files
> the mere printing of a wrong error message is hardly an important bug

Modifying pts and dts in this case is wrong since there is no timestamp
discontinuity, consequently with -vcodec copy or -async 1 it will
introduce A/V desync:

ffmpeg -async 1 -y -v 3 -i timestamp_discont.mpg -f vob test.mpg

FFmpeg version SVN-r10872, Copyright (c) 2000-2007 Fabrice Bellard, et al.
   configuration: --enable-gpl --enable-libmp3lame --enable-libfaac
--enable-liba52 --enable-libx264 --enable-pthreads --enable-libxvid
--enable-libfaad
   libavutil version: 49.5.0
   libavcodec version: 51.47.1
   libavformat version: 51.17.0
   built on Oct 29 2007 10:42:55, gcc: 4.2.3 20071014 (prerelease)
(Debian 4.2.2-3)
Input #0, mpeg, from 'timestamp_discont.mpg':
   Duration: 00:00:00.2, start: 0.220000, bitrate: 10240 kb/s
     Stream #0.0[0x1e0], 1/90000: Video: mpeg2video, yuv422p, 720x608
[PAR 1:1 DAR 45:38], 1/25, 11386 kb/s, 25.00 fps(r)
     Stream #0.1[0x1c0], 1/90000: Audio: mp2, 48000 Hz, stereo, 384 kb/s
Output #0, vob, to 'test.mpg':
     Stream #0.0, 1/90000: Video: mpeg2video, yuv422p, 720x608 [PAR 1:1
DAR 45:38], 1/25, q=2-31, 200 kb/s, 25.00 fps(c)
     Stream #0.1, 1/90000: Audio: mp2, 48000 Hz, stereo, 64 kb/s
Stream mapping:
   Stream #0.0 -> #0.0
   Stream #0.1 -> #0.1
Press [q] to stop encoding
timestamp discontinuity -40000, new offset= -180000
adding 1920 audio samples of silence
[mpeg2video @ 0x84cb190]ac-tex damaged at 0 29
[mpeg2video @ 0x84cb190]Warning MVs not available
[mpeg2video @ 0x84cb190]concealing 405 DC, 405 AC, 405 MV errors
frame=    7 fps=  0 q=9.7 Lsize=     118kB time=0.1
bitrate=13425.8kbits/s dup=0 drop=0

It produces 0.04 sec desync.

ffmpeg -v 3 -i timestamp_discont.mpg -vcodec copy -f vob test.mpg

FFmpeg version SVN-r10872, Copyright (c) 2000-2007 Fabrice Bellard, et al.
   configuration: --enable-gpl --enable-libmp3lame --enable-libfaac
--enable-liba52 --enable-libx264 --enable-pthreads --enable-libxvid
--enable-libfaad
   libavutil version: 49.5.0
   libavcodec version: 51.47.1
   libavformat version: 51.17.0
   built on Oct 29 2007 10:42:55, gcc: 4.2.3 20071014 (prerelease)
(Debian 4.2.2-3)
Input #0, mpeg, from 'timestamp_discont.mpg':
   Duration: 00:00:00.2, start: 0.220000, bitrate: 10240 kb/s
     Stream #0.0[0x1e0], 1/90000: Video: mpeg2video, yuv422p, 720x608
[PAR 1:1 DAR 45:38], 1/25, 11386 kb/s, 25.00 fps(r)
     Stream #0.1[0x1c0], 1/90000: Audio: mp2, 48000 Hz, stereo, 384 kb/s
File 'test.mpg' already exists. Overwrite ? [y/N] y
Output #0, vob, to 'test.mpg':
     Stream #0.0, 1/90000: Video: mpeg2video, yuv422p, 720x608 [PAR 0:1
DAR 0:1], 1/25, q=2-31, 11386 kb/s, 25.00 fps(c)
     Stream #0.1, 1/90000: Audio: mp2, 48000 Hz, stereo, 64 kb/s
Stream mapping:
   Stream #0.0 -> #0.0
   Stream #0.1 -> #0.1
Press [q] to stop encoding
timestamp discontinuity -40000, new offset= -180000
frame=    7 fps=  0 q=1.9 Lsize=     296kB time=0.1
bitrate=33678.2kbits/s dup=0 drop=0
video:289kB audio:1kB global headers:0kB muxing overhead 2.282513%

ffmpeg -vframes 1 -debug 512 -i test.mpg -f null /dev/null

FFmpeg version SVN-r10872, Copyright (c) 2000-2007 Fabrice Bellard, et al.
   configuration: --enable-gpl --enable-libmp3lame --enable-libfaac
--enable-liba52 --enable-libx264 --enable-pthreads --enable-libxvid
--enable-libfaad
   libavutil version: 49.5.0
   libavcodec version: 51.47.1
   libavformat version: 51.17.0
   built on Oct 29 2007 10:42:55, gcc: 4.2.3 20071014 (prerelease)
(Debian 4.2.2-3)
Input #0, mpeg, from 'test.mpg':
   Duration: 00:00:00.2, start: 0.500000, bitrate: 8660 kb/s
     Stream #0.0[0x1e0], 1/90000: Video: mpeg2video, yuv422p, 720x608
[PAR 1:1 DAR 45:38], 1/25, 11386 kb/s, 25.00 fps(r)
     Stream #0.1[0x1c0], 1/90000: Audio: mp2, 48000 Hz, stereo, 64 kb/s
Output #0, null, to '/dev/null':
     Stream #0.0, 1/90000: Video: rawvideo, yuv422p, 720x608 [PAR 1:1 DAR
45:38], 1/25, q=2-31, 200 kb/s, 25.00 fps(c)
     Stream #0.1, 1/90000: Audio: pcm_s16le, 48000 Hz, stereo, 1536 kb/s
Stream mapping:
   Stream #0.0 -> #0.0
   Stream #0.1 -> #0.1
Press [q] to stop encoding
[mpeg @ 0x841dc94]av_read_packet stream=0, pts=48600, dts=45000, size=1993
[mpeg @ 0x841dc94]av_read_packet stream=1, pts=45000, dts=45000, size=576
[mpeg @ 0x841dc94]av_read_frame_internal stream=1, pts=45000, dts=45000,
size=192
[mpeg @ 0x841dc94]av_read_frame_internal stream=1, pts=47160, dts=47160,
size=192
[mpeg @ 0x841dc94]av_read_frame_internal stream=1, pts=49320, dts=49320,
size=192
[mpeg @ 0x841dc94]av_read_packet stream=0, pts=-9223372036854775808,
dts=-9223372036854775808, size=2024
[mpeg @ 0x841dc94]av_read_packet stream=0, pts=-9223372036854775808,
dts=-9223372036854775808, size=2024
[mpeg @ 0x841dc94]av_read_packet stream=0, pts=-9223372036854775808,
dts=-9223372036854775808, size=2024

[...]

[mpeg @ 0x841dc94]av_read_frame_internal stream=0, pts=48600, dts=45000,
size=60928

It also produces 0.04 sec desync.

>> 1) an important problem.
>> 2) a regression.
>>
>> I do not agree at all to downgrade this as minor/feature request.
>> Please change it back as important.
> 
> the bugreport is only about a wrong error message this is not "important"

Well ok, implicitly, it was obvious that code executed when timestamp 
discontinuity was detected would cause problems.

Bugreport is about false detection of timestamp discontinuity which 
provoke desync with -async 1 and -vcodec copy with all files having a
delay between first pts and dts, this is "important" IMHO.

______________________________________________________
FFmpeg issue tracker <[EMAIL PROTECTED]>
<https://roundup.mplayerhq.hu/roundup/ffmpeg/issue137>
______________________________________________________

Reply via email to