---
title: 'FFmpeg Tutorial for Beginners: Mastering the Command Line'
source: 'https://youtube.com/watch?v=4SduPbaX77Y'
video_id: '4SduPbaX77Y'
date: 2026-06-14
duration_sec: 509
---

# FFmpeg Tutorial for Beginners: Mastering the Command Line

> Source: [FFmpeg Tutorial for Beginners: Mastering the Command Line](https://youtube.com/watch?v=4SduPbaX77Y)

## Summary

FFmpeg is a free, open-source command-line tool for processing audio and video files. It can convert formats, resize video, extract audio, compress media, and apply filters. This tutorial covers basic syntax, common options, and practical examples for video and audio manipulation.

### Key Points

- **What is FFmpeg?** [00:00] — FFmpeg is a free and open-source software project with libraries and programs for handling video, audio, and other multimedia files and streams.
- **Basic Syntax** [00:47] — The command structure is: ffmpeg [global options] [input options] -i input_file [output options] output_file.
- **Common Options** [01:16] — Key options include -i (input file), -f (force format), -y (overwrite), -n (never overwrite), -c:v (video codec), -r (frame rate), -s (frame size), -b:v (video bitrate), -c:a (audio codec), -b:a (audio bitrate), -ar (audio sampling rate), -ac (audio channels), and -an (disable audio).
- **Video Conversion Examples** [03:01] — Convert MP4 to MKV with H.264 and AAC: ffmpeg -i input.mp4 -c:v libx264 -c:a aac output.mkv. Resize to 720p: ffmpeg -i input.mp4 -s 1280x720 -c:a copy output.mp4. Change frame rate to 30 fps: ffmpeg -i input.mp4 -r 30 -c:a copy output.mp4.
- **Advanced Video Operations** [04:06] — Extract clip without re-encoding: ffmpeg -i input.mp4 -ss 00:01:30 -to 00:02:45 -c copy output.mp4. Add watermark: ffmpeg -i input.mp4 -i logo.png -filter_complex overlay=10:10 output.mp4. Create GIF: ffmpeg -i input.mp4 -vf fps=10,scale=320:-1 -t 5 output.gif.
- **Audio Operations** [05:06] — Extract audio to MP3: ffmpeg -i input.mp4 -vn -c:a mp3 -b:a 192k output.mp3. Replace audio track: ffmpeg -i video.mp4 -i audio.mp3 -c:v copy -map 0:v:0 -map 1:a:0 output.mp4. Double volume: ffmpeg -i input.mp4 -filter:a volume=2.0 output.mp4.
- **Streaming and Recording** [06:06] — Stream to RTMP: ffmpeg -i input.mp4 -c:v libx264 -c:a aac -f flv rtmp://server/live/stream. Record screen on Linux: ffmpeg -f x11grab -s 1920x1080 -i :0.0 -r 30 output.mp4. Record webcam on Linux: ffmpeg -f v4l2 -i /dev/video0 -t 60 webcam_capture.mp4.
- **Pro Tips** [07:15] — Use -c copy to avoid re-encoding. Preview with -t 10. Check codecs with ffmpeg -codecs. Reduce verbosity with -hide_banner. Always verify output quality.

### Conclusion

FFmpeg is a versatile tool for multimedia processing. Mastering its command-line options allows efficient conversion, editing, and streaming of audio and video files.

## Transcript

Welcome to the world of
FFmpeg. FFmpeg is a powerful command
line tool used for processing audio and
video files. This tool is a versatile
solution for handling multimedia
files. So what exactly is
FFmpeg? FFmpeg is a free and open-source
software project. It includes a suite of
libraries and programs. It's designed
for handling video, audio, and other
multimedia files and streams. Some of
its key features include the ability to
convert between different file formats,
resize and scale video, extract audio
from video, compress media files, and
even apply filters and
effects. Now, let's dive into the basic
syntax of
FFmpeg. The command structure generally
looks like this. ffmpeg followed by
global options then input options along
with the input file and finally output
options with the desired output file. A
simple example of this would be
ffmpeg
input.mpp4
output.webm. This command converts a
video from mp4 format to webbm format.
Let's explore some common FFmpeg options
for input and output. - I specifies the
input file. - F is used to force a
specific input or output file format. -
Y overwrites output files without asking
for confirmation and -ash N ensures that
output files are never overwritten. When
working with video, - C: V sets the
video codec. - R adjusts the frame rate
specified in hertz.
- S sets the frame size using width by
height or an
abbreviation and -B colon V sets the
video bit
rate. Now let's consider some of the
audio options available in
FFmpeg. Dash C is sets the audio codec.
-ash B cols the audio bit rate dash A R
sets the audio sampling rate dash C sets
the number of audio channels and -ash A
disables audio recording as an example
the command ffmpeg- i
inputmpp4- c
aac-b a 192k output to mp4 converts
audio to the AAC codec at 192 kilobits
per second. Another example,
ffmpeg- i
input.mpp4-vn c ampp3
output.mpp3 extracts audio from a video
into the mp3 format. Finally, the
command ffmpeg-
iinput.wav-
ar44,100-ac2output.wav converts the
audio to 44.1 kohertz stereo audio.
Let's explore some practical video
conversion examples. To convert video
from MP4 to MKV container format using
H.264 video codec and AAC audio codec,
you can use the command
ffmpeg-
input.mpp4- CV
libx264- C AAC output MKV. To resize a
video to 720p resolution, that is
1,280x720 while keeping the original
audio stream unchanged, you can use the
command ffmpeg- i input mp4-
s,280x720- c a copy output mp4. To
change the frame rate of a video to 30
frames per second while preserving the
original audio, use the command
ffmpeg- i
input.mpp4- r30- c a copy
output.mpp4. Let's explore some advanced
video operations.
To extract a clip from 1 minute 30
seconds to 2 minutes 45 seconds from the
input video without re-encoding which
makes it faster. You can use the command
ffmpeg- i input mp4- ss
0001 col
30-2000245- copy output mp4. To add a
watermark such as a logo.png png to the
top left corner of the video positioned
at 1010. You can use the command ffmpeg-
iinput.mpp4-
logo.png-filter complex overlay equals
10 col 10
output.mpp4. To create a GIF from the
first 5 seconds of a video at 10 frames
per second, scale to 320 pixels width,
you can use the command
ffmpeg-input.mpp4-vf
mp4-vf quotes fps= 10 scale equals
320-1
quotes-toutput.gif. Now let's look at
some common audio operations you can
perform with
ffmpeg. To extract audio from a video
file and convert it to MP3 format at 192
kilobits per second bit rate, you can
use the command
ffmpeg- i input
atmpp4-vn c
ampp3-b a 192k output mp3. To replace
the original audio track in a video with
a new audio file, you can use the
command ffmpeg-
iide.mpp4- idio.mpp3. MP3- C col v copy-
mapap 0 col v
0-map 1 col a 0 output mp4 to double the
volume of the audio track in a video
file. You can use the command ffmpeg-
iinput.mpp4-filter col a quotes volume
2.0 quotes
output.mpp4. Let's explore streaming and
recording
functionalities. To stream a video file
to an RTMP server like YouTube or Twitch
using h.264 video and AAC audio, you can
use the command ffmpeg- i input mp4- cv
libx264- c
aac- fvv
rtserver
slive slream. To record the screen on
Linux at 30 frames per second, use the
command
ffmpeg-fx11
grab-s1920x180-0.0-r30output.mpp4. Note
that for Windows, you should use
-fgdigra- desktop instead. To record
from a webcam for 60 seconds on Linux,
you can use the command
ffmpeg-f4l2-
i/dv/
video0-t webcam_captured mp4. On
Windows, use -fdow- i video equals
camera name
instead. Here are some pro tips to
enhance your ffmpeg experience. Use -ash
copy when possible to avoid re-encoding
and save time. Preview commands with
-ash tend to process just the first 10
seconds. Check available codecs with
ffmpeg-codeex. Use dashhide banner to
reduce output
verbosity. Always check the output file
to ensure the desired quality and format
were achieved. For learning resources,
refer to the official documentation at
ffmpeg.org/document.
or/documentation html the ffmpeg wiki at
track.fmpeg.org/wiki the man pages which
can be accessed by typing man ffmpeg in
the terminal and the help command
ffmpeg-h or for specific options
ffmpeg h filter equals scale. Also don't
forget to check community forms and
stack overflow for specific use cases.
If you like this video, hit that like
button and don't forget to
subscribe. Visit codelucky.com for more
such useful content.
[Music]
