[MPlayer-users] MPlayer doesn't recognize I-Frames in MPEG-PS

Yaro Pollak slava at plris.com
Thu Jul 14 13:24:08 CEST 2005


----- Original Message -----
From: "Nico Sabbi" <nsabbi at email.it>
To: "MPlayer usage questions, feature requests, bug reports"
<mplayer-users at mplayerhq.hu>
Sent: Thursday, July 14, 2005 12:00
Subject: Re: [MPlayer-users] MPlayer doesn't recognize I-Frames in MPEG-PS


> Yaro Pollak wrote:
>
> >Hello guys,
> >
> >I use MPlayer-1.0pre7 and I have a strange problem when seeking in an
MPEG-PS (MPEG4) file.
> >The general symptoms is that the seek is done to a general location of
the requested point, but it can be off up to 5 seconds.
> >So I decided to study the phenomena, and I narrowed it down to this loop,
which is located in demux_mpg.c in the function demux_seek_mpg():
> >
> >while(1){
> >  int i;
> >  if(sh_audio && !d_audio->eof && d_video->pts && d_audio->pts){
> >    float a_pts=d_audio->pts;
> >
a_pts+=(ds_tell_pts(d_audio)-sh_audio->a_in_buffer_len)/(float)sh_audio->i_b
ps;
> >    if(d_video->pts>a_pts){
> >      skip_audio_frame(sh_audio);  // sync audio
> >      continue;
> >    }
> >  }
> >  i=sync_video_packet(d_video);
> >  if(sh_video->format == 0x10000004) { //mpeg4
> >    if(i==0x1B6) {   //vop (frame) startcode
> >      int pos = videobuf_len;
> >      if(!read_video_packet(d_video)) break; // EOF
> >      if((videobuffer[pos+4] & 0x3F) == 0) break; //I-frame
> >    }
> >  } else if(sh_video->format == 0x10000005){ //h264
> >    if((i & ~0x60) == 0x101 || (i & ~0x60) == 0x102 || (i & ~0x60) ==
0x105) break;
> >  } else {  //default mpeg1/2
> >    if(i==0x1B3 || i==0x1B8) break; // found it!
> >  }
> >  if(!i || !skip_video_packet(d_video)) break; // EOF?
> >}
> >
> >It seems that the check if((videobuffer[pos+4] & 0x3F) == 0) break;
//I-frame never works, then the precision of the search is decreased, the
search is done again, and it ends up somewhere in the vicinity of where I
seeked to, but that is of course not enough.
> >
> >
> for that case (mpeg4) exit immediately from the loop with break, then
> add resync_video_stream(sh_video) just after the loop.
> I was planning to remove that crap, but for mpeg1/2 it requires some
> preliminary work in other files that I haven't begun yet
>
>
>
>  --
>  Email.it, the professional e-mail, gratis per te: http://www.email.it/f
>
>  Sponsor:
>  Scopri il benessere che solo l’aloe vera regala al tuo corpo: cura la tua
pelle
> * Con la vasta gamma di prodotti che ti offre Erboristeria.com
>  Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2380&d=14-7
>
> _______________________________________________
> MPlayer-users mailing list
> MPlayer-users at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/mplayer-users

Thank you very much for your (super) fast response Nico, However, I did not
understand EXACTLY what to do, and I wouldn't want to break something, so
just a clarification: should I put the break (for mpeg4) right after the
format check, after if(i==0x1B6) or after the read_video_packet? And
resync_video_stream should be added regrdless of mpeg type (1/2/4)?

Thank you very much,
Yaro




More information about the MPlayer-users mailing list