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

How to use decode byte[] of H.264 encoded data in Unity #29

Open
VictorZhanUnity opened this issue May 4, 2022 · 4 comments
Open

How to use decode byte[] of H.264 encoded data in Unity #29

VictorZhanUnity opened this issue May 4, 2022 · 4 comments

Comments

@VictorZhanUnity
Copy link

I receive byte[] of H.264 encoded data from WebSocket, But I don't know how to use FFmpeg to decode it.
Is this possible to decode byte[] of H.264 encoded data in Unity with this library?

I've installed FFmpeg.AutoGen by Nuget in Unity, but don't know how to use it.

@Ruslan-B Ruslan-B transferred this issue from Ruslan-B/FFmpeg.AutoGen May 4, 2022
@Ruslan-B
Copy link
Owner

Ruslan-B commented May 4, 2022

Hi we don't support Unity - and not giving examples for it. In general you have to have C knowledge and system platform knowledge - to use this library. As everything is possible but you need to put some effort from your side - as every scenario is unique.

@Ruslan-B
Copy link
Owner

Ruslan-B commented May 5, 2022

Out of curiosity - why you need FFmpeg in Unity?

@VictorZhanUnity
Copy link
Author

I developing video streamming with Unity, I need ffmpeg to decode and encode video data.
I solved part of decode now, but got memory problem.

@hglee
Copy link

hglee commented May 18, 2022

I'm not using Unity, but you can decode byte stream using custom IO context.

You can do with ffmpeg.avformat_alloc_context(), ffmpeg.avio_alloc_context() and there are many C examples for custom IO context.

You may need to use GCHandle to access managed object from callback.

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

No branches or pull requests

3 participants