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 h26x decoder support #21

Merged
merged 4 commits into from
Nov 25, 2024
Merged

Conversation

gBillal
Copy link
Collaborator

@gBillal gBillal commented Nov 18, 2024

Hi, thanks for creating this project. I have always wanted something to use for decoding videos without the need to rely on membrane pipelines.

In this PR, I added support for h264/h265 decoders. Unlike vp8 where there's no notion of B frames and to not change the public API of the decoder since the decoder can return multiple frames at the same time, I added a flush/1 function to signals end of stream and get the buffered frames in the decoder.

Copy link
Member

@mickel8 mickel8 left a comment

Choose a reason for hiding this comment

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

Awesome, thanks!

@mickel8 mickel8 merged commit 99facb8 into elixir-webrtc:master Nov 25, 2024
@mickel8
Copy link
Member

mickel8 commented Nov 25, 2024

Released as 0.8.0 :)

@gBillal gBillal deleted the h26x-decoder-support branch November 25, 2024 10:06
@mickel8
Copy link
Member

mickel8 commented Nov 25, 2024

Btw @gBillal, how did you generate h264 and h265 frames? It would be nice to write this down somewhere :P

@gBillal
Copy link
Collaborator Author

gBillal commented Nov 25, 2024

For that I just grabbed the first sample from a valid mp4 file (the famous BigBuck). An easier way to do that is to use ffmpeg

# h264
ffmpeg -i your_mp4_file.mp4 -c:v copy -vframes 1 -f h264 sample.h264

# h265
ffmpeg -i your_mp4_file.mp4 -c:v copy -vframes 1 -f hevc sample.h265

I may add this commands as comment to the tests

@mickel8
Copy link
Member

mickel8 commented Nov 26, 2024

@gBillal Would be awesome!

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