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

rkmpp encoder example #203

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

rkmpp encoder example #203

wants to merge 1 commit into from

Conversation

scottlamb
Copy link
Collaborator

No description provided.

@scottlamb scottlamb requested a review from Xaeroxe July 16, 2024 17:24
Copy link
Contributor

@Xaeroxe Xaeroxe left a comment

Choose a reason for hiding this comment

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

Minor issues, none of these are blocking.

Comment on lines +87 to +88
// yuck.
let frame_len = u64::try_from(Frame::new(args.width, args.height, args.pixel_format).data.len()).unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we explain better what is "yuck" and how we can make it less "yuck"?

while let Ok(frame) = raw_frame_rx.recv() {
let pre = Instant::now();
let output = encoder.encode(frame, frame_type).unwrap();
encoding += Instant::now().duration_since(pre);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
encoding += Instant::now().duration_since(pre);
encoding += pre.elapsed();

loop {
let pre = Instant::now();
let output = encoder.flush().unwrap();
encoding += Instant::now().duration_since(pre);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
encoding += Instant::now().duration_since(pre);
encoding += pre.elapsed();

frames_out += 1;
}
drop(encoded_frame_tx);
let total = Instant::now().duration_since(before);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
let total = Instant::now().duration_since(before);
let total = before.elapsed();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants