Opened 11 years ago

Last modified 11 years ago

#2421 new defect

DTS/PTS problems when trying to obtain synced video and audio files

Reported by: Christophe Le Gal Owned by:
Priority: important Component: undetermined
Version: git-master Keywords: regression
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

Bug has been obviously introduced by commit
e42028925bddfdfe46dcd2b7312148379ef4d62e

(previous commit, 394130efe32f85c1f0582094add4376e32ebf20c, is doing just fine)
Which is not surprising, since this commit is exactly about first_pts.

while encoding, ffmpeg is complaining about pts/dts. And audio file contains blank. After a while, it's apparently working normaly again ; but video and audio are totaly unsynchronized.

How to reproduce:

% ffmpeg -i bugreport.ts -vsync 1 out.yuv -async 480 -f s16le out.raw
ffmpeg version : git commit e42028925bddfdfe46dcd2b7312148379ef4d62e (and all git versions since that, including the last one)
built on arch linux, 64bits

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Change History (7)

comment:1 by Christophe Le Gal, 11 years ago

Version: unspecifiedgit-master

comment:2 by Christophe Le Gal, 11 years ago

NB: The bug is apparently the same as the one described by a windows user here : http://ffmpeg.zeranoe.com/forum/viewtopic.php?f=30&t=1074

comment:3 by Carl Eugen Hoyos, 11 years ago

Keywords: regression added; async first_pts removed
Priority: normalimportant

Please provide your failing command line together with the complete, uncut console output and provide (or point to) a failing sample.

comment:4 by Christophe Le Gal, 11 years ago

I have uploaded a very short sample here : http://www.datafilehost.com/download-614c54d3.html

The failing command is :

ffmpeg -v 9 -loglevel 99 -i async_and_pts-dts_problem.ts -y -vsync 1 yy.yuv -async 480 -f s16le yy.raw

Console with this command reads :

ffmpeg version N-51459-g95c7cad Copyright (c) 2000-2013 the FFmpeg developers
  built on Mar 31 2013 13:22:01 with gcc 4.7.2 (GCC)
  configuration: --prefix=/usr/local
  libavutil      52. 23.100 / 52. 23.100
  libavcodec     55.  2.100 / 55.  2.100
  libavformat    55.  1.100 / 55.  1.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 48.105 /  3. 48.105
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set libav* logging level) with argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set libav* logging level) with argument '99'.
Reading option '-i' ... matched as input file with argument 'async_and_pts-dts_problem.ts'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-vsync' ... matched as option 'vsync' (video sync method) with argument '1'.
Reading option 'yy.yuv' ... matched as output file.
Reading option '-async' ... matched as option 'async' (audio sync method) with argument '480'.
Reading option '-f' ... matched as option 'f' (force format) with argument 's16le'.
Reading option 'yy.raw' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set libav* logging level) with argument 9.
Applying option y (overwrite output files) with argument 1.
Applying option vsync (video sync method) with argument 1.
Applying option async (audio sync method) with argument 480.
Successfully parsed a group of options.
Parsing a group of options: input file async_and_pts-dts_problem.ts.
Successfully parsed a group of options.
Opening an input file: async_and_pts-dts_problem.ts.
[avi @ 0x1b485e0] Format avi probed with size=2048 and score=100
[avi @ 0x1b48b40] use odml:1
[avi @ 0x1b485e0] File position before avformat_find_stream_info() is 4108
[avi @ 0x1b485e0] first_dts 0 not matching first dts 11520 in the queue
    Last message repeated 19 times
[avi @ 0x1b485e0] first_dts 0 not matching first dts 23616 in the queue
    Last message repeated 19 times
[avi @ 0x1b485e0] first_dts 0 not matching first dts 35712 in the queue
    Last message repeated 19 times
[avi @ 0x1b485e0] first_dts 0 not matching first dts 47808 in the queue
    Last message repeated 19 times
[avi @ 0x1b485e0] All info found
rfps: 24.750000 0.015018
    Last message repeated 1 times
rfps: 24.833333 0.006675
    Last message repeated 1 times
rfps: 24.916667 0.001669
    Last message repeated 1 times
rfps: 25.000000 0.000000
rfps: 25.083333 0.001669
    Last message repeated 1 times
