    MPEG SDK --> MpegAnalyzer

class MpegAnalyzer

An MpegAnalyzer analyzes an MPEG video for events and transitions.

The sensitivity of the analysis can be controlled by setting the sensitivity of the algorithms between 0.0 and 1.0 for least to highest sensitivity.

The Clip resulting from the analyze() function contains location and type of each transition or event detected. This clip can be summarized with the function summarizeClip() into a FrameList which contains one frame per point of interest. The summarizing process can be controlled by setting attributes to remove black frames, frames that are too close together, etc.

FrameList's can be saved as a HTML file that shows thumbnail images for each frame in the list. The attributes of the HTML file can be set using the setHTMLAttributes function. Attributes include number of columns, thumbnail size, title, description and footer.

Source:
  MpegAnalyzer.h:63

##

MpegAnalyzer
  [public] Constructor. Construct an MpegAnalyzer for the specified file.
~MpegAnalyzer
  [public] Destructor.

##

analyze
  [public] Perform the analysis of the frames within the video segment specified by the Clip for the current file. If Clip already contains results from previous analysis, the new results will be concatenated with the old ones.
getSensitivity
  [public] Return the current sensitivity setting for the analyzer.
howBlack
  [public] Returns how black a frame is.
isBlack
  [public] Determine whether a frame is black.
saveToHTML
  [public] Save the FrameList to a HTML format. The HTML page contains thumbnail images of all the frames in the FrameList.
setHTMLAttributes
  [public] Set HTML page summary attributes.
setSensitivity
  [public] Set the sensitivity of the algorithm. Sensitivity values range between 0 and 1. [0..1].
setSummaryAttributes
  [public] Set Clip summary attributes.
summarizeClip
  [public] Convert a clip into a frame list by using the middle frame of each transition, and the first and last frame of each event in the clip. These frames are then culled according to the SummaryAttributes.

  If a MIN_DIST or MAX_DIST distance between frames is given, then

       if frame[i+1] - frame[i] < min_dist => frame[i+1] is removed

##

MpegAnalyzer

    public MpegAnalyzer ( string filename ) ;

Constructor. Construct an MpegAnalyzer for the specified file.

MpegAnalyzer

    public ~ MpegAnalyzer ( ) ;

Destructor.

##

setSensitivity

    public void setSensitivity ( float sensitivity ) ;

Set the sensitivity of the algorithm. Sensitivity values range between 0 and 1. [0..1].

getSensitivity

    public float getSensitivity ( ) const ;

Return the current sensitivity setting for the analyzer.

analyze

    public void analyze ( Clip & clip ,
                          unsigned int types = VSegType :: CUT ,
                          Clip :: CallBack cb = 0 ,
                          void * clientData = 0 ) ;

Perform the analysis of the frames within the video segment specified by the Clip for the current file. If Clip already contains results from previous analysis, the new results will be concatenated with the old ones.

One or more transition/event type can be detected by or'ing the corresponding VSegType, e.g.

     analyze(clip, VSegType::CUT | VSegType::DISSOLVE);

  Parameters:

    clip | specifies the start and end frame to search
    types | what type of transition or events to search for

isBlack

    public bool isBlack ( int frame ,
                          float threshold = 0 . 20) ) ;

Determine whether a frame is black.

A frame is black if the maximum pixel value is below the specified threshold and the contrast is also low.

  Parameters:

    threshold | a value between 0.0 and 1.0

howBlack

    public float howBlack ( int frame ) ;

Returns how black a frame is.

How black is calculated on the maximum pixel value and the contrast level.

Returns a value between 0.0 and 1.0

setSummaryAttributes

    public bool setSummaryAttributes ( SummaryAttribute attr ,
                                       string param = "" ) ;

Set Clip summary attributes.

summarizeClip

    public void summarizeClip ( const Clip & clip ,
                                FrameList & frame_list ,
                                Clip :: CallBack cb = 0 ,
                                void * clientData = 0 ) ;

Convert a clip into a frame list by using the middle frame of each transition, and the first and last frame of each event in the clip. These frames are then culled according to the SummaryAttributes.

If a MIN_DIST or MAX_DIST distance between frames is given, then

     if frame[i+1] - frame[i] < min_dist => frame[i+1] is removed

    if frame[i+1] - frame[i] > max_dist + min_dist =>
     frame (frame[i] + max_dist) is added.

If REMOVE_BLACK is specified, then frames of the given percentage black are removed.

If REMOVE_SIMILAR is specified, then if adjacent frames are sufficiently similar, the later frame is removed.

setHTMLAttributes

    public bool setHTMLAttributes ( HTMLAttribute attr ,
                                    string param = "" ) ;

Set HTML page summary attributes.

saveToHTML

    public void saveToHTML ( const char * pathname ,
                             const FrameList & list ,
                             Clip :: CallBack cb = 0 ,
                             void * clientData = 0 ) ;

Save the FrameList to a HTML format. The HTML page contains thumbnail images of all the frames in the FrameList.

  Parameters:

    pathname | is the complete pathname of the html file
    list | is the FrameList of frames to store.
    callback | function, returns percentage complete as int.
    clientData | data to pass to cb

This documentation was generated automatically by the ccdoc tool (version 0.7a).
Click here to submit a bug report or feature request.

Click here to return to the top of the page.