FFmpeg in 100 Seconds
Вставка
- Опубліковано 9 лют 2025
- FFmpeg is a legendary multimedia processing tool used to edit audio and video files programmatically. It can covert and transform over 100 different codecs and is integrated into many applications under the hood.
#linux #programming #100SecondsOfCode
💬 Chat with Me on Discord
/ discord
🔗 Resources
FFmpeg Docs ffmpeg.org/
Advanced FFmpeg techniques fireship.io/le...
Gzip in 100 Seconds • gzip file compression ...
Linux in 100 Seconds • Linux in 100 Seconds
🔥 Get More Content - Upgrade to PRO
Upgrade at fireship.io/pro
Use code YT25 for 25% off PRO access
🎨 My Editor Settings
Atom One Dark
vscode-icons
Fira Code Font
🔖 Topics Covered
What is FFmpeg?
FFmpeg tips and tricks
FFmpeg quick start tutorial
Who created FFmpeg?
How do I build my own video editing software? - Наука та технологія
Bellard is *the most* underrated programmer imo. ffmpeg, qemu, tcc and quickjs are all awesome software I discovered independently before realizing they were written by the same guy
Not to mention his π approximation world record in 2009 with TachusPi.
TIL they were all written by the same guy, holy fuck 😳
what the actual fuck.....
@@markzuckerbread1865 damn, surely you've at least heard of qemu, it's an engine for virtual machines.
holy shit the same guy made all of those? dude is the definition of 10x
The cool thing is that it's also so fast you can use it with live footage.
Once I used ffmpeg to rotate my webcam footage by 90°. Worked flawlessly.
Woah. Now that's cool.
I have been wondering how do you stream in the webcam input and make platforms detect the output from ffmpeg as webcam footage? This would be a fun thing for zoom or teams meetings
@@kolupsy On linux you can make ffmpeg output to a virtual webcam via v4l2loopback device, I use it to stream the footage from my laptops webcam to my PC.
There is probably an equivalent for other platforms
That's fast because you don't need to re-encode - you're just setting a flag in the bitstream.
@@kolupsy OBS can do that for you
FFmpeg is so useful in the VFX/CG industry, it's used for converting textures, encoding reviewables from several different outputs, adapting output with stuff like slates and overlay data for client review, subtitles, using FFprobe for capture certain EXR metadata, the list could really go on for paragraphs.
It really tells you something when FFmpeg is far more flexible and useful than Autodesk's RVIO, which costs thousands for licenses and doesn't even have 5% of the functionality of FFmpeg.
Yes, but Autodesk has by far the bigger advertising budget. Telling people how wonderful you are tends to count for more than actually putting out a superior product.
It's because of how (relatively) pretty and easy-to-use RVIO is, compared to ffmpeg.
Don't get me wrong, it's one of the first things I install on my fresh Linux installs, but the CLI interface is not for the faint of heart.
@@jonathanalonso6492 Point-and-click maybe OK for one-off tasks, not so good for things you need to do a hundred times a day. Then you discover that GUIs cannot be automated.
@@lawrencedoliveiro9104 Absolutely, but I was discussing the marketability of GUI-style programs, and why they are more successful, compared to CLI-style programs, at least in the context of the average Joes and Janes.
@@jonathanalonso6492 The successful businesses are the ones that produce quality results. Are you really going to pay for someone to perform a manual process over and over? Automation is what computers are for!
as someone who works with the C api, ffmpeg is the tool I have the strongest love-hate relationship with. The api can be an absolute struggle at times, but it's incredible that we have such a powerful open source tool at our disposal.
I always thought of ffmpeg as purely a command line tool. If I was looking for a library to make applications with, I’d go for GStreamer
All the video editing software today are just wrappers of ffmpeg.
@@christopherneufelt8971 except for the commercial software
I’ve never felt the need to use the C API. One project I did involved extracting telemetry data (accelerometer, gyroscope, GPS) from videos captured from GoPro cameras. I wrote a Python script which called ffprobe to identify the right streams and the exact locations of the data packets and their timestamps, then I could read those parts of the video file directly and decode the packets using the standard “struct” library.
gstreamer is much easier tool for c imo
Video editing aside, I can plug a video in it with zero arguments and it some how comes out with a ~80% smaller file size and no noticeable quality loss. That alone is such a game changer, I've got a right click script for it and everything
i love gd cologne
maybe for the untrained eye it is unnoticeable, but those with more experience will fine tune their settings
@@simulping4371 FFmpeg does a lot of optimizations like removing duplicate frames for example. You can also tell it to use more advanced feature sets of video encoders, giving you even better quality at the same bitrate.
hello square jumper
h g D:
Ffmpeg is one of those tools I just cant live without. I have many aliases set up and they make my life way easier
Mind sharing some examples?
Following this thread in case an answer comes up, quite interested to know how a lambda person can use it
@@zerdf how do you follow a thread?
@@a.yashwanth just by commenting on it
@@zerdfgood idea
ffmpeg is a very hard workhorse that few recognise and the giants abuse by call it theirs. Literarally its coding is everywhere on media players with many times included without even open source acknowledgement. Most of the video editing software around is just recompiled wrappers of this gem. P.S. I did my university project in mpeg long time ago (compression and decompression of bytestream using fft2 and performance analytics).
Is there somewhere I can read more about this?
what grade u got on that project sir?
It's such a complex program that it would take 100 hours to fully explain how to use it, yet 100 seconds can give you enough of the basics to allow most people to use it as they need it on a daily basis. The only thing I would've added is that the order of arguments matter.
True! For example, if you use *_-ss_* and *_-to_* near the beginning of the command, then you're cutting a clip out of the original media file, any further arguments that have a time component to them are applied within the context of that clip. For example, trimming a song down to a ringtone: *_FFMPEG -ss _**_01:00_**_ -to _**_1:45_**_ -i infile.mp3 -af "afade=t=in:ss=0:d=1.5, afade=t=out:st=40:d=5" -c:a libmp3lame -b:a 192k outfile.mp3_* . The fades' start times of 0s and 40s don't occur at 00:00 and 00:40 of the original song, they happen at 00:00 and 00:40 of the clip - therefore 01:00 and 01:40 in the context of the original song.
I use this since I got into Linux in 2008 and I even teach all my friends how to use it. Since all of these Converter Tools are nothing else then FFmpeg with adware.
I remember searching for a decent converter back in the early 2000s, I swear Advertisers were working really hard to push ffmpeg aside for their shit quality software. I didn't find ffmpeg until much later.
I thought they only supplied a front end and used FFmpeg behind the scenes. @@tisaconundrum
Exactly!!!!.
So glad FFMPEG is getting the recognition it deserves. Had been using it since day one and lovin it eversince
Ffmpeg is a blessing. That is the thing that solidified my programming journey at its beginning.
FFMPeg is the goat. our entire company's video infrastructure is relaying on it and it works amazing.
There are so many options is really crazy to think about the work that went into this tool.
it can handle literally anything and i love it for that. the guy who made it is the saviour of media buffs
2:05 Still cracks me up everytime seeing that 'ASS' file, LMAO😂🤣
Google’s Play Store actually banned an app using this library, supposedly for violating the “Sexual Content and Profanity Policy”.
Jajaja
Yeah, so funny.... if you're a 10 year old kid.
@@fdadfas6624 ???
Relax bruh.... im 24. why did i get hate vibes reading this ? 😅😆
Love them asses especially in women 😊
I knew it was powerful but this is just unreal. Thanks as always for the incredible content.
Ffmpeg is one of the most powerful programs i know! I've never seen a program learning Curve similar to it! From the simplest cutting or converting of Videos to gpu based live Resolution encoding for rtmp! Such a powerful tool!!
ffmpeg has saved me literally hours of waiting on my computer to reencode things, it's brilliant for splitting out video and audio, editing the audio, and recombining after the fact. No need for premiere or vegas or resolve (my favorite at the moment, just very bulky when you just need to edit the audio!), just -c:a copy or whatever the flags are and you're off to the races
For that reason you should promote that GNU tool to others.
I found out about ffmpeg 5 years ago when i had to split a movie in two so i can upload it on disks for my grandfather to watch on his entertainment system, i've been in love with it since.
ffmpeg is really good.
I use it to create partially transparent videos (rgb + alpha channel). Those can be imported in basically any video editor. They work in OBS too.
I'm using the codec "qtrle" and output format "mov".
When you also have youtube-dl and put the ffmpeg executable in the same directory, you have the ultimate tool for downloading videos from the internet.
That’s because youtube-dl has certain actions written into it, that will be automatically done by ffmpeg like merging the audio and video file of a downloaded UA-cam video together (since with high-resolution downloads audio and video are two separate files).
I use it for the opposite: extract audio from audio-video files
@@RudxainSame. I'd use it more if it wasn’t so slow though. The UA-cam downloaders on the web are much more efficient
@@hoodb0 I'll try it, thanks for the tip
@@hoodb0use aria2c as external downloader
I have been using ffmpeg for more than 10 years, and I really love ffmpeg.
I've been working on my own project to code a FFMPEG library for personal use. The idea is to essentially create an audio DSP that will take in audio formats / streams and process them to an output. Goal is to make an exec that can run on a raspberry pi and use it like a digital pedal board. Just working on the physical parts now :D
I just got started with ffmpeg libraries 1 week ago to export image sequences instead of multiple images as a single video file
And now you make a video about it xD
I use this to compress my videos on discord, It saves me a lot of time and trips to visiting websites that might track you. I also started using VLC ever since Microsoft changed their groovy app to the media player (they might have added more telemetry). Best decisions I've ever made!
this video is so epic, epic enough to say that it was rendered with ffmpeg premier
Even after using ffmpeg for over 200 hours I find this 100s video so informative.
Ffmpeg is surprisingly well documented too. Made a dirty script in the past that automatically color graded clips based on the folder they were placed in.
Ffmpeg is the only video software that is able to handle dvb subtitles. Thank you for it. Therefore it is the best software for this purpose. Ffmpeg is the best.
ffmpeg is so great.
the level of control it gives you makes you save so much time
This is literally crazy, I just started using FFmpeg and this video comes up from fireship
This really looks like one of the most underrrated and underappreciated softwares created. Everybody uses it but few give the dev its flowers. Shoutout to him!
I'm very pleased that you included the bit about ass files. Lol. At a previous dev job, I worked a lot with video and ffmpeg, and one of the things I worked on was ways to burn-in subtitles into videos, and the fact that everything had to be converted into ass files really tickled me. I still can't believe that "Advanced Substation Alpha" somehow ended up being "ass"
when i wanted to write subtitles i had to pick a format. knowing nothing, i picked .ass because it had some features i wanted and the file extension. later learned it's like the industry standard or something
@@sodiboo it is industry standard but at the same time it's also the least supported subtitle format on TV hardware . . . try finding a TV that can natively play .ass subtitles without relying on another machine to transcode it.
I waited my whole life for this video
As a library, FFmpeg is a godsend for video encoding/decoding. It may seem slightly obtuse, but once you understand how it works, it's incredibly powerful.
wow i didnt even know ffmpeg has a logo
bruh your editing and design just keeps getting better and better 👀💕👏
I'm starting to believe that you are an alien or some sort of AI who found out a way to get out of the computer. I tried hard to learn FFMPEG but I was always confused by what the hell is going on with commands... you explained like its NOTHING! bruh... even toddlers can use your videos and become a developer. any way thank you very much ♥ keep up the great content as always. we really need you! =)
As a toddler who is also a developer I concur.
He just read the API description and exemple, there is nothing special about it you know. What he just showed are really the most basic command of ffmpeg
@@Smirnoff67
Its a good intro, same as ahoy yt channel 'stuart', hes not an actual documentary historian, just a guy who covered fps and old game. And game concept in documentary-like way
Its supprising how good ffmpeg is at converting and compressing even on default settings. Its amazing
FFmpeg is a bit to video what ImageMagick is to images. There is also another audio/video library called GStreamer which I think is a bit like FFmpeg but I guess more oriented towards playback than encoding.
This guy creates shorts even before they existed..... And he gives knowledge too 😀
ffmpeg is what got me into the world of CLI apps by it's sheer usefulness.
FFMPEG is so powerful and ubiquitous that most video players just act as a GUI for it and many video tools in general are just extensions to it.
Danke!
Jesus i actually needed this. I keep seeing it everywhere but have no idea what it is
Props for using a clip of Arnold from the movie Commando, love that movie
I like how this is basically industry standard for multimedia
A yet another tool I didn't know I needed in my NodeJS video/media streaming server...
There's nodejs wrappers for it that people have made too. Good luck with your project! 😃
How did you not come across this when making a video streaming server? I've heard about this and I'm at backend
@@xXZian6Xx Because it's more like half a streaming server half file server.
It has a few editors in the web UI for opening different kids of files, though mainly for media.
Yes but what about the license
I wouldn't mind full 1h course on this
been using it for 6 years,,one of greatest tool to have in pc
I used it in my video editor project recently.
a
Litterally used ffmpeg today. Loving the content!
This is awesome! I used FFmpeg and GStreamer in an old project for streaming HD video from a high altitude balloon.
That sounds awesome! Do you have a public GitHub repository for it? I understand the basics of FFMPEG in the command line, but have never been able to use it in a project.
@@jonasslettingjensen5032 I have a couple private repos that show how we used GStreamer, but I cant seem to find the script that used FFmpeg (I think we booted it up as a separate process to save the file to disk). If you'd like to see the GStreamer code I can share it with you. What's your GH handle?
Currently using FFmpeg in my projects, It is just awesome
I tried to make a video from single frames from my gopro in my editing software. Absolute disaster. With ffmpeg, it took hours to learn how to do it, but minutes to make the file. Brilliant bit of software.
_____ In 100 seconds is the best series on this channel 👍
FFMpeg is awesome. Surely it processed the very video we're watching
Love FFmpeg so much, I was literally just using it yesterday to cut a video into segments. I’ve used it plenty of times to pull high res screenshots from my films. I’m thinking about creating some small tools (possibly both open source and for-profit) around it at some point to just help increase video production productivity.
One of the best open-source projects I use regularly
I did use ffmpeg to automatically remove duplicated frames, merge all videos and audio and create a timelapse-lofi screen recorded video in 1 night using my phone. All of those happening with right label for video and audio file then python automate things with ffmpeg.
Did you use subprocess library in py
FFMPEG is such a cool tool and it can do so many things, most of the time I don't even know what I want to make with it.
Awesome tool. I used it 10 yrs ago to make time-lapse videos from screenshots in games like gta 3 😁
ffmepg is goated for ML work. Super fast batch processing
The legend is back 🎉
This is just what I was searching!
Small nitpick at the command shown at 1:46. If you try to run that command you probably won't get the result you're expecting.
The video will probably not start at the timestamp you specified and it might last under 10 seconds or slightly above 10 seconds. This happens because of how video codecs work, usually you have a keyframe that contains a full image and the following frames until the next keyframe only contain the parts of the image that change.
That's why if you copy the video, ffmpeg has to use those keyframes to make sure you don't get a video file that doesn't play properly.
If you want to solve this you have to actually re-encode the video and ffmpeg will make sure to output exactly what you asked .
This is something i didnt know i needed, epic
ffmpegcos terrific, and so's this video.
I'm off to man to refresh my memory!
ffmpeg is the best tool I have ever used
1:33. 640x480 resolution…. As god intended
Thank you for the FFmpeg intro
best opensource thing i ever encountered
You always publish video at the time that I really need it =))
Fabrice Bellard also create Qemu. Awesome engineer.
What a legend
I hope you cover more of these cli only FLOSS😁😁
I've made a living since 2010 knowing a lot about FFmpeg and working for a major adult tube site. I've donated to the project, but probably should more often.
I didn't know it could do half that stuff, thanks!
this video is so well designed!
ps the *-ss* option is the *start position* option and basically is where you seek to the location to start the media file manipulation.
Hope you have a great day & Safe Travels!
amazing, I had no idea it was this easy to use
Friendship ended with VLC.
Now ffmpeg is my best friend
FFMPEG really rolls off the tongue fluidly
Wow didn't know about the subtitles one, that's dope
i was waiting for this
FFmpeg is just the best
Commando was 100% my favorite movie for some short period of my youth.
I've been learning ffmpeg over the past few months. It's so incredibly useful. I used to re-encode using things like Handbrake or re-render them with Vegas or something, but no longer am I a slave to the GUI :P
Pretty sure HandBrake is also just an ffmpeg wrapper
Never knew about ffplay before.. thanks
Baking subtitles into a video file should be a crime
fr
wow I had no idea this existed this is a very powerful tool
I never knew how cool ffmpeg was!
Great info on the subject brother!
I just had to use ffmpeg today to convert a raw file into a MP4 file, it's so strange that the video came up around that time I needed it
I used use FFMPEG for making delivery files of ads for big digital screens. Whatever size or format.. ffmpeg never let me down
This is such an incredible tool. Truly amazing.
Thanks for this. I always wanted to learn more about this since wasm!
I use ffmpeg to scale DOS games using nearest neighbour algorithm. They look awesome on youtube.
I kinda needed this. Ty.
FFmpeg is amazing, so many uses.
knowing how to replace audio or cut stuff out of a video without having to reencode it by using ffmpeg with the argument "-c:v copy" has saved me probably hundreds of hours
im here tryna play some mpeg shit, I go to youtube looking for help and youve just posted a vid, fireship is king