OK, I have added the following code into src/demuxers/demux_mpeg_pes.c

static int32_t GetVideoSize(const uint8_t *buf, int length, int
*width, int *height)
{
  int i = 0;         // the minimum length of the video packet header
  //i += buf[i] + 1;   // possible additional header bytes
  for (; i < length-6; i++) {
    if (buf[i] == 0 && buf[i + 1] == 0 && buf[i + 2] == 1) {
      if(buf[i + 3] == 0xb3) {
        int d = (buf[i+4] << 16) | (buf[i+5] << 8) | buf[i+6];
        *width = (d >> 12);
        *height = (d & 0xfff);
        return 1;
      }
    }
  }
  return 0;
}

and then put the following code in parse_video_stream: -

  int Width, Height;
  if (GetVideoSize(p, payload_size, &Width, &Height)) {
   printf("Detected video size %dx%d\n", Width, Height);
  }
  else {
   printf("Failed to detect video size\n");
  }

before:   /* H.264 broadcasts via DVB-S use standard video PES packets,

This detects the video size for MPEG2 broadcasts (Detected video size 704x576
), but not for H264, I'm guessing the payload is in a different
format. Can anyone point me in the direction of a GetVideoSize type of
function for H264 (I looked in libavcodec and the code looks a bit
more complex!), or spot what I am doing wrong here?

TIA


On Jan 23, 2008 11:50 AM, Morfsta <[EMAIL PROTECTED]> wrote:
> hmmm, I've been looking into the demux_mpeg_pes function in xine,
> isn't the height and width stored in the transport stream within the
> pes? I tried to adapt the code that shows the resolution in femon to
> work on the stream in demux_mpeg_pes but not had much success so far..
> :-(
>
> Do you have to parse through the payload itself?
>
>
> On Jan 23, 2008 3:10 AM, Walery Daniloff <[EMAIL PROTECTED]> wrote:
> > Problem in incorrect patch.. The size of a picture 1920?1080 is sewn rigidly
> > up, and for BBS HD it is necessary 1440?1080
> >
> > > Hey, it works ... Sort of. Anyone else having the "green bar" problem?
> > > I get a large green bar across the bottom of the screen and four fuzzy
> > > representations of the picture above it on: -
> > >
> > > BBC HD
> > > DigitalAlb HD-1
> > > DigitalAlb HD-2
> > > SVT HD
> >
> >
> >
> > _______________________________________________
> > vdr mailing list
> > vdr@linuxtv.org
> > http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
> >
>

_______________________________________________
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

Reply via email to