rfps: 25.166667 0.006675
    Last message repeated 1 times
rfps: 25.250000 0.015018
    Last message repeated 1 times
rfps: 49.750000 0.015018
    Last message repeated 1 times
rfps: 49.833333 0.006675
    Last message repeated 1 times
rfps: 49.916667 0.001669
    Last message repeated 1 times
rfps: 50.000000 0.000000
rfps: 50.083333 0.001669
    Last message repeated 1 times
rfps: 50.166667 0.006675
    Last message repeated 1 times
rfps: 50.250000 0.015018
    Last message repeated 1 times
[avi @ 0x1b485e0] File position after avformat_find_stream_info() is 902767
Input #0, avi, from 'async_and_pts-dts_problem.ts':
  Metadata:
    encoder         : MEncoder SVN-r35920-4.7.2
  Duration: 00:00:13.12, start: 0.000000, bitrate: 5093 kb/s
    Stream #0:0, 41, 1/25: Video: mpeg2video (Main) ([2][0][0][16] / 0x10000002), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 1/50, 25 fps, 25 tbr, 25 tbn, 50 tbc
    Stream #0:1, 104, 1/24000: Audio: mp2 (P[0][0][0] / 0x0050), 48000 Hz, stereo, s16p, 192 kb/s
Successfully opened the file.
Parsing a group of options: output file yy.yuv.
Successfully parsed a group of options.
Opening an output file: yy.yuv.
Successfully opened the file.
Parsing a group of options: output file yy.raw.
Applying option f (force format) with argument s16le.
Successfully parsed a group of options.
Opening an output file: yy.raw.
Successfully opened the file.
[buffer @ 0x1b4d160] Setting entry with key 'video_size' to value '720x576'
[buffer @ 0x1b4d160] Setting entry with key 'pix_fmt' to value '0'
[buffer @ 0x1b4d160] Setting entry with key 'time_base' to value '1/25'
[buffer @ 0x1b4d160] Setting entry with key 'pixel_aspect' to value '64/45'
[buffer @ 0x1b4d160] Setting entry with key 'sws_param' to value 'flags=2'
[buffer @ 0x1b4d160] Setting entry with key 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0x1c52dc0] w:720 h:576 pixfmt:yuv420p tb:1/25 fr:25/1 sar:64/45 sws_param:flags=2
[AVFilterGraph @ 0x1c9e0e0] query_formats: 3 queried, 2 merged, 0 already done, 0 delayed
[abuffer @ 0x1b49b60] Setting entry with key 'time_base' to value '1/48000'
[abuffer @ 0x1b49b60] Setting entry with key 'sample_rate' to value '48000'
[abuffer @ 0x1b49b60] Setting entry with key 'sample_fmt' to value 's16p'
[abuffer @ 0x1b49b60] Setting entry with key 'channel_layout' to value '0x3'
[graph 1 input from stream 0:1 @ 0x1b48e80] tb:1/48000 samplefmt:s16p samplerate:48000 chlayout:0x3
-async is forwarded to lavfi similarly to -af aresample=async=480:min_hard_comp=0.100000:first_pts=0.
[aformat @ 0x1c52640] Setting entry with key 'sample_fmts' to value 's16'
[AVFilterGraph @ 0x1b620a0] query_formats: 5 queried, 12 merged, 0 already done, 0 delayed
[graph 1 aresample for input stream 0:1 @ 0x1c9ed00] ch:2 chl:stereo fmt:s16p r:48000Hz -> ch:2 chl:stereo fmt:s16 r:48000Hz
[mpeg2video @ 0x1b48f80] detected 8 logical cores
Output #0, rawvideo, to 'yy.yuv':
  Metadata:
    encoder         : Lavf55.1.100
    Stream #0:0, 0, 1/90000: Video: rawvideo (I420 / 0x30323449), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 1/25, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Output #1, s16le, to 'yy.raw':
  Metadata:
    encoder         : Lavf55.1.100
    Stream #1:0, 0, 1/90000: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video -> rawvideo)
  Stream #0:1 -> #1:0 (mp2 -> pcm_s16le)
Press [q] to stop, [?] for help
*** 4 dup!
*** 1 dup!
    Last message repeated 2 times
[avi @ 0x1b485e0] first_dts 0 not matching first dts 59904 in the queue
    Last message repeated 19 times
*** 1 dup!
[avi @ 0x1b485e0] first_dts 0 not matching first dts 72000 in the queue
    Last message repeated 18 times
*** 1 dup!
[avi @ 0x1b485e0] first_dts 0 not matching first dts 83520 in the queue
    Last message repeated 19 times
*** 1 dup!
[avi @ 0x1b485e0] first_dts 0 not matching first dts 95616 in the queue
    Last message repeated 19 times
*** 1 dup!
[avi @ 0x1b485e0] first_dts 0 not matching first dts 107712 in the queue
    Last message repeated 19 times
*** 1 dup!
    Last message repeated 1 times
[avi @ 0x1b485e0] first_dts 0 not matching first dts 119808 in the queue
    Last message repeated 19 times
*** 1 dup!
[avi @ 0x1b485e0] first_dts 0 not matching first dts 131904 in the queue
    Last message repeated 19 times
*** 1 dup!
[avi @ 0x1b485e0] first_dts 0 not matching first dts 144000 in the queue
    Last message repeated 18 times
*** 1 dup!
[avi @ 0x1b485e0] first_dts 0 not matching first dts 155520 in the queue
    Last message repeated 19 times
*** 1 dup!
[avi @ 0x1b485e0] first_dts 0 not matching first dts 167616 in the queue
    Last message repeated 19 times
*** 1 dup!
[avi @ 0x1b485e0] first_dts 0 not matching first dts 179712 in the queue
    Last message repeated 19 times
*** 1 dup!
[avi @ 0x1b485e0] first_dts 0 not matching first dts 191808 in the queue
    Last message repeated 19 times
*** 1 dup!
    Last message repeated 1 times
[avi @ 0x1b485e0] first_dts 0 not matching first dts 203904 in the queue
    Last message repeated 19 times
*** 1 dup!
[avi @ 0x1b485e0] first_dts 0 not matching first dts 216000 in the queue
    Last message repeated 18 times
*** 1 dup!
[avi @ 0x1b485e0] first_dts 0 not matching first dts 227520 in the queue
    Last message repeated 19 times
*** 1 dup!
[avi @ 0x1b485e0] first_dts 0 not matching first dts 239616 in the queue
    Last message repeated 19 times
*** 1 dup!
[avi @ 0x1b485e0] first_dts 0 not matching first dts 251712 in the queue
    Last message repeated 19 times
*** 1 dup!
[avi @ 0x1b485e0] first_dts 0 not matching first dts 263808 in the queue
    Last message repeated 19 times
*** 1 dup!
[avi @ 0x1b485e0] first_dts 0 not matching first dts 275904 in the queue
    Last message repeated 19 times
*** 1 dup!
[avi @ 0x1b485e0] first_dts 0 not matching first dts 288000 in the queue
    Last message repeated 18 times
*** 1 dup!
    Last message repeated 1 times
[avi @ 0x1b485e0] first_dts 0 not matching first dts 299520 in the queue
    Last message repeated 18 times
[mp2 @ 0x1b49c40] Header missing
Error while decoding stream #0:1: Invalid data found when processing input
[graph 1 aresample for input stream 0:1 @ 0x1c9ed00] [SWR @ 0x1bfd6a0] compensating audio timestamp drift:0.024000 compensation:480 in:48000
[s16le @ 0x1b614c0] st:0 PTS: 0 DTS: 0 < 1127521 invalid, clipping
[graph 1 aresample for input stream 0:1 @ 0x1c9ed00] [SWR @ 0x1bfd6a0] adding 16384 audio samples of silence
    Last message repeated 35 times
[graph 1 aresample for input stream 0:1 @ 0x1c9ed00] [SWR @ 0x1bfd6a0] adding 13812 audio samples of silence
[s16le @ 0x1b614c0] st:0 PTS: 2153 DTS: 2153 < 1127522 invalid, clipping
frame=  301 fps=0.0 q=0.0 size=  182858kB time=00:00:12.58 bitrate=119062.6kbitsst:0 PTS: 6953 DTS: 6953 < 1127523 invalid, clipping
[graph 1 aresample for input stream 0:1 @ 0x1c9ed00] [SWR @ 0x1bfd6a0] compensating audio timestamp drift:-0.001025 compensation:-49 in:48000
[s16le @ 0x1b614c0] st:0 PTS: 11753 DTS: 11753 < 1127524 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 16553 DTS: 16553 < 1127525 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 21353 DTS: 21353 < 1127526 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 26153 DTS: 26153 < 1127527 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 30953 DTS: 30953 < 1127528 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 35753 DTS: 35753 < 1127529 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 40553 DTS: 40553 < 1127530 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 45353 DTS: 45353 < 1127531 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 50153 DTS: 50153 < 1127532 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 54953 DTS: 54953 < 1127533 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 59753 DTS: 59753 < 1127534 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 64553 DTS: 64553 < 1127535 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 69353 DTS: 69353 < 1127536 invalid, clipping
*** 1 dup!
[avi @ 0x1b485e0] first_dts 0 not matching first dts 311040 in the queue
[s16le @ 0x1b614c0] st:0 PTS: 74153 DTS: 74153 < 1127537 invalid, clipping
[graph 1 aresample for input stream 0:1 @ 0x1c9ed00] [SWR @ 0x1bfd6a0] compensating audio timestamp drift:0.016037 compensation:480 in:48000
[s16le @ 0x1b614c0] st:0 PTS: 78953 DTS: 78953 < 1127538 invalid, clipping
[avi @ 0x1b485e0] first_dts 0 not matching first dts 312584 in the queue
[graph 1 aresample for input stream 0:1 @ 0x1c9ed00] [SWR @ 0x1bfd6a0] compensating audio timestamp drift:0.015516 compensation:480 in:48000
[s16le @ 0x1b614c0] st:0 PTS: 83753 DTS: 83753 < 1127539 invalid, clipping
[graph 1 aresample for input stream 0:1 @ 0x1c9ed00] [SWR @ 0x1bfd6a0] compensating audio timestamp drift:0.014996 compensation:480 in:48000
[s16le @ 0x1b614c0] st:0 PTS: 88553 DTS: 88553 < 1127540 invalid, clipping
*** 1 dup!
[mp2 @ 0x1b49c40] incomplete frame
Error while decoding stream #0:1: Invalid data found when processing input
[s16le @ 0x1b614c0] st:0 PTS: 101033 DTS: 101033 < 1127541 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 108713 DTS: 108713 < 1127542 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 116393 DTS: 116393 < 1127543 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 124073 DTS: 124073 < 1127544 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 131753 DTS: 131753 < 1127545 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 139433 DTS: 139433 < 1127546 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 147113 DTS: 147113 < 1127547 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 154793 DTS: 154793 < 1127548 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 162473 DTS: 162473 < 1127549 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 170153 DTS: 170153 < 1127550 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 177833 DTS: 177833 < 1127551 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 185513 DTS: 185513 < 1127552 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 193193 DTS: 193193 < 1127553 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 200873 DTS: 200873 < 1127554 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 208553 DTS: 208553 < 1127555 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 216233 DTS: 216233 < 1127556 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 223913 DTS: 223913 < 1127557 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 231593 DTS: 231593 < 1127558 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 239273 DTS: 239273 < 1127559 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 246953 DTS: 246953 < 1127560 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 254633 DTS: 254633 < 1127561 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 262313 DTS: 262313 < 1127562 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 269993 DTS: 269993 < 1127563 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 277673 DTS: 277673 < 1127564 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 285353 DTS: 285353 < 1127565 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 293033 DTS: 293033 < 1127566 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 300713 DTS: 300713 < 1127567 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 308393 DTS: 308393 < 1127568 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 316073 DTS: 316073 < 1127569 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 323753 DTS: 323753 < 1127570 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 331433 DTS: 331433 < 1127571 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 339113 DTS: 339113 < 1127572 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 346793 DTS: 346793 < 1127573 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 354473 DTS: 354473 < 1127574 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 362153 DTS: 362153 < 1127575 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 369833 DTS: 369833 < 1127576 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 377513 DTS: 377513 < 1127577 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 385193 DTS: 385193 < 1127578 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 392873 DTS: 392873 < 1127579 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 400553 DTS: 400553 < 1127580 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 408233 DTS: 408233 < 1127581 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 415913 DTS: 415913 < 1127582 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 423593 DTS: 423593 < 1127583 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 431273 DTS: 431273 < 1127584 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 438953 DTS: 438953 < 1127585 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 446633 DTS: 446633 < 1127586 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 454313 DTS: 454313 < 1127587 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 461993 DTS: 461993 < 1127588 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 469673 DTS: 469673 < 1127589 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 477353 DTS: 477353 < 1127590 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 485033 DTS: 485033 < 1127591 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 492713 DTS: 492713 < 1127592 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 500393 DTS: 500393 < 1127593 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 508073 DTS: 508073 < 1127594 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 515753 DTS: 515753 < 1127595 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 523433 DTS: 523433 < 1127596 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 531113 DTS: 531113 < 1127597 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 538793 DTS: 538793 < 1127598 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 546473 DTS: 546473 < 1127599 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 554153 DTS: 554153 < 1127600 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 561833 DTS: 561833 < 1127601 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 569513 DTS: 569513 < 1127602 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 577193 DTS: 577193 < 1127603 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 584873 DTS: 584873 < 1127604 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 592553 DTS: 592553 < 1127605 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 600233 DTS: 600233 < 1127606 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 607913 DTS: 607913 < 1127607 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 615593 DTS: 615593 < 1127608 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 623273 DTS: 623273 < 1127609 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 630953 DTS: 630953 < 1127610 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 638633 DTS: 638633 < 1127611 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 646313 DTS: 646313 < 1127612 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 653993 DTS: 653993 < 1127613 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 661673 DTS: 661673 < 1127614 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 669353 DTS: 669353 < 1127615 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 677033 DTS: 677033 < 1127616 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 684713 DTS: 684713 < 1127617 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 692393 DTS: 692393 < 1127618 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 700073 DTS: 700073 < 1127619 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 707753 DTS: 707753 < 1127620 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 715433 DTS: 715433 < 1127621 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 723113 DTS: 723113 < 1127622 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 730793 DTS: 730793 < 1127623 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 738473 DTS: 738473 < 1127624 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 746153 DTS: 746153 < 1127625 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 753833 DTS: 753833 < 1127626 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 761513 DTS: 761513 < 1127627 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 769193 DTS: 769193 < 1127628 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 776873 DTS: 776873 < 1127629 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 784553 DTS: 784553 < 1127630 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 792233 DTS: 792233 < 1127631 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 799913 DTS: 799913 < 1127632 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 807593 DTS: 807593 < 1127633 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 815273 DTS: 815273 < 1127634 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 822953 DTS: 822953 < 1127635 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 830633 DTS: 830633 < 1127636 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 838313 DTS: 838313 < 1127637 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 845993 DTS: 845993 < 1127638 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 853673 DTS: 853673 < 1127639 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 861353 DTS: 861353 < 1127640 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 869033 DTS: 869033 < 1127641 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 876713 DTS: 876713 < 1127642 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 884393 DTS: 884393 < 1127643 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 892073 DTS: 892073 < 1127644 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 899753 DTS: 899753 < 1127645 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 907433 DTS: 907433 < 1127646 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 915113 DTS: 915113 < 1127647 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 922793 DTS: 922793 < 1127648 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 930473 DTS: 930473 < 1127649 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 938153 DTS: 938153 < 1127650 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 945833 DTS: 945833 < 1127651 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 953513 DTS: 953513 < 1127652 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 961193 DTS: 961193 < 1127653 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 968873 DTS: 968873 < 1127654 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 976553 DTS: 976553 < 1127655 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 984233 DTS: 984233 < 1127656 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 991913 DTS: 991913 < 1127657 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 999593 DTS: 999593 < 1127658 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 1007273 DTS: 1007273 < 1127659 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 1014953 DTS: 1014953 < 1127660 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 1022633 DTS: 1022633 < 1127661 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 1030313 DTS: 1030313 < 1127662 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 1037993 DTS: 1037993 < 1127663 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 1045673 DTS: 1045673 < 1127664 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 1053353 DTS: 1053353 < 1127665 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 1061033 DTS: 1061033 < 1127666 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 1068713 DTS: 1068713 < 1127667 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 1076393 DTS: 1076393 < 1127668 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 1084073 DTS: 1084073 < 1127669 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 1091753 DTS: 1091753 < 1127670 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 1099433 DTS: 1099433 < 1127671 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 1107113 DTS: 1107113 < 1127672 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 1114793 DTS: 1114793 < 1127673 invalid, clipping
[s16le @ 0x1b614c0] st:0 PTS: 1122473 DTS: 1122473 < 1127674 invalid, clipping
[output stream 0:0 @ 0x1c52e20] EOF on sink link output stream 0:0:default.
[output stream 1:0 @ 0x1bf7cc0] EOF on sink link output stream 1:0:default.
No more output streams to write to, finishing.
frame=  329 fps=0.0 q=0.0 Lsize=  199868kB time=00:00:19.11 bitrate=85669.7kbits/s dup=32 drop=0    
video:199868kB audio:5930kB subtitle:0 global headers:0kB muxing overhead -2.881704%
Statistics: 8491622 bytes read, 7 seeks

