I still use an ultra-old, ultra-cheap Amazon Kindle device for watching videos in bed. Once I side-loaded it with the Google app-store, I have been able to add Youtube, VLC and Firefox - greatly increasing its usefulness.
One thing really old Android devices (and devices in general) need is their video content encoded as H264 to allow for hardware acceleration, as their CPUs are not fast enough to handle this in software at real-time.
I each this with the following:
0001 $ffmpegnvidia \ 0002 -threads 8 -hwaccel cuvid \ 0003 -i "$f" \ 0004 -map 0:v:0 -c:v h264_nvenc \ 0005 -profile:v baseline \ 0006 -pix_fmt yuv420p \ 0007 -preset slow \ 0008 -b:v 500k \ 0009 -maxrate 500k \ 0010 -bufsize 1000k \ 0011 -vf scale=-2:480 \ 0012 -map 0:a:0 -c:a aac \ 0013 -b:a 128k \ 0014 -map 0:s:0 -c:s mov_text \ 0015 "$f.mp4"
Note the following:
$ffmpegnvidia
- I have this variable setup to point to a compiled version of ffmpeg
with GPU acceleration.-threads 8
- Make use of the number of cores you have available on your CPU.-hwaccel cuvid
- This makes use of the GPU for hardware acceleration.-i "$f"
- The input in this case is from the variable $f
.-map 0:v:0
- Map to video destination stream 0, from video source 0 (a safe default).-c:v h264_nvenc
- A H264 hardware acceleration encoding supported by my old Nvidia GPU.-profile:v baseline
- Help older devices decode the video stream by using an old and CPU less-intensive version.-pix_fmt yuv420p
- A relatively safe pixel format from experimentation.-preset slow
- Try and produce something of reasonable quality.-b:v 500k
- Variable bit rate of the video.-maxrate 500k
- A relatively safe video bitrate for 480p video.-bufsize 1000k
- A buffer of sorts whilst processing the video.-vf scale=-2:480
- Scale the content to meet our 480p expectations.-map 0:a:0
- Map the audio to destination 0, from source 0.-c:a aac
- Pick a nice sounding format. Most devices will do the audio encode/decode easily in software if there is no hardware acceleration.-b:a 128k
- A reasonable audio bitrate encoding.-map 0:s:0
- Map the subtitles to destination 0, from source 0.-c:s mov_text
- Copy the software subs if possible."$f.mp4"
- Output name, in this case the input name $f
with a .mp4
slapped on the end. MP4 containers aer typically widely understood as opposed to MKV for older devices.Hopefully that helps somebody out there!