Mailing List archive

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

[linux-dvb] Re: vbv delay/buffer overflows on VBR statmux



Gregor Lawatscheck wrote:
> At 18:20 20/05/2003, you wrote:
> Over here the real / average bitrate of the VBR stream is something
> like 3676000 (9190 * 400) bps. As Wiljo explains in PVAstrumento's
> help file, broadcasters mostly set the bitrate in the seqeunce header
> to the maximum for the stream. In the case of BBC-2 for example I'm
> sure I've seen bitrates of up to 12 Mbit on single frames though
> (unless analyze showed the wrong values). Maybe they set  it to the
> highest bitrate that can occur between one sequence header and the
> next?

According to ISO18318-2:
'In all cases (both constant and variable bitrate operation) the 
bitrate specified shall be the upper bound of the rate at which the
coded data is supplied to the input of the VBV.'

> Very interesting - BBC-1 which has always been *the* stable channel
> on the mux with the new drivers/firmware uses exactly 15 Mbit as a
> value. It all makes sense - even why demuxing the stream in transfer
> mode seem to work really well in succession on some scenes but not at
> all on others.
>
> >Then I modified pes_play() to patch the bitrate in the sequence
> > header and the RTL recording plays flawless...
>
> Oliver, could you please post this patch to the list? We both know
> this needs fixing in the firmware but I'm sure quite a few people
> would like a temporary fix to a problem that's been haunting them
> especially with DVB-T and av7110s to demux ever since the new
> firmware in early in 2002. After all it doesn't alter the recordings
> itself only the output to the av7110.

Ok, here it is:

--- /home/endriss/cvs-work/DVB/driver/av7110/av7110.c	Sat May 17 05:12:30 2003
+++ av7110.c	Tue May 20 21:09:24 2003
@@ -1116,6 +1116,8 @@ pes_play(void *dest, ring_buffer_t *buf,
         int len, split=0;
         u32 sync;
         u16 blen;
+        int i;
+        unsigned char *p;
 
         dprintk ("function : %s\n", __FUNCTION__);
         if (!dlen) {
@@ -1165,6 +1167,20 @@ pes_play(void *dest, ring_buffer_t *buf,
         
         dprintk ("function: %s pread=%08x pwrite=%08x\n", __FUNCTION__,
                 buf->pread, buf->pwrite);
+
+        p = dest;
+        for (i = 6; i < ((int)blen)-10; i++) {
+                if (p[i] || p[i+1] || p[i+2] != 1)
+                        continue;
+		
+                if (p[i+3] == 0xb3) {
+                        //printk ("seq: bit_rate %.2x %.2x %.2x\n", p[i+8], p[i+9], p[i+10]);
+                        p[i+8] = 0x24; // 15 MBit/s
+                        p[i+9] = 0x9f;
+                        i += 11;
+                }
+        }
+
         wake_up(&buf->queue);
         return blen;
 }


It simply patches the bit_rate in the sequence header to 15 MBit.
Works fine here.

Oliver


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



Home | Main Index | Thread Index