[MPlayer-dev-eng] Patch to fix seeking in H264 TS
Ian Rickards
ian.rickards at btinternet.com
Sat Feb 16 00:07:25 CET 2008
> Il Friday 15 February 2008 23:34:17 Loren Merritt ha scritto:
>> On Fri, 15 Feb 2008, Nico Sabbi wrote:
>> > On Friday 15 February 2008 05:27:50 Ian Rickards wrote:
>> >>
>> >> mplayer doesn't seek in BBC HD H.264 transport streams; when you
>> >> try to seek it gets stuck looping forever in demux_seek_ts waiting
>> >> for a 0x105 packet that doesn't ever arrive. The following fixes
>> >> it, and matches the code on line 239 of video.c to sync to a mpeg
>> >> slice:
>> >>
>> >> demux_ts.c
>> >> @@ -3164,7 +3167,7 @@
>> >> break;
>> >> else //H264
>> >> {
>> >> - if((i & ~0x60) == 0x105) break;
>> >> + if((i & ~0x60) == 0x105 || (i & ~0x60) ==
>> >> 0x102 || (i & ~0x60) == 0x101) break; }
>> >>
>> >> if(!i || !skip_video_packet(d_video)) break; //
>> >> EOF?
>> >>
>> >
>> > I don't remember what are NALs 01 and 02; remind me, please
>>
>> 1: normal slice
>> 2: slice with data partitioning (3 and 4 are also for data partitioning,
>> but 2 comes first in the bitstream)
>> 5: IDR slice
>>
>> --Loren Merritt
>
> well, in this case that patch doesn't look correct to me: seeking
> must find a seekable (IDR) slice, right?
Its true I do get some video corruption on a seek, so its not finding a
reference frame with my attempt at a patch.
Here's a log of the verbose output from the current mplayer code which hangs
forever. I put a debugging printf in the while loop waiting for NAL unit
05 - as you can see it gets 09 + 06 + 01 types, but never 05, interleaved
with PARSE_PAT, FILL_PMT, PARSE_PMT. I could upload a sample ts somewhere?
IBPS: 0, vb: 1874961A-V: -0.574 ct: -0.072 19/ 19 89% 6% 1.1% 0 0 70%
IJR: stream_seek 21220149
COLLECT_SECTION, start: 64, size: 184, collected: 368
SKIP: 0+1, TID: 2, TLEN: 286, COLLECTED: 184
COLLECT_SECTION, start: 0, size: 184, collected: 184
SKIP: 0+1, TID: 2, TLEN: 286, COLLECTED: 368
FILL_PMT(prog=6940), PMT_len: 368, IS_START: 0, TS_PID: 258, SIZE=184, M=0,
ES_C
....
PARSE_PMT(6940 INDEX 8), STREAM: 8, FOUND pid=0x918 (2328), type=0x2000,
ES_DESC
R_LENGTH: 32, bytes left: 0
----------------------------
IJR: i&~0x60=109 video->format=10000005
IJR: i&~0x60=106 video->format=10000005
IJR: i&~0x60=101 video->format=10000005
IJR: i&~0x60=101 video->format=10000005
IJR: i&~0x60=101 video->format=10000005
IJR: i&~0x60=101 video->format=10000005
IJR: i&~0x60=101 video->format=10000005
IJR: i&~0x60=101 video->format=10000005
COLLECT_SECTION, start: 64, size: 184, collected: 184
SKIP: 0+1, TID: 0, TLEN: 29, COLLECTED: 184
PARSE_PAT: section_len: 29, section 0/0
PROG: 0 (1-th of 5), PMT: 16
PROG: 6903 (2-th of 5), PMT: 256
PROG: 6904 (3-th of 5), PMT: 257
PROG: 6940 (4-th of 5), PMT: 258
PROG: 6945 (5-th of 5), PMT: 259
IJR: i&~0x60=109 video->format=10000005
IJR: i&~0x60=106 video->format=10000005
IJR: i&~0x60=101 video->format=10000005
IJR: i&~0x60=101 video->format=10000005
IJR: i&~0x60=101 video->format=10000005
IJR: i&~0x60=101 video->format=10000005
IJR: i&~0x60=101 video->format=10000005
IJR: i&~0x60=101 video->format=10000005
COLLECT_SECTION, start: 64, size: 184, collected: 368
SKIP: 0+1, TID: 2, TLEN: 286, COLLECTED: 184
COLLECT_SECTION, start: 0, size: 184, collected: 184
SKIP: 0+1, TID: 2, TLEN: 286, COLLECTED: 368
FILL_PMT(prog=6940), PMT_len: 368, IS_START: 0, TS_PID: 258, SIZE=184, M=0,
ES_C
NT=9, IDX=0, PMT_PTR=0x89cc850
More information about the MPlayer-dev-eng
mailing list