Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: About the VDR SoftDevice Plugin



Am Dienstag, 20. Januar 2004 19:46 schrieb Philippe Gaultier:
> > When the plugin runs (and doesn't crash due other issues ;-) it decodes
> > all
> > frames, so I think the code should be (more or less) correct. Maybe you
> > can
> > dump the packets passed to avcodec in a file and try to replay with an
> > other
> > software.
> > What hardware do you have, maybe you set up replay type wrong. (e.g.
> > replay audio AND video. If there's no audio the device can't sync or so)
> >
> > Roland
>
> Ok thanks for the information.
>
> I'm working on the SigmaDesign Xcard, it embeds an MPEG1/2/4 decoder.
> I wrote the OSD part (finished) and I'm now working on the MPEG2 part.
>
> I used your code "as is" (just stripped out all the synchro and avcodec
> stuff) and everything is all right except LiveTV.
>
> The problem during the LiveTV playback is that the decoder only present
> IFRAMES.
> The only "work around" I found is to play a recording and then to switch
> back to the channel I want to see (sometimes, it works and LiveTV is
> perfect).
>
> Some questions now :
>
> - My mpeg decoder needs an Elementary Stream (m2v)
> - VDR delivers PES.
> - I'm not in trouble with synchro because I only want to display the video
> over my Device.

But you will want to hear the audio one way or the other, so you will have to 
sync I think.

>
> 1) as I do not fully understand your code, could you tell me if you strip
> off all the PES header and if the following code could do the same job :
>
> -----------8<-----------
> while(<I have some data to demux and extract in the buffer>)
> {
>   if((Data[pes+0]==0x00)&&(Data[pes+1]==0x00)&&(Data[pes+2]==0x01))
>   {
>     es_len=Data[pes+4]*256+Data[pes+5]+6-(9+Data[pes+8]);
>     es_start=pes_start+9+Data[pes+8];
>     // additional code to extract PTS and DTS
>     if((Data[pes+6]&0xC0)==0x80))
>     {
> 	// we have an MPEG2 bitstream
> 	if ((Data[pes+3]>=0xE0)&&(Data[pes+3]<=0xEF))
>         myDevice->PlayVideo(inbuf_ptr+es_start,es_len);
>       else if ((Data[pes+3]>=0xC0)&&(Data[pes+3]<=0xCF))
>         myDevice->PlayAudio(inbuf_ptr+es_start,es_len);
>     }
>   }
>   // jump to the next Pes
>   pes +=Data[pes+4]*256+Data[pes+5]+6;
> }
> -----------8<-----------
>
> 2) Do you now if the MPEG Elementary Stream contains PTS and DTS ?

DTS/PTS is contained in the PES header, not the ES.

> 2') Do you know where I can find datasheets about MPEG2 Elementary Streams
> ?
>
> 3) Why did you add a ringBuffer for the video part in SoftDevice 0.0.4?
>
>
> Thank you
>
> Philippe
>

The PES header is specified in a iso-13181 spec. It was inofficially available 
on the net, if you are interested.

>
> PES Reminder
> -----------8<-----------
> PES header :
> Byte -> Value
>   00 -> 0x00
>   01 -> 0x00
>   02 -> 0x01
>   03 -> 0xE0 <-> 0xEF
>   04 -> LenHi
>   05 -> LenLow Len = buf[04]*256+ buf[05]
>   06 -> buf[06]&0xC0 == 0x80 -> Mpeg2
>     07 -> Flags PTS|DTS|ESCR|ESRATE|DSM|COPY|CRC|EXTENSION
>     08 -> Optional Header Length -> Header = buf[08]+9
> .....
> .....
> -----------8<-----------



-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index