From: Derek C. <der...@mi...> - 2014-04-24 16:21:47
|
Apologies, the problem still happens with my latest resync_bframes_after_full_sync_frames3.patch - I want to change the line: int skip_initial_bframes = sync_disp_frame <= target_display_frame; to int skip_initial_bframes = sync_disp_frame < target_display_frame; but will need to investigate a suspicious side-effect I'm having with my test file... On 24 April 2014 10:57, Derek Chow <der...@mi...> wrote: > I've revised and tidied up the initial patch to fix bad logic where it > only skips one B-frame when it should be able to skip more than one > until the next non-B-frame. > > I think this thread got lost amidst Burkhard's packet index work but > it is still a valid problem regardless of how we 'retrieve the > previous ref sample', 'check the PTS of a sample', 'check if sample is > B-frame'. Basically, if you have a packet sequence like: > > pos 1155584 pts 0 dts 0 dur 100 sz 56956 FT I key ref > pos 1212540 pts -200 dts 100 dur 100 sz 1095 FT B > pos 1213635 pts -100 dts 200 dur 100 sz 35253 FT B > > and try to resync to the 3rd frame (PTS -100), the next frame to be > decoded will end up being the 2nd frame (PTS -200). > > Once we are happy with the packet index generation, we can go ahead > with simplifying the *bitstream*() function code to use it. -- Side > note, I've just come across a file that generates "? key" packet index > entries so for now I've had to use the current demux code - I'll debug > and update on the "New Demultiplexing mode" thread later. > > On 5 March 2014 09:38, Derek Chow <der...@mi...> wrote: >> (sorry I've switch email client and forgot to send as plain text - >> original message below): >> >> Example with XDCAM file: >> >> (IBBP... bitstream with 'ctts' 2, -1, -1, 2 ...). >> After seeking (or decoding) to frame 2, use >> quicktime_set_video_position() to then seek backwards to frame 1. >> get_bitstream_sync_frame() returns 0. >> decoded_frames_to_discard becomes < 0 despite "// Should not be < 0 >> unless the stream is broken." >> >> Please see possible fix attached. >> >> On 4 March 2014 10:10, Derek Chow <der...@mi...> wrote: >>> Example with XDCAM file: >>> >>> (IBBP... bitstream with 'ctts' 2, -1, -1, 2 ...). >>> After seeking (or decoding) to frame 2, use quicktime_set_video_position() >>> to then seek backwards to frame 1. >>> get_bitstream_sync_frame() returns 0. >>> decoded_frames_to_discard becomes < 0 despite "// Should not be < 0 unless >>> the stream is broken." >>> >>> Please see possible fix attached. >>> >>> >>> Derek Chow / C++ Developer >>> >>> der...@mi... / +44(0)7825373230 >>> >>> Office +44 (0)207 884 2530 >>> 21 Broadwall, London, SE1 9PL, United Kingdom >>> http://www.mirriad.com >> >> >> >> -- >> >> >> Derek Chow / C++ Developer >> >> der...@mi... / +44(0)7825373230 >> >> Office +44 (0)207 884 2530 >> 21 Broadwall, London, SE1 9PL, United Kingdom >> http://www.mirriad.com > > > > -- > > > Derek Chow / C++ Developer > > der...@mi... / +44(0)7825373230 > > Office +44 (0)207 884 2530 > 21 Broadwall, London, SE1 9PL, United Kingdom > http://www.mirriad.com -- Derek Chow / C++ Developer der...@mi... / +44(0)7825373230 Office +44 (0)207 884 2530 21 Broadwall, London, SE1 9PL, United Kingdom http://www.mirriad.com |