How can can I convert video in LINUX

Dani AI

Generated

asked how to convert video on Linux. correctly pointed at ffmpeg and noted MKVToolNix; both are useful but serve different needs. The main decision is whether you need a remux (change container without re-encoding) or a transcode (re-encode to a different codec/quality). Remuxing is fast and lossless; transcoding is slower but required for device compatibility or size reduction.

Common ffmpeg workflows (replace filenames as needed):

# remux (no re-encode) — quick and lossless
ffmpeg -i input.avi -c copy output.mkv

# transcode to H.264 + AAC (good compatibility/quality)
ffmpeg -i input.mkv -c:v libx264 -preset slow -crf 20 -c:a aac -b:a 128k output.mp4

# trim a section quickly (test before batch)
ffmpeg -ss 00:01:00 -i input.mp4 -t 00:00:30 -c copy clip.mp4

Practical tips and troubleshooting:

  • If playback devices fail, add -pix_fmt yuv420p and target a suitable profile/level for older players.
  • If ffmpeg reports missing encoders (e.g., libx264 or aac), install a build that includes those codecs or use your distribution’s multimedia repo; some distros ship reduced builds for licensing reasons.
  • Use -crf (roughly 18=visually lossless, 23=reasonable) and -preset (faster->larger, slower->smaller) to balance quality and speed.
  • MKVToolNix is excellent for mkv remuxing, track editing and fast multiplexing but it does not transcode. For simple GUI transcodes consider tools like HandBrake or Avidemux.

Always test with a short clip before converting large libraries, keep original files until you confirm results, and map subtitle/audio tracks explicitly (-map) when you need specific streams.

Recommended Answers

All 3 Replies

Download and use the command-line tool ffmpeg. It can transcode just about any video format into any other. I use it frequently (up to several times a week). It is the best audio/video transcoder that I have found, including ones on Windows and Mac. Go to www.ffmpeg.org for details or to download/install.

http://www.videohelp.com/tools/MKVtoolnix
this is good one too(GUI)
Never used ffmpeg, but mkvtoolnix is really fast

EDIT: actually, i only used to convert to mkv, i dont know about other kinds

hi mate,

This page lists 10 great apps to convert audio && video in Linux
http://bit.ly/ySGqZF

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.