Mailing List archive

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

[vdr] Re: vdr cuts recordings with ugly artifacts at cutting-points



On Wed, Apr 16, 2003 at 05:58:06PM +0000, Stefan Huelswitt wrote:
> On 16 Apr 2003 Sergei Haller <Sergei.Haller@math.uni-giessen.de> wrote:
> > On Wed, 16 Apr 2003, Dr. Werner Fink (DWF) wrote:
> > 
> > DWF> Hmmm ... I'd say its from after the cutIn.
> > DWF> In other words it seems that it looks or better hears like
> > DWF>
> > DWF>                           commercial
> > DWF>  video  ----------------%************%-----------------
> > DWF>  audio  ----------------%--|*********%**|--------------
> > DWF>                         ^            ^
> > DWF>                       cutOut       cutIn
> > 
> > I'm not sure if I got the point, but why not do it this way:
> > 
> >   video  ----------------%***%-----------------
> >   audio  ----------------%--|%**|--------------
> >                           ^^^
> >                           marking those as "broken"
> > 
> > AFAI understood, the driver will skip frames of the "broken" part, but
> > the audio which belongs to the frames before the cutOut will be available.
> 
> The topic "broken link" only applies to video packets and tells
> the decoder to skip some frames.
> This totaly different from the audio packet problem.

You've forgotten the PTS offset between audio and video.
The audio packages between the current video packages do
_not_ belong to the current video but a few video frames
_before_ ...  and the cutter removes all frames (audio
and video) between cutOut and cutIn.

IMHO a simple approach would be something like

          cutAssoc   cutOut        cutIn
            ^          ^            ^ 
video  -----&----------%************%-----------------
audio  -----&----------%--|*********%**|--------------

                       ^^^^
                       PTS offset between video and audio

with an associated point before cutOut (cutAssoc).
Now the cutter shouldn't start with its investigation not
at cutOut but cutAssoc.  To be more exactly after the
I-frame at cutAssoc all start point of all none video frames
should be remembered in an index (reverse stack).

After skipping the video part between cutOut and cutIn
all none video frames after cutIn should be replaced with
audio frames from that stack together with the  PTS offset
delay between cutOut and cutIn upto the point where the
old audio PTS is greater or equal to the first video
I-frame of cutIn.

          cutAssoc   cutOut        cutIn
            ^          ^            ^ 
video  --- -&-- --- -- %** *** **** %--- --- --- --- -
audio     - &  -   -  -%  |  *   *  % *|   -   -   -   -
                                           ^   ^   ^
               |---------------------------|   |   |
                   |---------------------------|   |
                      |----------------------------|

Don't know how many I-frames for 400 ms are required
as backward offset from cutOut, but the PTS offset
between cutIn-video and cutIn-audio should be used to
replace the old audio frames after cutIn with that
before cutOut.


     Comments?

        Werner


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



Home | Main Index | Thread Index