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

MotionExtractor module bug fix #267

Merged
merged 7 commits into from
Aug 24, 2023
8 changes: 4 additions & 4 deletions base/src/MotionVectorExtractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ int DetailFfmpeg::decodeAndGetMotionVectors(AVPacket* pkt, frame_container& fram
{
DrawingOverlay drawingOverlay;
drawingOverlay.add(&compositeOverlay);

outFrame = makeFrameWithPinId(sideData->size, motionVectorPinId);
memcpy(outFrame->data(), sideData->data, sideData->size);
auto serializedSize = drawingOverlay.mGetSerializeSize();
outFrame = makeFrameWithPinId(serializedSize, motionVectorPinId);
memcpy(outFrame->data(), sideData->data, serializedSize);
drawingOverlay.serialize(outFrame);
frames.insert(make_pair(motionVectorPinId, outFrame));
}
Expand Down Expand Up @@ -284,7 +284,7 @@ void DetailOpenH264::getMotionVectors(frame_container& frames, frame_sp& outFram
{
DrawingOverlay drawingOverlay;
drawingOverlay.add(&compositeOverlay);
auto mvSize = static_cast<size_t>(mMotionVectorSize);
auto mvSize = drawingOverlay.mGetSerializeSize();
outFrame = makeframe(outFrame, mvSize, motionVectorPinId);
drawingOverlay.serialize(outFrame);
frames.insert(make_pair(motionVectorPinId, outFrame));
Expand Down
Loading