Skip to main content

How to Use FFmpeg on Linux for Video Conversion, Editing, and Audio Extraction

HardReset.InfoJanuary 5, 20269 min294 views
7 connections·12 entities in this video→

Introduction to FFmpeg

  • πŸ’‘ FFmpeg is a powerful command-line tool for converting video and audio formats, changing codecs, resolutions, bitrates, and for cutting/joining video clips.

Installation and Setup

  • πŸ› οΈ Check if FFmpeg is installed by running ffmpeg --version.
  • πŸš€ Install FFmpeg on Debian/Ubuntu-based systems using sudo apt install ffmpeg or sudo snap install ffmpeg.
  • πŸ“ Prepare your input video file and rename it for easier command-line use (e.g., video.mp4).

Basic Video Conversion

  • 🎬 Convert a video from one format to another, such as MP4 to AVI, using the command: ffmpeg -i input.mp4 output.avi.
  • πŸ” After conversion, you can open the new file with a media player like VLC.

Modifying Video Properties

  • πŸ“ Change video resolution by using the -vf scale option, for example, to scale to 1280x720: ffmpeg -i video.mp4 -vf scale=1280:720 output_720p.mp4.
  • πŸ“Š Adjust the video bitrate using the -b:v option, e.g., ffmpeg -i video.mp4 -b:v 1M output_bitrate.mp4.

Cutting Video Segments and Extracting Audio

  • βœ‚οΈ Cut a specific segment from a video by specifying start and end times. For a clip from 20 to 25 seconds: ffmpeg -i video.mp4 -ss 00:00:20 -to 00:00:25 -c copy cut_clip.mp4.
  • 🎧 Extract audio from a video file and save it as an MP3 using: ffmpeg -i video.mp4 output.mp3.
  • ⚠️ Note: Audio extraction will fail if the input video does not contain an audio stream.
Knowledge graph12 entities Β· 7 connections

How they connect

An interactive map of every person, idea, and reference from this conversation. Hover to trace connections, click to explore.

Hover Β· drag to explore
12 entities
Chapters4 moments

Key Moments

Transcript32 segments

Full Transcript

Topics14 themes

What’s Discussed

FFmpegLinuxVideo ConversionCommand LineVideo EditingResolutionBitrateAudio ExtractionMP4AVIMP3Terminal CommandsDebianUbuntu
Smart Objects12 Β· 7 links
ProductsΒ· 4
ConceptsΒ· 7
LocationΒ· 1