I have cropped the sample to limit upload size. But usually the "invalid, clipping" lines start only after a few minutes of "frame=... fps=..." normal lines.
It appears that pts/dts lines occur when there is a change in the tv flow (starting of commercials for example).

in reply to:  4 comment:5 by Carl Eugen Hoyos, 11 years ago

Replying to chlg:

The failing command is :

ffmpeg -v 9 -loglevel 99 -i async_and_pts-dts_problem.ts -y -vsync 1 yy.yuv -async 480 -f s16le yy.raw

Could you explain what this command line is supposed to do? Sorry, I don't understand.

comment:6 by Christophe Le Gal, 11 years ago

Globally : I want to manipulate (crop, concatenate, ...) with a "frame" precision (ie 40ms precision) movies (eg, remove the commercials).
I do this in a very brutal way :

  • I first create huge raw data files : yuv420 for images (each image is exactly W*H*1.5 bytes in the yuv file) and PCM for audio (each "image" matches a constant size of audio sample ; eg 44100*2*2/25 for PAL DVD) ;
  • I then manipulate them with very simple tools (dd, cat, and some homemade)
  • With the transformed YUV/PCM, I reencode a x264/ogg mkv file

The command is about the first step : obtaining raw data from a movie, with "ultimate constant bitrate". Ie, where dd if=input of=output count=duration*B skip=start*B creates a file "output" which is the file "input" cropped with a given duration and start time (B being the constant amount of bytes per second : W*H*1.5*fps for video, SamplePerSec*NumChannel*BytePerSample for audio)

