leandromoreira / leandromoreira/ffmpeg-libav-tutorial

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

Open
#101 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
11k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

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

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 with the warning output and the copyFrame function shown in the issue, then compare that behavior with 3_transcoding.c. Reproduce the reported transcoding case and determine whether the warning is still present; done means the cause and an appropriate project change are clearly established.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
audio-video-rtc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.