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

Nico Sabbi nsabbi at email.it
Thu Jul 14 12:00:23 CEST 2005


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_bps;
>    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




More information about the MPlayer-users mailing list