(This is probably a very dumb way to proceed. But I'm to lazy to understand how to do that for each possible input file format ; and existing movie editor software are not enough extendable. For example, I have code for autodetection of commercial, for automatic cropping. Anyway, wether this is stupid or not is not related to the bug).

I'm sure you known most of the options, but just in case I detail all :

  • -v 9 -loglevel 99 : to have all possible output on the console
  • -i async_etc.ts : input file
  • -y : overwrite output files without confirmation (of course it is useless the first time)
  • -vsync 1 : ensure constant frame rate in output yuv file (duplicate or drop frames if needed)
  • yy.yuv : output yuv file
  • -async 480 : ensure almost constante byte rate in audio output (maximum of 480 samples of drift ; needed because, of course, juste dropping or duplicating audio sample is a bad idea)
  • -f s16le : produce raw pcm file (wave without header)
  • yy.raw : output pcm file

That way, yy.yuv and yy.raw can be manipulated with tools such as dd. And moreover, they are synchronised (as long as the input file has no synchronisation problem), since both files are kept with a constant byterate according to the timestamps : each time the timestamp of the inputfile grows of 1 second, a constant amount of data is produced in output files, no matter how (by duplicating, dropping or stretching data if needed)

Please, excuse the long post. But since I must admit that I'm not sure that I use these options for what they are made for (even if they have done exactly what I expected on a daily basis for years), I've preferred to describe my motivation.

comment:7 by Jean-Pierre, 11 years ago

Hi,

It looks like the bug is the same I came across in the https://ffmpeg.org/trac/ffmpeg/ticket/2367

report, the second part.

I did some tests with different commands and reported them. It could help.

Note: See TracTickets for help on using tickets.