How to Convert Video on Android with FFmpeg Using Termux.
There are no real advantages to using Termux over the Video Converter for Android apps you can find on the Google Play Store. Although using the terminal definitely looks challenging and you can FFmpeg support hundreds of video and image formats.
Again, thanks to Gabi Tiplea for providing the source code. This method should work in conjunction with our previous YouTube-dl library.
Related: Reduce File Size With This Video Compression App For Android
Follow the steps
1. Go to play store and download termux app.
2. Then open termux application and copy and paste 4 commands in the same order. Just copy and paste them, it will run some commands to load the library. wget https://pastebin.com/raw/qBV2u7Ey -O install.sh dos2unix install.sh chmod u + x install.sh ./install.sh
3. Now go to your file manager and select any video or audio file you want to convert and then share it with Termux app.
4. A pop-up window will open, enter a new file name and extension and click “Change”.
5. Termux will execute a series of commands. Once this is done, you will be prompted to press the Enter key. Do this.
6. Now go to your Android internal memory and find the ConvertedFiles folder, open it and there you will find all the converted files.
In this tutorial, we are only converting a video, but you can also use our code and use it to join two clips, remove audio from a video, etc. Here are all the cool things you can do with FFmpeg. Here’s the code for anyone interested. #! / data / data / com.termux / files / usr / bin / bash # 05/15/2017 Gabi Tiplea echo -e “Updating default packages n” apt update && apt -y upgrade echo -e “Requesting access to storage n “termux-setup-storage sleep 5 echo -e” Install ffmpeg packages n “install -y ffmpeg echo -e” Create bin n directory “mkdir ~ / bin echo -e” Create converted files directory n “mkdir ~ / storage / shared / convertFiles echo -e “Download and install termux-file-editor n” wget http://pastebin.com/raw/JxKNaixQ -O ~ / bin / termux-file-editor dos2unix ~ / bin / termux- file-editor echo -e “Copyright 2017 by Gabi Tiplea” #! / data / data / com.termux / files / usr / bin / bash # 05/15/2017 Gaby Tipley name = $ (echo $ 1 | grep -Eo ‘[^ /] + $’) ffmpeg -i ~ / downloads / ” $ name “~ / storage / shared / convertFiles /” $ name “rm ~ / downloads /” $ name “echo -e” Copyright 2017 Gabi Tiplea n ”