Skip to content

AVHWDeviceType and MediaFilterGraph  #28

@ChristopheI

Description

@ChristopheI

I use with success MediaFilterGraph with one or several MediaStream (as Video type) as Inputs
I can use simple or complex filter - here I describe my problem using only one MediaStream as Input.

For example:

  1. scale=400:-2
  2. subtitles=f=c\:\\media\\TOEFLTest.mp4:si=0

When I tried to use an AVHWDeviceType ("d3d11va" to be precise) on MediaDecoder of the MediaStream using the first filter it's working fine
When the second is used it failed on MediaFilterContext.ReadFrame (...) - see code snippet below.

// Get MediaFilterContext according the id specified
var mediaInputFilterContext = _videoFilterGraph.Where(mediaFilterContext => mediaFilterContext.Name == id).FirstOrDefault();
if (mediaInputFilterContext == null)
    return;

// Write frame in the MediaFilterContext
mediaInputFilterContext.WriteFrame(mediaFrame, (int)BufferSrcFlags.KeepRef);

// ReadFrame (if any) from FilterGraph Output
var mediaOutputFilterContext = _videoFilterGraph.Where(mediaFilterContext => mediaFilterContext.NbOutputs == 0 ).FirstOrDefault();
if(mediaOutputFilterContext != null)
    foreach (var filterFrame in mediaOutputFilterContext.ReadFrame()) // => FAILED WITH ERROR -22
        ManageVideoFrame(filterFrame);

I suppose I need to do specific stuff when AVHWDeviceType is used but I really don't know where ...
Could you advise me ?
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions