On Sat, 2004-07-10 at 10:00 +0200, Fons van der Beek wrote: > Would it be possible to do the blackframe detection DURING time > shifting?
I've thought a bit about that, and yes, it should be workable.
> This means that timeshift.py a SECOND mplayer proces should be started
> after the first one. But may never read beyond the buffer, it should
> be paused if it reaches the buffer
Yes, that's also how I would do it, however ...
> The "player" instance should reread the EDL file when it is altered,
> thus knowing if there are new markes.
... I would approach it a different way. I don't think the player
instance should use EDL, because then you'd lose the more precise
seeking that the timeshift code provides. I think the best way to do
this is:
1. The timeshift process spawns two MPlayers: one for playback, and
one for blackframe detection (let's call it BFD for
convenience), as you said.
2. The BFD process is controlled by timeshift always to read at the
end of the buffer. It should never need to be paused, because
live tv is, well, live. :) BFD should output to stdout parsable
messages like "BLACK_FRAME=3410" which timeshift process can
parse and remember.
3. When the player reaches a black frame, the controlling
(timeshift) process can tell it to seek to the appropriate place
(either to the next black frame, or end of buffer, whichever is
first), and since timeshift also knows what timestamps are where
in the buffer, seeking will be a lot closer to the mark, since
MPlayer's mpeg seeking is hopeless.
4. Since the timeshift process knows where the commercials are, it
can display this in some way on the interface.
I haven't played with the commercial detection stuff, and in fact I've
never used EDL at all, so the above makes some assumptions as to how it
works. One issue I can think of right away is that there may be some
delay when reacting to a black frame this way. I suppose a new
RINGBUFFER_SET type could be defined to tell MPlayer "pause for further
instructions when you reach frame XXXX."
If you can send me your latest black frame detection patch, I'll see
about working this up.
Cheers,
Jason.
signature.asc
Description: This is a digitally signed message part
