screendirectshowrecordwebmvp8

Not smooth when record the screen using DirectShow with use VP8 encode filter


In GraphEdit, I build a Graph like this:

screen capture recorder --> avi decompressor --> color space converter -->
MainConcept Color Space Converter --> WebM VP8 Encoder Filter -->
WebM Muxer Filter --> file writer

The file size is half of that with mp4, but the video is not smooth enough, eg. when moving the mouse the mouse cursor jumps, when play a video, the video frames jumps very abviously. I think it is because the compression rate is too high, isn't it? How to fix it? I can't find the document about how to work with the filter, is there one?

Thanks.


Solution

  • The topology does not look healthy: three color space converters in a row mean that filter graph had hard time to fit screen capture media type (pixel format) to something accepted by VP8 encoder.

    The problem you have is that either encoder is set to low bitrate mode when quality is seriously degraded, or encoding maxes out CPU and skips frames, or both. Apparently you are interested in balancing that out for the settings to make sense and deliver reasonable output.

    VPB Encoder Filter is set up using IVP8Encoder interface, a definition (and inline comments) of which you can find in source code package, file \IDL\vp8encoder.idl:

    [
       object,
       uuid(ED311151-5211-11DF-94AF-0026B977EEAA),
       helpstring("VP8 Encoder Filter Interface")
    ]
    interface IVP8Encoder : IUnknown
    {
        //ApplySettings
        //
        //The filter maintains a set of encoder configuration values, held
        //in cache.  Any parameters set (using the methods below) are always
        //applied to the cached value, irrespective of the state of the graph.
        //
        //When the graph is started, the filter initializes the VP8 encoder
        //using the cached configuration values.  This is done automatically,
        //as part of the activities associated with transitioning the filter
        //from the stopped state.
        //
        //If the graph has been started, then any parameters set by the user
        //are still applied to the cache (as before).  However, to apply the
        //configuration values in cache to the VP8 encoder, the user must also
        //call ApplySettings.
        //
        //It is harmless to call ApplySettings while the graph is stopped.
    
        HRESULT ApplySettings();
    
        //ResetSettings
        //
        //Sets the configuration values in cache to their defaults, the same
        //as they had when the filter instance was originally created.
    
        HRESULT ResetSettings();
    
        //Deadline
        //
        //Time to spend encoding, in microseconds. (0=infinite)
    
        HRESULT SetDeadline([in] int Deadline);
        HRESULT GetDeadline([out] int* pDeadline);
    
        //ThreadCount
        //
        //For multi-threaded implementations, use no more than this number of
        //threads. The codec may use fewer threads than allowed. The value
        //0 is equivalent to the value 1.
    
        HRESULT SetThreadCount([in] int Threads);
        HRESULT GetThreadCount([out] int* pThreads);
    
        ...
    

    See also: