[MPlayer-dev-eng] sharing data between audio and video filters

Douglas Bagnall douglas at paradise.net.nz
Fri Sep 2 07:42:14 CEST 2005


hi,

I'm making a machine that gathers statistical data from a video
stream, then constructs new video from the data.

           (a)        |      (c)
                      |
in --->   extract - - | - - reconstruct  ------> out
          data        |     video
           |          |       ^
           |         (d)      |
           V                  |

          (b) statistical model


OK, for the video channel it is easy to make a filter to do all of a,
b and c (in fact, I have done so; thanks for the nice documentation
and API).  The wall at (d) is to point out that no actual picture data
goes through the filter (though format metadata does).  Anyway, I have a
couple of questions.

Firstly, is there a defined way to separate (a) and (c) into their own
filters, but allow them to share access to the same model (b)?
Sometimes the machine will be absorbing video without output, and at
other times it will be producing output from a previously built up
model, so the two stages are in my mind quite distinct.  Of course,
this could be achieved with filter options, so the question is mainly
one of curiousity.

Secondly, and more importantly, is there a way to extract audio data
from an audio filter and insert it into the same model, ie, share
memory between a video and audio filter?  A diagram, in case it's not
clear:

         _ extract _           ___ reconstruct ___     vf
        /  v. data  \         /      video        \
       /             \       /                     \
in --->               [model]                       }---->  out
       \             /       \                     /
        \_ extract _/         \____reconstruct ___/    af
           a. data                 audio

Obviously I could attach the model in some ad-hoc global place, and
have it live as a tumour upon mplayer as a whole.  But obviously I'd
prefer not.

cheers,

Douglas Bagnall





More information about the MPlayer-dev-eng mailing list