microsoft / microsoft/FFmpegInterop

CreateFFmpegInteropMSS methods will get out of hand if we add a lot more options

Open
#174 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
1.4k
Forks
319
PR merge metrics
No merged PRs in 30d

Description

There are already a whole bunch of parameters already in these methods. I have some new features in mind which would require to add even more parameters. If we continue to evolve the library and add all new options here, we will run into problems, this will be confusing.

I would propose to move to a different initialization model, like this:

var ffmpeg = new FFmpegInteropMSS();
ffmpeg.ForceVideoDecode = false;
ffmpeg.ForceAudioDecode = true;
ffmpeg.AllowMultipleAudioStreams = true;
ffmpeg.CorruptPackageThreshold = 100;
await ffmpeg.OpenStreamAsync(stream);  // this could be async to prevent UI blocking
var mss = ffmpeg.GetMediaStreamSource();

This is more like what you expect from framework WinRT classes.
The old CreateFFmpegInteropMSS could be left for compatibility reasons.

What do you think?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing CreateFFmpegInteropMSS methods and their callers, then review how the listed options are initialized and how OpenStreamAsync and GetMediaStreamSource would fit the proposed lifecycle. Done means providing the new initialization model while retaining the old CreateFFmpegInteropMSS path for compatibility.

Written by the indexing model from the issue text.

Assessment

Domain
api, desktop
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.