How to use FFMPEG
Вставка
- Опубліковано 30 чер 2024
- The unsung hero of video encoding - FFMPEG! You've probably used it (hidden behind some user interface), but today, we'll learn how to get to the root of it, and operate FFMPEG itself from the command line!
== CONTENTS ==
0:00 Introduction
1:43 Installation Notes
3:30 Basic Use
3:57 Example 1: Basic Video Conversion
5:11 Quality Controls
7:10 Bitrates & Specifying Streams (Audio or Video)
7:54 Command Summary
8:07 FFMPEG Filters / Common Use Cases
8:40 Filter 1: Volume Control
9:10 Filter 2: Audio Channel Remapping
9:47 Filter 3: Cropping
10:31 Filter 4: Video Scaling
11:02 Filter 5: Rotation
11:28 Conclusion
Download FFMPEG: www.ffmpeg.org/download.html
Download PeaZip: www.peazip.org/
Full FFMPEG Documentation: ffmpeg.org/ffmpeg.html
FFMPEG Filter Documentation: ffmpeg.org/ffmpeg-filters.html
All FFMPEG features: ffmpeg.org/documentation.html
This video consists of three main parts - Installing FFMPEG, some fundamental notes about how it is used, as well as some filters and effects it supports.
Its use can be extremely simple - By just supplying input and output file names and changing up their extensions, you can effortlessly convert from one format to another.
Conversely, if you are looking to do more complex operations such as chroma keying (green screening) and filtering operations, FFMPEG can do it to! To do this, you will need to use Filtergraphs, a feature covered in another episode: • FFMPEG Advanced Techni...
Additional Tip (Credit to Kitsune Ultima for sharing): To open a command line in any folder, simply type "cmd" in the address bar of your explorer window while viewing that folder, and the command prompt will load in the correct folder!
= 0612 TV =
0612 TV, a sub-project of NERDfirst.net, is an educational UA-cam channel. Started in 2008, we have now covered a wide range of topics, from areas such as Programming, Algorithms and Computing Theories, Computer Graphics, Photography, and Specialized Guides for using software such as FFMPEG, Deshaker, GIMP and more!
Enjoy your stay, and don't hesitate to drop me a comment or a personal message to my inbox =) If you like my work, don't forget to subscribe!
Like what you see? Buy me a coffee → www.nerdfirst.net/donate/
0612 TV Official Writeup: nerdfirst.net/0612tv
More about me: about.me/lcc0612
Official Twitter: / 0612tv
= NERDfirst =
NERDfirst is a project allowing me to go above and beyond UA-cam videos into areas like app and game development. It will also contain the official 0612 TV blog and other resources.
Watch this space, and keep your eyes peeled on this channel for more updates! nerdfirst.net/
-----
Disclaimer: Please note that any information is provided on this channel in good faith, but I cannot guarantee 100% accuracy / correctness on all content. Contributors to this channel are not to be held responsible for any possible outcomes from your use of the information.
This is the first time I've seen a 100% professional tutorial here at UA-cam.
You sir are going places. Thanks a lot for this!
Hello and thank you very much for your comment! Glad you like my work, and I'm very happy to have been of help!
You sir just crushed it! Blew all the videos I have watched on FFmpeg and pretty much any CLI tutorial out of the water. I love the way for broke those switches down Barney Style, I love it!!!!! Thank you again, subscribed. Keep them coming. There are too few videos that explain these tools with such clarity.
+victormgv Hello and thank you very much for your comment and support! Really happy to be of help! Hope to see you around in the comments section of the videos to come =)
I'm amazed at how you were able to explain the concepts, terminologies, etc. in a way that's easy to digest. Kudos, sir. Keep at it!
Hello and thank you very much for your comment! Glad you found the video useful =)
Awesome tutorial. I went from having never heard about ffmpeg to converting several files. Thank you very much!
You're welcome! Very happy to be of help =)
Great tutorial! Not only does it deliver all the info I need to get started, but you also seem so enthusiastic about it that it actually got me pumped to dig in. Thanks for that!
Hello and thank you very much for your comment! Glad to be of help and glad I got you excited about FFMPEG, all the best!
thank you for the clear introduction, badly needed this. thank you again, more power to your channel
You're very much welcome! Very happy to be of help =)
Very clear and simple. Exactly what I need as a first tutorial. The rest should be fairly easy to learn from here. Thanks for showing me the ladder!
Hello and thank you very much for your comment! Very happy to be of help, have fun with FFMPEG =)
This is incredibly helpful and presented in a clear, professional manner. Thank you!
You're welcome! Very happy to be of help =)
dude, this video is -q 0 amazing
Thank you very much! Glad you liked the video =)
honestly I've never been surprised by a tutorial before just woah dude
Heh, hope that's the good kind of surprise!
Fabulous tutorial. I feel a lot more confident moving forward with using it for 360-degree camera output, which is my #1 life priority right now. :)
Hello and thank you very much for your comment! Very happy to be of help, have fun with 360 video! I hope to be able to dabble with that someday as well.
Today was the first I ever heard of the FFMPEG, I just needed to replace audio track in an mp4, and I got the exact info I needed in under 4 minutes. Great Job.
Hello and thank you very much for your comment! Glad to be of help =)
Please make more FFMPEG lessons. This is the most comprehensive howto I have seen in 8 years. Thanks
Hello and thank you very much for your comment! You'll be happy to know that there's one FFMPEG tutorial in the works at this very moment =)
Whoaaaaaa. This video is a great tutorial, but this guys is so RESPECTABLE. If you scroll down all the way to as far as you can got, he has answered EVERY. SINGLE. COMMENT.
He will answer this just you wait.
Hello and thank you very much for your comment! Guess you didn't have to wait long for a response :)
Glad you found the video useful!
0612 TV w/ NERDfirst Thank you 😂
This video is the LITERAL only reason I committed to finally setting up FFmpeg! This video is ahead of it's time! HUGE DUBS TO YOU!
Hello and thank you very much for your comment! Very happy to be of help =)
I went from completely clueless about ffmpeg to understanding the basics. Thank you so much for the easy to understand video!
You're welcome! Very happy to be of help =)
*Expand for Important Notes*
*1. On Download Availability*
Zeranoe, which was featured in this video, has discontinued providing FFMPEG binaries since 2020. You can download from this github page instead, as linked to by the official FFMPEG downloads page: github.com/BtbN/FFmpeg-Builds/releases. Windows users can go for the "ffmpeg-master-latest-win64-gpl" build, as the GPL version is likely to have the most features.
*2. On Debugging and Help*
Unfortunately due to high IRL workloads, I'm not able to look at your commands and help diagnose problems. You may contact me at hello(at)nerdfirst(dot)net for paid consultation, if you really see the need.
*3. PSA*
If you have a question, please post it as a new comment, *_not_* as a reply to one of my earlier comments here. UA-cam does not reliably notify me of the latter, which means I may miss your message!
Thank you, especially for mono to stereo mapping - I have exactly that issue recently! :)
You're welcome! Glad to be of help =)
Came here for the conversion section and wasn't disappointed. Thank you sir.
You're welcome! Happy to be of help :)
You rock! battled for an hour just to figure out my PATH was messed up. Thank you!!
You're welcome! Very happy to be of help =)
i love your nerdy voice
Thank you very much =)
me too =) the video is really useful thanks
+ternitamas thank you! Glad to be of help :)
same :3
Good tutorial.
This nigga moves alot.
+Camera Focuses Cheers! Yeah, moving helps me think, but I'm working on cutting down on that!
You are good.
+Camera Focuses Thank you very much! Glad you think so =)
Didn't know about ffmpeg until this morning (27/09/22).
Your video has increased my understanding of the command line.
Thanks once again.
You're welcome! Very happy to be of help =)
Very concise and detailed. Your explanation was easy to follow and helpful, thank you!
Hello and thank you very much for your comment! Very happy to know I've been of help =)
I truly hate things I don't understand
Hello and thank you for your comment! Hope I helped you a little with that =)
absolutely the best explanation and examples of ffmpeg!! Dude you deserve more than just 29k subscribers!! Your stuff is PLATINUM!!
Hello and thank you very much for your comment! Glad you liked the video =)
Awesome video! Right to the point, and not confusing! Good job lad!
Hello and thank you very much for your comment! Glad you liked the video =)
Thank you for all the help. Been needing to transfer old home video files from DVDs to online. It's cool how a community has made such an excellent tool for file transfers. .vob files to .mp4 are not easy to work with, and this did exactly what was needed.
Still, 8 years later, and you're still keeping in touch with your community? It's sweet to see. Thanks again
You're very much welcome, very happy to be of help!
Yes I'm definitely still hanging around. This channel is a passion project so I'm always appreciative of any engagement!
Amazing walkthrough. when starting out you search up how to use these command line tools up on forums or reddit and you basically get told to not be dumb or they act all high and mighty and start explaining as to why what you want is wrong. in short they give you everything but a solid answer or what you want
Hello and thank you for your comment! Unfortunately that's how the internet is, though it does bear mentioning that issues like the AB Problem are very real.
At any rate, the command line gets better with time and practice. Keep at it! I'm glad I've been able to give you the nudge you need :)
I can't express how much this is helpful!
Hello and thank you very much for your comment! Very happy to be of help =)
Thanks for a simple, but deep explanation of using FFMPEG.
You're welcome! Glad to be of help =)
Wow, a quality tutorial on how to use a piece of software. Thanks!
You're welcome! Glad you liked the video =)
Before watching this video I wasn't able to understand what that items such as -i, -filter, v, a mean and in which place they should be placed in the array, now everything is clear to me thanks to this super helpful video, thanks a lot!
You're welcome! Very happy to be of help =)
Thank you for this. Have to learn this cool little program for work, and your beginners' guide is a huge help.
That's great to hear! Very happy to be of help, and all the best for your work =)
Well done! I just DLd ffmpeg and of all the tutorials I just happened to pick this one.
Thanks for saving me a lot of time and frustration!
Hello and thank you very much for your comment! Very happy to be of help =)
Very clear and easy-to-digest tutorial. Thanks a lot.
You're welcome! Glad to be of help =)
Massive help, thanks for the upload
You're welcome! Very happy to be of help =)
Was trying to use FFMPEG for the first time, this helped a lot. Thanks!
You're welcome! Glad to be of help :)
I watched this video about two years ago. This weekend, I was wrestling with our own home-grown video rendering and decided to have another look, and now my life has changed. I wonder what other great, life-changing advice this very smart guy has?
Hello and thank you very much for your comment! I can't promise life changing videos, but if you check out the channel you can find 900+ videos created over the years =)
dude, this is fantastic. Thank you for demystifying this. The email group that the official site recommends for this utility is full of people who have no business being asked questions about how something works.
You're welcome, very happy to be of help! Though to be fair, creating a broad how-to video versus having to answer questions are two very different skillsets, so I totally understand the discrepancy.
This is a great video. I love it. You explain it so well that everyone can understand. Thank you! :)
You're welcome! Very happy to be of help, glad you found the video useful :)
Superb tutorial, very well explained for anyone new to FFMPEG, Keep up the great work, you are invaluable.
Hello and thank you very much for your comment! Glad you liked the video =)
Thanks buddy, really helpful. Good coverage of the topic
You're welcome! Very happy to be of help =)
Thank you so much for this tutorial series about FFmpeg and CMD. It really helped a lot, and if you don't mind, could you please consider adding a video to that playlist talking about how to handle subtitles as well.
Like how to bulk extract multiple subtitles from a single video and also from a bunch of videos placed in the same directory.
Hope you consider, coz all other topics regarding the video and audio part were covered, except for this one.
Thanks again.
Hello and thank you very much for your comment! Yes, subtitles and livestreaming are two major topics in FFMPEG that I haven't yet covered and are on the drawing board. I don't use these features often so I tend to need more time to research and understand them better before I feel comfortable enough to make a tutorial. Thanks for the suggestion!
and here I am, developing Flutter Mobile Apps for compressing Videos inside the app, watching explanation of FFMPEG. this 6 years old video is clear and easy to understand. Kudos to you!
Hello and thank you very much for your comment! Glad to be of help =)
Omg. Simple program and simple & clear tutorial. You've saved my day. That's why I like UA-cam.
Hello and thank you very much for your comment! Very happy to be of help =)
Very helpful. I was stuck for a good while trying to figure out how to use this.
Hello and thank you for your comment! Very happy to be of help =)
Thank you so much bro! It was very helpful for me. Greetings from Latin America! Have a nice day!
You're welcome! Very happy to be of help =)
Wow! Really informative video. Thank you!
You're welcome! Very happy to be of help =)
Wow, brilliant video and the soft is really easy to use!
Hello and thank you very much for your comment! Glad to be of help =)
Wow! Rocket science made easy! This was just amazing.. Created new interest with FFMPEG.. Thank youuuuuu
You're welcome! Very happy to be of help =)
Very easy tutorial, and good explanations on ffmpeg's use. Nice job
Hello and thank you for your comment! Glad you liked the video =)
I found this a very useful video and it got me up and going with ffmpeg. Good job!
Hello and thank you very much for your comment! Glad to be of help =)
Thanks a lot for the tutorial, it is very clear and all the relevant info is there.
As it happens, I had FFMPEG on my computer for years without knowing about it :D
Cheers
You're welcome! Very happy to be of help, have fun using FFMPEG =)
Very Cool! I had no idea that this existed. Thanks for going through the syntax.
You're welcome! Very happy to be of help :)
Very good explaination. I wondered how to install it first, I had to download a static build and watch a video on UA-cam on how to install it. Getting it to run is way harder than actually working with it.
Hello and thank you for your comment! Glad you got the worst of it behind you!
I'm amazed of this video's quality! It's still relevant as I'm here in 2024! 😄
Hello and thank you very much for your comment! Glad to be of help =)
if i could like this each time i watched this for a refresher, you'd be up to 2k thumbs up. thanks again dude.
You're welcome! Really happy to know you've been coming back. Glad to be of help!
awesome bro ! I am fallen in love with ffmpeg after watching this thankyou very much ! Subscribed :)
You're welcome! Very happy to be of help =)
thank you, you have helped me a lot with this user guide
also thanks for the subtitles
You're welcome! Very happy to be of help =)
Thanks a ton for uploading!
+Kevin Duperret You're welcome! Glad to be of help =)
This is a great introduction to ffmpeg concepts/basics 👍🏻
Hello and thank you very much for your comment! Glad you liked my work :)
@@NERDfirst I've then watched your other video about advanced filters, great too ! I knew the basics already, but it's always interesting to check how other people explain things, there's always something to learn you either didn't know or didn't use properly. I had no idea about the difference using '-ss' before '-i' vs after ! :) Thanks, your videos are very understandable and I like the effort with the animation/graphics you put in them ! Cheers
Thank you again! Yes, that clarity is exactly what I'm aiming for so I'm glad I was able to achieve it.
This is the first tutorial that just told me exactly what I wanted to know. Easy subscription from me sir.
Hello and thank you very much for your comment! Very happy to be of help =)
This is incredibly helpful, thanks a lot man!
You're welcome! Very happy to have been of help :)
Man, you are great!!
Thank you very much for the video
Hello and thank you very much for your comment! Very happy to be of help :)
Thank you for the video, well presented and packed with useful info.
Hello and thank you very much for your comment! Glad you liked the video =)
Great tutorial, thank you for your time and effort!
Hello and thank you very much for your comment! Very happy to be of help =)
This was exactly what I needed! Thanks dude
You're welcome! Glad to be of help =)
I could not get the audio works after converting it from mp4 by using vlc. This works great.... all i have to do now is to increase the audio quality. Thank you so much! Your tutorial is fantastic!
You're welcome! Very happy to be of help =)
Really usefull video, thanks :)
Have you ever considered making a video about regular expressions? I think the topic would fit your format quite well.
+CivilNL Hello and thank you very much for your comment! I actually had a regex video half planned before I scrapped it... There was just waaay too much! I'll consider revisiting that subject in the future when/if I get more confident on the content.
Excellent guide, thank you :)
You're welcome! Glad to be of help =)
Thanks really helped a lot! :)
You're welcome! Glad to be of help =)
This was so helpful and simple! One extra tip for comment readers: it words best when the file name has no spaces.
Hello and thank you for your comment and for sharing! If you must have spaces in the file name, you can wrap it in "quotation marks", ie.
ffmpeg -i "input file.mp4" "my output file name.mov"
Thank you for the well done explanation.
You're welcome! Very happy to be of help =)
Thank you for a very good tutorial!
You're welcome! Very happy to be of help =)
Excellent instructional video. You're the best.
Hello and thank you very much for your comment! Glad to be of help :)
For the filter parameters at 8:54, I think there is is shortcut ( -af volume=2 ).
-a for audio
-f for filter
Similarly to add filter to a video, you can do, for example -vf scale=-1:720, to shrink or expand a video to 720P
-v for video
-f for filter, scale is the filter function to scale the video input
-1:720, -1 means to keep the original ratio and adjust width automatically, 720 sets the height of the video to 720px.
Hello and thank you very much for sharing! Yeah, there are many shortcuts available in FFMPEG. Unfortunately the video was already running a little long and I was saving those for a future video =P Good to have a reference here though!
my goodness this was much simpler than I thought it'd be!
Hello and thank you for your comment! I'm glad to hear! Have fun with FFMPEG =)
Straight forward and correct, thank you very much
You're welcome! Very happy to be of help :)
Amazing video, clear and effective.
Hello and thank you very much for your comment! Glad you liked the video =)
2021 this is still awesome, thanks.
You're welcome! Very happy to be of help :)
Clearly presented. Thank you.
You're welcome! Happy to be of help :)
Excellent explanation. Thanks very much 👌
You're welcome! Very happy to be of help =)
You earned my SUB man. Hats off. Wish I could pay you. May God Bless You mate.
Hello and thank you very much for your comment and support! Very happy to be of help =)
If you would like to send some cash this way, I have a donation page → nerdfirst.net/donate. Of course, there's no obligation to donate at all, and I'm very grateful you considered =)
Mine gives me the PowerShell command window option instead. I still tried your line at 4:45 converting from avi to mp4 and it works! First time that I follow a tutor on this complicated subject and it works after many failed attempt from others! Thanks a lots!
Hello and thank you for your comment! Yes, newer versions of windows prefer powershell over cmd, but it largely works the same. Glad you got it working!
great video man! thanks!
You're welcome :) Glad to be of help!
I did it thanks to your video! Thank you so much!
You're welcome! Very happy to be of help =)
I didn't know that shift+right click would give me the option to open with command line! Thanks for this and for the rest of the video!
You're welcome! Very happy to be of help!
That trick didn't work for me. I use a third party file explorer, but the option didn't appear inside Windows Explorer either
Make sure you are not clicking on any file
No I did exactly as he suggested, the 'Open Command Prompt Here" option is not available to me in that context menu
Hello and thank you for your comment! I apologize for the late reply - I never get notified properly on replies to comments for some reason!
I recently realized that another reason why the entry does not appear is if you have a file in the folder selected. The context menu that appears (even if you right click on empty space) is tailored towards the selected file instead, and as such the entry does not appear.
Try to make sure no files are selected by clicking on empty space. Then try the described technique again and see if this helps!
Hell of a video, I def needed the help. Thank you!
+Jessie Wilson You're welcome! Glad to be of help =)
Say I took a video with ac3 5.1 audio and I wanted to copy the video but convert the audio to aac 2.0 (96), what lines would I use for that?
+Jessie Wilson Hello again! Hmm, interesting, sounds like you want to do quite a few things, so I'll actually start with something simple and "evolve" it to suit your use case.
So we start off with this, which says that we want to copy the video but reencode the audio.
ffmpeg -i inputName -vcodec copy -acodec aac outputName
I'm not sure what you mean by (96), is that the bitrate? If it is, then you might want to do this:
ffmpeg -i inputName -vcodec copy -acodec aac *-b:a 96k* outputName
Finally, to mix 5.1 channels down to 2 - Interestingly, there are several ways to do it. This is the simplest "default" way, which is handled by FFMPEG natively:
ffmpeg -i inputName -vcodec copy -acodec aac -b:a 96k *-ac 2* outputName
These are very advanced, but apparently people aren't too satisfied with the quality of FFMPEG's built-in downmixing, and have proposed their own methods:
forum.doom9.org/archive/index.php/t-168267.html
ffmpeg.zeranoe.com/forum/viewtopic.php?f=17&t=1851
For the former, simply copy the "-af" switch and its parameter, while for the latter, copy the "-clev" and "-slev" switches.
+lcc0612 Thank you for the response. I'm pretty adept at using Handbrake but like a lot of programs, it doesn't have a video passthrough. Which kept bringing me back to ffmpeg command lines.
Tonight is the first time I have used it and I see I have a lot to learn. Is there a cheat sheet or anything for most used commands?
+Jessie Wilson I haven't come across a cheat sheet myself, to be honest! All I've done is, through experience, found a set of features I use the most often, and then internalize those. For example -b:v and -b:a to set bitrate (or -crf for certain codecs). Occasionally I use -vcodec as well because sometimes I want to produce MJPEG, for example.
For the more complex tasks, I just build the command into a batch file and run it with a double click.
Thanks. I got suggested FFmpeg by Audacity but had no idea how to use it. This made things really simple and now I can use a converter without having to open another app that would probably charge money :D
Hello and thank you for your comment! Glad to be of help :)
Though, if you're only using Audacity, it can do all the conversions for you! So you don't even have to use the command line in the way shown in the video.
@@NERDfirst Interestingly enough, I tried that and also another free application that I use in music sometimes called Virtual DJ, but neither of them were able to read the file for some reason.
Brilliant! Thanks for your hard work.
You're welcome! Very happy to be of help =)
Awesome! Thank you for your time!
You're welcome! Very happy to be of help :)
Thank you so much! You are a very good teacher 🤘🎖
You're welcome! Very happy to be of help =)
Your video a sidebar suggestion from another instructing 'how to install ffmpeg on android'. At first I thought you were the same guy from +GreatScott! because your voices and English accents are so similar down to your inflection haha. Subscribed :D
Hello and thank you very much for your comment and support! And thanks for introducing an interesting channel to watch, too =)
very informative. thanks a lot for this video!
You're welcome! Very happy to be of help =)
my man explained it 7 years ago. Thanks dude
You're welcome! Glad to be of help =)
Dude! Thanks! Works great!😃
You're welcome! Happy to be of help =)
Excellent explanation! Thank you.
+Shawn Greene You're welcome! Very happy to be of help :)
+Icc0612 But, when I try to encode *.ass subtitle into *.mp4 file. It just didn't work. I've used static build as you mentioned. And command line was ...
ffmpeg -i video.mp4 -vf "ass=subtitle.ass" out.mp4
Do you have any thought?
+Shawn Greene Hello again! I have to confess to having zero experience with subtitles, but it seems that there are a few hoops you need to jump through to get .ass subs to work correctly.
Check out this guide. I hope it's not too outdated. trac.ffmpeg.org/wiki/HowToBurnSubtitlesIntoVideo
Thank you very much..for excellent video content.
You're welcome! Very happy to be of help =)
ive been trying to convert video to audio, thanks man!
Cheers! Glad to be of help =)
do you mean extract audio from a video?