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

arm hardware acceleration / NEON (libx264) #395

Open
strarsis opened this issue Aug 2, 2024 · 4 comments
Open

arm hardware acceleration / NEON (libx264) #395

strarsis opened this issue Aug 2, 2024 · 4 comments

Comments

@strarsis
Copy link

strarsis commented Aug 2, 2024

The current ffmpeg build (from this repository) runs with 30fps on a relatively low-powered ARM Linux system, but with ultrafast preset. Any preset below ultrafast results in much lower fps. How can I find out whether the ffmpeg build indeed uses the arm processor hardware acceleration and NEON for H.264 re-encoding?

Edit: Under /proc/cpuinfo asimd is listed, which should be the same as neon, just the older name for it.

ffmpeg -buildconf does not list --enable-neon flag.

@BtbN
Copy link
Owner

BtbN commented Aug 2, 2024

You'd have to check with x264 folks what kind of acceleration it has for your arch.
30 fps sounds pretty good for software encoding on a potato-class device.
There is no point in explicitly passing enable for that, stuff like that is enabled by default.

@strarsis
Copy link
Author

strarsis commented Aug 2, 2024

@BtbN: Well, before you posted the comment, I manually built ffmpeg on that system, with NEON support explicitly enabled, and indeed, the performance was the same (30fps with ultrafast, 3 to 4 fps with superfast, one step below) as with this ffmpeg build.

My expectations with using ARM/NEON had been a bit higher. In fact, I have really hoped that even a 2-core ARM CPU with NEON extensions allows the realtime re-encoding of a 2K H.264 stream (its flaky data necessitating a re-encode). I think I avoided this workaround now by updating the firmware of the stream source and some changes to the protocol and video-copy settings used.

@BtbN
Copy link
Owner

BtbN commented Aug 2, 2024

Not sure what specific device you got there, but even the latest Raspberry Pis will struggle with any kind of advanced software encoding.
Those CPUs are incredibly low power and thus pretty dang slow.

@strarsis
Copy link
Author

strarsis commented Aug 3, 2024

In this case it is an Amazon EC2 t4g.nano instance (Graviton ARM CPU):
https://aws.amazon.com/blogs/opensource/optimized-video-encoding-with-ffmpeg-on-aws-graviton-processors/
The graphs and such look great (notably under the section Live stream encoding), but now I think that nano
is a little too small of an SKU for this – or I missed something crucial.

The ffmpeg binary from this repository was installed by following these instructions:
https://arthurpello.medium.com/how-to-install-ffmpeg-on-aws-arm-amazon-linux-2023-graviton-c4bc092260bf

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

2 participants