Skip to content

Fix video filters #324

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

Merged
merged 2 commits into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/AvTranscoder/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#define AVTRANSCODER_VERSION_MAJOR 0
#define AVTRANSCODER_VERSION_MINOR 15
#define AVTRANSCODER_VERSION_MICRO 4
#define AVTRANSCODER_VERSION_MICRO 5

#include <AvTranscoder/system.hpp>

Expand Down
15 changes: 9 additions & 6 deletions src/AvTranscoder/transcoder/StreamTranscoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,12 +751,6 @@ IOutputStream::EWrappingStatus StreamTranscoder::processTranscode()
_transformedData->allocateData();
}
}
else if(_filterGraph->hasFilters())
{
LOG_DEBUG("Free filtered data") // filled from filter graph sink
av_frame_unref(&_filteredData->getAVFrame());
_filteredData->freeData();
}

// Check decoding status
bool continueProcess = true;
Expand Down Expand Up @@ -811,6 +805,15 @@ IOutputStream::EWrappingStatus StreamTranscoder::processTranscode()
LOG_DEBUG("Encode")
_outputEncoder->encodeFrame(*_transformedData, data);

if(_filterGraph->hasFilters())
{
LOG_DEBUG("Free filtered data") // filled from filter graph sink
if (_filteredData->isVideoFrame()) {
// Do not unref filter audio frame, to avoid reallocating it each time
av_frame_unref(&_filteredData->getAVFrame());
}
_filteredData->freeData();
}
}
else
{
Expand Down