Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reencoding while preserving original FPS #37

Open
vpenades opened this issue Feb 27, 2023 · 0 comments
Open

Reencoding while preserving original FPS #37

vpenades opened this issue Feb 27, 2023 · 0 comments

Comments

@vpenades
Copy link

vpenades commented Feb 27, 2023

Something I've tried several times with FFmpeg.AutoGen, and failed to do, is to be able to process a source file, while preserving as much from the original file as possible.

What I want to do is something like this:

ProcessFrames("source.mp4", "destination.mp4",  _singleFrameProcessor);

void _singleFrameProcessor(int width, int height, int stride, string pixelFormat, Byte[] pixels)
{
    // draw some text over the image, apply denoise filter, whatever.
}

And I would like to do so while preserving the original FPS and audio stream.

The example you have has a fixed 25 fps and it is not specified how to get the fps from the original video.

Also, I am not sure if setting the target FPS is the right approach, and what would be required is to set AVFrame.pts, AVFrame.pkt_dts and AVFrame.time_base to match the original frame time from the source file... but I tried to do so and the video was a complete mess.

So, any ideas on how to address this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant