Skip to content

Conversation

@Dan-Flores
Copy link
Contributor

No description provided.

@pytorch-bot
Copy link

pytorch-bot bot commented Jan 29, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/meta-pytorch/torchcodec/1213

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 66622e4 with merge base e93fc31 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jan 29, 2026
return std::string("CPU Device Interface.");
}

UniqueAVFrame CpuDeviceInterface::convertTensorToAVFrameForEncoding(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CPU specific encoding implementation is removed from Encoder.cpp and added here.

avFrame = convertTensorToAVFrame(currFrame, i);
}
UniqueAVFrame avFrame = deviceInterface_->convertTensorToAVFrameForEncoding(
currFrame, i, avCodecContext_.get());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Device interface handles both CPU and CUDA, and removes repeated conditionals:
if (frames_.device().is_cuda && deviceInterface_) { ... }

UniqueEncodingAVFormatContext avFormatContext_;
UniqueAVCodecContext avCodecContext_;
AVStream* avStream_ = nullptr;
UniqueSwsContext swsContext_;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This member variable is deleted in favor of the swsContext_ in CpuDeviceInterface.h.

// It is here to isolate CUDA dependencies from CPU builds
// TODO Video-Encoder: Reconsider using video encoding functions in device
// interface
virtual UniqueAVFrame convertCUDATensorToAVFrameForEncoding(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We replace convertCUDATensor... with convertTensor... to integrate into the device interface pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant