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

Small video-related refactor #7660

Merged
merged 7 commits into from
Oct 10, 2024
Merged

Small video-related refactor #7660

merged 7 commits into from
Oct 10, 2024

Conversation

emilk
Copy link
Member

@emilk emilk commented Oct 9, 2024

What

Some small improvements in service of coming ffmpeg stuff

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!
  • If have noted any breaking changes to the log API in CHANGELOG.md and the migration guide

To run all checks from main, comment on the PR with @rerun-bot full-check.

@emilk emilk added 🚜 refactor Change the code, not the functionality exclude from changelog PRs with this won't show up in CHANGELOG.md 🎞️ video labels Oct 9, 2024
@emilk emilk changed the title Refactor frames example to use sync decoder Small video-related refactor Oct 9, 2024
@@ -55,5 +60,6 @@ pub struct Frame {
}

pub enum PixelFormat {
Rgb8Unorm,
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the FFMPEG output

Copy link
Member

Choose a reason for hiding this comment

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

it doesn't have to be though, we can choose that fairly freely, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not completely freely. We can pcik rgb24, but not rgba32, for instance

Copy link
Member Author

Choose a reason for hiding this comment

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

We can pick some yuv formats for sure, but we didn't have GPU support for that when I wrote this code.

@Wumpf Wumpf self-requested a review October 9, 2024 16:18
@@ -174,6 +175,9 @@ impl GroupOfPictures {
/// A single sample in a video.
#[derive(Debug, Clone)]
pub struct Sample {
/// The start of a new [`GroupOfPictures`]?
Copy link
Member

Choose a reason for hiding this comment

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

why the question mark? That is how we defined them, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the question the boolean answers

@@ -55,5 +60,6 @@ pub struct Frame {
}

pub enum PixelFormat {
Rgb8Unorm,
Copy link
Member

Choose a reason for hiding this comment

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

it doesn't have to be though, we can choose that fairly freely, no?

return copy_video_frame_to_texture(
queue,
&Frame {
data: crate::pad_rgb_to_rgba(&frame.data, 255_u8),
Copy link
Member

Choose a reason for hiding this comment

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

I'd be a lot happier if this goes through texture manager's format conversions that landed on main now because that's what is going to happen with AV1 output now

Copy link
Member Author

@emilk emilk Oct 10, 2024

Choose a reason for hiding this comment

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

Of course - that's part of #7608. But that's a much bigger PR than this one.

@emilk emilk merged commit d66ce14 into main Oct 10, 2024
34 checks passed
@emilk emilk deleted the emilk/decoder-async-refactor branch October 10, 2024 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude from changelog PRs with this won't show up in CHANGELOG.md 🚜 refactor Change the code, not the functionality 🎞️ video
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants