Tuesday, January 6, 2026

termux android: split video using ffmpeg into smaller size

Requirement:

Install termux from 

  • play store 
  • github.com/termux/termux-app latest but require allow install from unknown source

open termux and update

$ pkg upgrade

install ffmpeg

$ pkg install ffmpeg

Allow termux to manage files

$ termux-setup-storage

 Target

  • every piece has 1 minutes 58 seconds
  • resolution low 480
  • output h264
  • sound mono

command to convert '172967815750944 (1).mp4'

$ ffmpeg -i 172967815750944\ \(1\).mp4 -vf scale=-2:480 -r 25 -c:v libx264 -preset veryfast -crf 28 -ac 1 -c:a aac -b:a 96k -f segment -segment_time 118 -reset_timestamps 1 out_%03d.mp4

this command will create files with name startwing with out_[number].mp4

You can see the files from other applications e.g. photos, files, etc. move it to Movies or Download folder

$ mv out_*.mp4 /storage/emulated/0/Movies/

This is fastest way to split video into smaller size, but you need to write the long command..