# How to Convert Media Files Using FFmpeg and Termux

**URL:** https://www.compsmag.com/blogs/how-to-convert-media-files-using-ffmpeg-and-termux/
**Author:** Ayushi Chauhan
**Published:** 2022-02-21
**Updated:** 2022-02-21
**Categories:** Blogs
**Tags:** Android Guides, Blogs Daily, Google tips and tutorials, guiderobert, Guides and Tutorials, guiding12, How To Guide, How To Guides, Tips, Tricks
**Reading Time:** 3 min

---

This tip is about the how to Convert Media Files Using FFmpeg and Termux. So read this free guide, How to Convert Media Files Using FFmpeg and Termux step by step. If you have query related to same article you may contact us.

## How to Convert Media Files Using FFmpeg and Termux - Guide

Termux is our favorite terminal emulator for Android.  Yesterday we saw how to download any video with Termux.  And today we are going to take a look at How to use it to convert any video on Android with FFmpeg.  There is no real advantage to using Termux over the Android video converting apps you can find on the Google Play Store.  However, using the terminal definitely feels geeky and you can support FFmpeg 100's of video and image formats.  There are no real benefits of using Termux over Video Converter for Android apps that 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.  Thanks again to Gabi Tiplea for providing the source code.  This method should work in conjunction with our previous YouTube dl library.  Then open the Termux app and copy and paste 4 commands in the same order.  Just copy and paste them.  Some commands to load the library will be executed.  wget https://pastebin.com/raw/qBV2u7Ey -O install.sh dos2unix install.sh chmod u + x install.sh ./install.sh

## Convert media files using FFmpeg and Termux

Here's what you need to do to easily convert your media files using FFmpeg and Termux:

### Install the Termux app

[googleplay url=”https://play.google.com/store/apps/details?id=com.termux”/]

### Install the FFmpeg package

Open the Termux app in the launcher.  You will be presented with a console environment.

Enter the following command:

### Enable storage access for Termux

By default, Termux does not have access to Android storage.  To enable storage access, enter the following command in the application console:

### Convert your media files

The above steps only need to be performed once.  After that, you can open the Termux app, browse to the media location and use the FFmpeg command to convert your media files.  For example, let's convert a FLAC audio file found in the music folder on the device's internal shared storage.

To get to the folder, we will give the following command:

The following command will show a list of the files in the music directory:

The following command will convert the file to Ogg format, using the opus codec:

ffmpeg -i myfile.flac -c:a opus myfile.ogg

## Final note

I hope you like the guide How to Convert Media Files Using FFmpeg and Termux. In case if you have any query regards this article you may ask us. Also, please share your love by sharing this article with your friends.

---

*End of Article*