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

warning messages (forced frame type (5) at 80 was changed to frame type (3)) Solution #101

Open
LentilStew opened this issue Jul 19, 2021 · 1 comment

Comments

@LentilStew
Copy link

I'm making a transcoder and I had a similar issue,
console output
image

I found out, that if you copy the decoded frame to a new AVFrame and free the old frame, this doesn't appear anymore
new console output
image

I didn't make a pull request because I tried running the 3_transcoding.c file on my computer and I didn't see this error in the console, and I also don't know if this fix, is what you are looking for, or if it was already fixed

Now, to be honest, this was harder than I thought it'd be and I had to dig into the FFmpeg command line source code and test it a lot and I think I'm missing something because I had to enforce force-cfr for the h264 to work and I'm still seeing some warning messages like warning messages (forced frame type (5) at 80 was changed to frame type (3)).

C code copyFrame function snippet

int copyFrame(AVFrame* oldFrame, AVFrame* newFrame)
{
	int response;
	newFrame->pts = oldFrame->pts;
	newFrame->format = oldFrame->format;
	newFrame->width = oldFrame->width;
	newFrame->height = oldFrame->height;
	newFrame->channels = oldFrame->channels;
	newFrame->channel_layout = oldFrame->channel_layout;
	newFrame->nb_samples = oldFrame->nb_samples;
	response = av_frame_get_buffer(newFrame, 32);
	if (response != 0)
	{
		return ERROR;
	}
	response = av_frame_copy(newFrame, oldFrame);
	if (response >= 0)
	{
		return ERROR;
	}
	response = av_frame_copy_props(newFrame, oldFrame);
	if (response == NULL)
	{
		return ERROR;
	}
	return 0;
}

I don't have much experience using github, let me know if this is not the correct use for the issues page

@leandromoreira
Copy link
Owner

@LentilStew thanks for sharing, I'll try it later :) (the way I made it disappear, I think was by introducing the keyint parameters)

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

2 participants