---
title: FFmpeg – Basic Filter Graphs - Best Software Development Team Extension Partner for Nordics
description: Discover how to create and use FFmpeg basic filter graphs for efficient data processing and transformation. Perfect for developers and enthusiasts in multimedia, data analysis, and signal processing.
image: https://www.craftsmensoftware.com/hubfs/Imported_Blog_Media/43_FFmpeg_Basic_Filter_Graphs.webp
---

[Skip to main content](https://www.craftsmensoftware.com/blog/ffmpeg-basic-filter-graphs#main-content)

[![Craftsmen-logo](https://www.craftsmensoftware.com/hs-fs/hubfs/Website%202.png?width=200&height=72&name=Website%202.png) ![Craftsmen-logo](https://www.craftsmensoftware.com/hs-fs/hubfs/Website%202.png?width=200&height=72&name=Website%202.png) ![Craftsmen-logo](https://www.craftsmensoftware.com/hs-fs/hubfs/Website%202.png?width=200&height=72&name=Website%202.png) ![Craftsmen-logo](https://www.craftsmensoftware.com/hs-fs/hubfs/Website%202.png?width=200&height=72&name=Website%202.png)](https://www.craftsmensoftware.com)

- [About us](https://www.craftsmensoftware.com/about-us)
- [Client Stories](https://www.craftsmensoftware.com/client-success-stories)
- [How We Work](https://www.craftsmensoftware.com/how-we-work)
- [Case Study](https://www.craftsmensoftware.com/case-study)
- [Blog](https://www.craftsmensoftware.com/blog)
- [Career](https://careers.craftsmensoftware.com/)

Open main navigation

Close main navigation

- [About us](https://www.craftsmensoftware.com/about-us)
- [Client Stories](https://www.craftsmensoftware.com/client-success-stories)
- [How We Work](https://www.craftsmensoftware.com/how-we-work)
- [Case Study](https://www.craftsmensoftware.com/case-study)
- [Blog](https://www.craftsmensoftware.com/blog)
- [Career](https://careers.craftsmensoftware.com/)
- [Get In Touch](https://www.craftsmensoftware.com/contact-us)

[Get In Touch](https://www.craftsmensoftware.com/contact-us)

## FFmpeg – Basic Filter Graphs

![FFmpeg – Basic Filter Graphs](https://www.craftsmensoftware.com/hs-fs/hubfs/Imported_Blog_Media/43_FFmpeg_Basic_Filter_Graphs.webp?width=1200&height=820&name=43_FFmpeg_Basic_Filter_Graphs.webp)

[FFmpeg](https://www.ffmpeg.org/) – Basic Filter Graphs is considered the Swiss Army knife of video transcoding/streaming. Let’s start with some very basic examples today of what we can do with FFmpeg.

 

## Format conversion

ffmpeg -y -i input.mkv output.mp4 

 Copy

In this simplest example, FFmpeg produces MP4 output from MKV input. -y denotes that we want to overwrite output.mp4 if it already exists. -i marks the input. In addition to these two, FFmpeg supports many other popular multimedia file formats, including MXF, AVI, WAV, M4A, JPG, PNG etc.

## Codec conversion

 ffmpeg -y -i input.mkv -vcodec libx264 -acodec flac output.mkv 

 Copy

 

It is common to use FFmpeg to transcode from one codec to another. Here, we specify the video and audio codecs with -vcodec and -acodec.

## Take only video or audio

 ffmpeg -y -i input.mkv -map 0:v output.mp4  
-map 0:v  
selects the video streams from the first input (we have only one input file here anyway, marked by  
0),  while  
0:a  
means the audio streams.

 Copy

## Resize the video

ffmpeg -y -i input.mkv -filter\_complex scale=720:480 output.mp4

 Copy

 

-filter\_complex can be used to combine many filters together. Filters sit between the input and the output and make some change to the media flowing through them. Here we are using the scale filter and specifying the output width and height.

 

## Clipping

 ffmpeg -y -i input.mkv -ss 30.4 -to 40.15 output.mp4

 Copy

```
 
```

Here, -ss and -to are used to specify the start and end times in seconds.

 

## Snapshot at time

 ffmpeg -y -i input.mkv -ss 2.598 -vframes 1 output.jpg

 Copy

```
 
```

We can give a filename with .jpg extension, and -vframes 1 will tell FFmpeg to produce a single image at the specified time instance.

 

## Thumbnails at interval

 ffmpeg -y -i input.mp4 -filter\_complex "fps=1/5,scale=320:180" thumbnail-%03d.jpg

 Copy

```
 
```

The fps filter is used here to say that we need 1 frame every 5 seconds. We scale it to required dimensions and give a pattern for the thumbnail filename to be numbered as we like.

 

## Extract audio channels

 ffmpeg -y -i input.mxf \\  
-filter\_complex "\[0:a\]asplit=2\[a1\]\[a2\];\[a1\]pan=mono|c0=c0\[ch1\];\[a2\]pan=mono|c0=c1\[ch2\]" \\  
-map \[ch1\] channel\_1.wav \\  
-map \[ch2\] channel\_2.wav

 Copy

```
 
```

Getting slightly complicated now, but the graph image above should make it easier to understand. We first fork the input audio with the asplit filter into two identical branches labeled a1 and a2. Then we connect each of these to pan filters that are each set up to produce one mono channel. The first pan filter will select the first channel (c0) from a1 and the second one will select the second channel (c1)from a2, and we label the outputs from these pan filters ch1 and ch2 respectively. Lastly, we map ch1 and ch2 to produce two separate WAV files.

 

## Complex graphs with shared filters

In this final example, we try to reuse common filters and produce simultaneous outputs in parallel.

 ffmpeg -y -i input.mxf \\  
-filter\_complex "\[0:a\]asplit=2\[a1\]\[a2\];\[a1\]pan=mono|c0=c0\[ch1\];\[a2\]pan=mono|c0=c1\[ch2\]" \\  
-map \[ch1\] channel\_1.wav \\  
-map \[ch2\] channel\_2.wav

 Copy

```
 
```

As shown above, we apply the common operations early in the graph and try to reuse the filters whenever possible. For example, we reuse format, yadifand aresample filters for the HD and SD outputs, but do the scaling for them separately since they require different dimensions. In addition, we do a horizontal flip with hflip for the SD output only, just for fun! On the other hand, the thumbnails share some common filters (deinterlacing with yadif) with the video filters, but then needs fps and scale to adjust the frame rate and size specific to thumbnails only.

 

## Conclusion

FFmpeg supports a vast collection of many other filters which can be combined to implement a lot of advanced requirements. But I hope the above examples are helpful to understand the basics and get started with this versatile and extremely powerful tool. If you are interested to learn more, [here is a short FFmpeg course on Udemy](https://www.udemy.com/course/ffmpeg-the-complete-guide/?referralCode=1B0CDEEB984838103727), with concepts explained with easy diagrams and step-by-step hands-on demo videos with lots of practical use cases and examples.

Happy transcoding!

![Syed Andaleeb Roomy](https://app.hubspot.com/settings/avatar/d41d8cd98f00b204e9800998ecf8427e)

Author: **[Syed Andaleeb Roomy](https://www.craftsmensoftware.com/blog/author/syed-andaleeb-roomy)**  
 10/04/2024

![Hire AI-Native Engineers](https://www.craftsmensoftware.com/hubfs/Z63_3132.webp)

## Hire AI-Native Engineers

[![Book A Strategy Call](https://www.craftsmensoftware.com/hubfs/Book%20A%20Strategy%20Call.svg)](https://www.craftsmensoftware.com/contact-us)

### **About Craftsmen**

[The Team](https://www.craftsmensoftware.com/about-us)

[Our Partnership Model](https://www.craftsmensoftware.com/how-we-work)  
[Career](https://careers.craftsmensoftware.com/)

[FAQ](https://www.craftsmensoftware.com/frequently-asked-questions-faq)  
[Privacy Policy](https://www.craftsmensoftware.com/privacy-policy-best-software-development-company-in-bangladesh) 

[Craftsmen LinkedIn Page](https://linkedin.com/company/craftsmensoftware)   [Craftsmen Facebook Page](https://www.facebook.com/craftsmenltd/)   [Craftsmen Youtube Page](https://www.youtube.com/@craftsmensoftware)

### **Headquarter**

**Craftsmen UK**  
One Sovereign Quay, Bridge End, Leeds, West Yorkshire LS1 4AG United Kingdom 

**Operational Hub

Craftsmen Bangladesh**  
Plot # 316, Lane # 4, DOHS Baridhara,

Dhaka - 1206, Bangladesh

### **Sales & Partnership Offices**

**Craftsmen Norway**  
Kong Oscars gate 66, 68, 5017 Bergen, Norway

**Craftsmen France**  
6 Avenue Pierre Grenier, 92100 Boulogne-Billancourt, Paris, France

### **A Team You Can Trust**

#### [![ISO Certificates New](https://www.craftsmensoftware.com/hs-fs/hubfs/ISO%20Certificates%20New.png?width=300&height=96&name=ISO%20Certificates%20New.png)](https://www.craftsmensoftware.com/trust-centre)

[![glassdoor (1)](https://www.craftsmensoftware.com/hs-fs/hubfs/glassdoor%20(1).png?width=110&height=79&name=glassdoor%20(1).png)](https://www.glassdoor.com/Overview/Working-at-Craftsmen-EI_IE3004266.11,20.htm) [![goodfirms.co](https://www.craftsmensoftware.com/hs-fs/hubfs/goodfirms.co.webp?width=110&height=95&name=goodfirms.co.webp)](https://www.craftsmensoftware.com/blog/craftsmen-thrives-at-goodfirms-by-offering-scalable-robust-software-solutions-developed-with-quality-by-maestros)

 

 © 2026 Craftsmen. All rights reserved.

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Syed Andaleeb Roomy",
    "url" : "https://www.craftsmensoftware.com/blog/author/syed-andaleeb-roomy"
  },
  "dateModified" : "2026-04-30T08:55:55.974Z",
  "datePublished" : "2024-04-09T22:45:00.000Z",
  "headline" : "FFmpeg – Basic Filter Graphs - Best Software Development Team Extension Partner for Nordics",
  "image" : [ "https://www.craftsmensoftware.com/hubfs/Imported_Blog_Media/43_FFmpeg_Basic_Filter_Graphs.webp" ],
  "mainEntityOfPage" : {
    "@id" : "https://www.craftsmensoftware.com/blog/ffmpeg-basic-filter-graphs",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://www.craftsmensoftware.com/hubfs/Craftsmen%20Logo_Black.png"
    },
    "name" : "Craftsmen Ltd."
  }
}
```

```json
{
  "@context" : "https://schema.org",
  "@type" : "SoftwareCompany",
  "address" : [ {
    "@type" : "PostalAddress",
    "addressCountry" : "Norway",
    "addressLocality" : "Oslo"
  }, {
    "@type" : "PostalAddress",
    "addressCountry" : "United Kingdom",
    "addressLocality" : "London"
  }, {
    "@type" : "PostalAddress",
    "addressCountry" : "France",
    "addressLocality" : "Paris"
  }, {
    "@type" : "PostalAddress",
    "addressCountry" : "United States",
    "addressLocality" : "New York"
  }, {
    "@type" : "PostalAddress",
    "addressCountry" : "Bangladesh",
    "addressLocality" : "Dhaka"
  } ],
  "areaServed" : [ {
    "@type" : "Country",
    "name" : "Norway"
  }, {
    "@type" : "Country",
    "name" : "Sweden"
  }, {
    "@type" : "Country",
    "name" : "United Kingdom"
  }, {
    "@type" : "Country",
    "name" : "France"
  }, {
    "@type" : "Country",
    "name" : "United States"
  }, {
    "@type" : "Country",
    "name" : "Bangladesh"
  } ],
  "description" : "Trusted AI-native engineering partner providing software team extension, IT staff augmentation, and dedicated developer teams globally.",
  "logo" : "https://www.craftsmensoftware.com/hubfs/logo.png",
  "name" : "Craftsmen Software",
  "url" : "https://www.craftsmensoftware.com"
}
```