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

Add scaling support to converter and decoder #27

Merged
merged 5 commits into from
Jan 19, 2025

Conversation

gBillal
Copy link
Collaborator

@gBillal gBillal commented Jan 14, 2025

Follow up of #25

lib/video_converter.ex Outdated Show resolved Hide resolved
test/decoder_test.exs Show resolved Hide resolved
test/video_converter_test.exs Show resolved Hide resolved

assert byte_size(ref_frame1) == 480 * 360 * 3
assert byte_size(ref_frame2) == 360 * 240 * 3
end

test "scale video frame", %{frame_480p: frame_480p} do
converter = Xav.VideoConverter.new!(width: 368)
Copy link
Member

Choose a reason for hiding this comment

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

check incorrrect width and height

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should we add validation on the elixir code ? since we don't initialize the converter on creation ffmpeg won't do any validation until you first try to convert a frame.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I would do this. Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

Just this thing and we are ready to merge

lib/decoder.ex Outdated Show resolved Hide resolved
@gBillal
Copy link
Collaborator Author

gBillal commented Jan 19, 2025

@mickel8 since we're raising in the nif on invalid input, I deleted the new!/1 function and made the new/1 returns the converter instead of {:ok, converter}.

@gBillal gBillal requested a review from mickel8 January 19, 2025 18:56
@mickel8 mickel8 merged commit 56253a4 into elixir-webrtc:master Jan 19, 2025
@mickel8
Copy link
Member

mickel8 commented Jan 19, 2025

Thanks!

@mickel8
Copy link
Member

mickel8 commented Jan 19, 2025

@gBillal looks like somethings failes on macos-arm. Do you have any means to check what's wrong? It looks like scaled binary does not match 🤔

@gBillal gBillal deleted the support-scaling branch January 19, 2025 22:33
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