Home » Android » android – Encoding video to support multiple screens

android – Encoding video to support multiple screens

Posted by: admin May 14, 2020 Leave a comment

Questions:

I am using ffmpeg to encode videos with H264-AVC codec and MPEG-4 container.

From now, I have always been trying to make the same effort for videos than for drawables: providing the proper resolution for each kind of devices.

That’s why I used to add videos in raw-mdpi / raw-hdpi / raw-xhdpi folders respectively with resolutions 240×320 / 480×800 / 720×1280.

I was thinking to be right, until I discovered videos encoded in 480×800 (located in my raw-hdpi folder) were unsupported on Nexus S (for this device, I need to use 480×720).

Reading http://developer.android.com/guide/practices/screens_support.html#range, I thought the solution was rather to use raw-normal / raw-large / raw-xlarge folders with minimum resolutions: 320×470 / 480×640 / 720×960. But then i saw that most of my HDPI devices where using videos in the raw-normal folder.

So I think I am totally misunderstanding the proper way to do, that’s why I would really appreciate some explanations, and most of all, your practices with video encoding: do you
only provide videos with the minimum resolution to be certain to support all devices, or the “proper” resolution for each kind of devices?

How to&Answers: