#11080: FFmpeg timestamps do not consistently agree with packet timestamps
-------------------------------------+-------------------------------------
             Reporter:  markfilipak  |                    Owner:  (none)
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  unspecified  |               Resolution:
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Comment (by markfilipak):

 I'm responding in the order your comments are in...

 Replying to [comment:13 Balling]:
 > You moved the first two B frames (their display),

 I didn't move the first 2 B-frames, I dropped them because they are in the
 previous GOP. Here's the script:


 {{{
 : Cutting out a 4 second clip at the splice +/- 2 seconds.
 :
 : source is 00305+00306.m2ts
 : CUT1 = 1:32:49.814 = 5569.814 sec //running time to starting I-frame
 : CUT2 = 1:32:53.818 = 5573.818 sec //running time to ending I-frame
 :
 : CUT1:
 : (5569.814 sec)*(24/1.001 frames/sec) = 133542 frames
 : (2854113 ticks)+(133542 frames)*(3753.75 ticks/frame) = 504137395.5
 ticks
 :                                                       = 504137396 ticks
 : PTS 504137396 is an I-frame in packet 75943446
 :
 : step 1:    ..________drop________
 :                                  \
 : PTS order  ..P         B         B         I..
 :                ___________________________/
 :               /
 : DTS order    I         B         B         P..
 :               \         \         \         \
 :                504126135 504129888 504133642 504137396

 set CUT1=lt(pts\,504137396)

 : step 2: rewrite the I-frame's DTS
 :
 : PTS order                                  I..
 :                                    _______/
 :                                   /
 : DTS order                        I         P..
 :                                   \         \
 :                                    504133642 504137396

 set IDR=if(eq(DTS\,504126135)\,504133642,DTS)

 : CUT2:
 : (5573.818 sec)*(24/1.001 frames/sec) = 133638 frames
 : (2854113 ticks)+(133638 frames)*(3753.75 ticks/frame) = 504497755.5
 ticks
 :                                                       = 504497755 ticks
 : PTS 504497755 is an I-frame in packet 76021654
 :
 : PTS order  ..P         B         B         I
 :                ___________________________/ ________drop________..
 :               /                            /
 : DTS order  ..I         B         B         P         B         B..
 :               \         \         \         \
 :                504486494 504490248 504494001 504497755

 set CUT2=gt(pts\,504497755)

 ffmpeg -copyts -i "c:\00305+00306.m2ts" -map 0 -bsf
 noise=drop='%CUT1%+%CUT2%',setts=dts='%IDR%':pts=PTS -c copy -sn -dn
 -muxdelay 0 "c:\Ticket_11080.m2ts"
 pause

 }}}


 Oh, look. DVBinspector is getting the running time wrong:
 "pts: 0x1E0C86B4 (504137396) => 1:33:21.5266"
 should be:
 504137396-2854113 = (501283283 ticks)/(90000 ticks/sec) =>
 1:32:49.8142[5..]
 DVBinspector isn't subtracting the initial PTS. The initial PTS has no
 relevance to actual frames.

 I will comment on the rest in my next comment.
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/11080#comment:16>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
_______________________________________________
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-trac

To unsubscribe, visit link above, or email
ffmpeg-trac-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to