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 ffmpegorsudo 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 scaleoption, for example, to scale to 1280x720:ffmpeg -i video.mp4 -vf scale=1280:720 output_720p.mp4. - π Adjust the video bitrate using the
-b:voption, 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