Log in

View Full Version : Useable Android Video encoder


utack
24th April 2021, 00:20
Hi folks,

I am looking for a reasonable Android Video Encoder
It should be offering access to all hardware encoders present in the device, and options to set bitrate
The ones I found on Google Play so far are all crap, using a software encoder or offering zero options
I will gladly pay for such software, if it is a paid one.

Thank you for your suggestions!
utack

StainlessS
24th April 2021, 14:00
I've never tried it, but you might give this a try [FFmpeg Media Encoder]:- https://play.google.com/store/apps/details?id=com.silentlexx.ffmpeggui&hl=en_GB&gl=US

Maybe google "android x264 encoder".

EDIT: This specifically mentions hardware encode,
LiTr: A lightweight video/audio transcoder for Android
Lightweight hardware accelerated video/audio transcoder for Android, or LiTr for short
https://engineering.linkedin.com/blog/2019/litr-a-lightweight-video-audio-transcoder-for-android
It seems to be a programmer API, but maybe if you use the name in searches, you may find something that uses it.

EDIT:
Its on GitHub, only as source code.
Google ""litr" android".

utack
24th April 2021, 19:50
https://engineering.linkedin.com/blog/2019/litr-a-lightweight-video-audio-transcoder-for-android


Thank you, that looks interesting

FranceBB
25th April 2021, 21:11
Keep in mind that the vast majority of devices running Android is ARM and not x86, so don't expect good performances from those poor little CPUs, especially in x264/x265

StainlessS
25th April 2021, 21:47
FaBB, Android x86 also runs on PC [I tried it for a little while].
Android x86:- https://www.android-x86.org/
LineageOS:- https://www.youtube.com/watch?v=yp_5pQZdQIU

FranceBB
26th April 2021, 01:17
I'll give it a shot! ;)

utack
10th May 2021, 21:27
Keep in mind that the vast majority of devices running Android is ARM and not x86, so don't expect good performances from those poor little CPUs, especially in x264/x265

Don't underestimate them, a x264 medium 4K->720p encode can run at about 15fps and that is certainly worth it to send out a few good quality videos in Whatsapp every now and then
On an Iphone it can probably do 1080p30 in realtime

StainlessS
11th May 2021, 01:06
Here an old 2018 phone,
Sony Xperia XZ2 Premium:- https://www.gsmarena.com/sony_xperia_xz2_premium-9166.php


Sony Xperia XZ2 Premium

Platform
OS Android 8.0 (Oreo), upgradable to Android 10
Chipset Qualcomm SDM845 Snapdragon 845 (10 nm)
CPU Octa-core (4x2.7 GHz Kryo 385 Gold & 4x1.7 GHz Kryo 385 Silver)
GPU Adreno 630

Memory
Card slot microSDXC (uses shared SIM slot) - dual SIM model only
Internal 64GB 6GB RAM
UFS 2.1

Display
Type IPS LCD, HDR10
Size 5.8 inches, 91.5 cm2 (~72.4% screen-to-body ratio)
Resolution 3840 x 2160 pixels, 16:9 ratio (~765 ppi density)
Protection Corning Gorilla Glass 5
Triluminos display
X-Reality Engine

Main Camera
Dual 19 MP, f/1.8, 25mm (wide), 1/2.3", 1.22µm, predictive PDAF, Laser AF
12 MP B/W, f/1.6, 1/2.3", 1.55µm, predictive PDAF
Features LED flash, panorama, HDR
Video 4K@30fps, 1080p@30/60fps (5-axis gyro-EIS), 1080p@960fps, HDR

I've been thinking about getting one of those for a while now [I've got an old Xperia Z2],
I like its screen size and resolution, and as the Z2 X-Reality Engine is pretty damn impressive, I guessin the
XZ2 Premium is gonna be great.
If the phone can shoot 4K @ 30FPS, & 1080p @ 60 FPS 5-axis stabilized, & 1080p @ 960fps,
its gorra be a bit tasty at simple encode. [3 year old phone, current ones gotta be even more flavoursome].

EDIT: Oh, and its 16:9 aspect ratio display too, big plus point for me.

FranceBB
11th May 2021, 05:23
I have been using a Google Pixel 5 since November 2020 and it actually can encode in UHD 60p H.265 100 Mbit/s in LogV2 or just the plain old BT709 SDR or even BT601 SDR (yes BT 601 in 4K, I don't even know why they're supporting this). My worse surprise of this phone was the very bad performance of the sensor in terms of dynamic range and also the lack of BT2020 support and the lack of 10bit support (8bit only). Of course it has an H.264 legacy mode as well, but I rarely use it. For pictures it's fine, mostly 'cause Google filters out the crap out of your pictures even during the night with lots of noise and I gotta say that most of the times it does a better job than me and I like it 'cause I don't have to bother opening Avisynth or Adobe Lightroom and Photoshop, but some other times it's overfiltered, but it also allows me to save the raw log lossless dng output from the camera so I'm ok with it.

Anyway about ARM encoding I thought it was done by some sort of ASIC a bit like when we encode on Intel CPU/GPU via Intel VAAPI/Quick Sync, which is why I thought they were not going to be that good on plain x264 CPU encoding.
That and the fact that they're all passive devices and I don't wanna make them extremely hot...

StainlessS
11th May 2021, 15:39
h265 [EDIT: soft encode]
Conclusion

If you want to use your spare Android or iPhone for H.265 video encoding, forget about it! It is painstakingly slow.
Apparently, forget about h265 encode on ARM:-
https://quanticdev.com/articles/h265-encoding-on-arm-cpus/

Clip on Youtube [ How Fast is H.265/HEVC Software Encoding on ARM CPUs (iPhone/Android) With FFmpeg?] :- https://www.youtube.com/watch?v=UZCKD-zcrfU
See the YT comments,
D9 thread [EDIT: post] mentioned in comments:- https://forum.doom9.org/showthread.php?p=1817880#post1817880

Google "android x265 hardware encoder"
https://www.google.co.uk/search?q=android+x265+hardware+encoder&source=hp&ei=TY6aYL3NAoqulwSeiZLoCA&iflsig=AINFCbYAAAAAYJqcXSOC2Kni9dKCxS7fmgXKb_zLYiAo&oq=android+x265+hardware+encoder&gs_lcp=Cgdnd3Mtd2l6EAM6AggpOggIABDqAhCPAToGCAAQFhAeOgQIABAeUJwHWMo7YOA9aAFwAHgAgAHcA4gB2Q2SAQk1LjUuMS4wLjGYAQCgAQKgAQGqAQdnd3Mtd2l6sAEK&sclient=gws-wiz&ved=0ahUKEwj9p9yu5cHwAhUK14UKHZ6EBI0Q4dUDCAg&uact=5

EDIT: There is apparently almost no development going on for ARM processor, thats why so slow.

Bello
20th May 2021, 08:55
Don't underestimate them, a x264 medium 4K->720p encode can run at about 15fps and that is certainly worth it to send out a few good quality videos in GBWhatsapp (https://gbapps.net/gbwhatsapp-apk/) every now and then
On an Iphone it can probably do 1080p30 in realtime

I would say its probably good enough for small tasks but mobile apps will never be able to beat a full desktop machine and the use of a keyboard and mouse with a large monitor IMHO

rin
4th July 2023, 07:04
I would say its probably good enough for small tasks but mobile app (https://www.avoid.uk.net/fouad-whatsapp/) will never be able to beat a full desktop machine and the use of a keyboard and mouse with a large monitor IMHO

You are right mobile apps and mobile as a whole can never compete sadly.