Skip to content

Changing MP4 fpsΒ #93

@HighOnLemonz

Description

@HighOnLemonz

Hello,
I wish to change the fps of a local MP4 to a desired value between 10-60. The video is recorded in 60 fps so that is the default.

Code is simple:

FFmpegFileSource mediaFileSource = new(streamPath, true, null);
mediaFileSource.RestrictFormats(x => x.Codec == VideoCodecsEnum.H264);
_peerConnection.OnVideoFormatsNegotiated += (videoFormat) => mediaFileSource.SetVideoSourceFormat(videoFormat.First());
mediaFileSource.OnVideoSourceEncodedSample += _peerConnection.SendVideo;
mediaFileSource.Start();

I saw an old issue regarding this but it was changing the framerate of a VideoTestPatternSource. I did not find how to "load" the video in this class to have access to the SetFrameRate() method.

Another idea that came to me was to add code in the OnVideoSourceEncodedSample before SendVideo(). I am not sure of the impact of delaying SendVideo() with regards to the event.

Is there an easier way of doing this?
Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions