HomeОбразованиеRelated VideosMore From: 0612 TV w/ NERDfirst

FFMPEG Advanced Techniques Pt1 - Advanced Filters

229 ratings | 18521 views
In the past, we've worked with FFMPEG as a conversion tool, but in fact, this little command line utility is so much more! We kick off this two-part series by first delving into some of the more interesting filters provided by the program! = 0612 TV = 0612 TV is your one stop for general geekery! Learn about a variety of technology-related subjects, including Photography, General Computing, Audio/Video Production and Image Manipulation! 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! If you're interested in showing monetary support, consider making a recurring donation at: http://patreon.com/lcc0612 Alternatively, you can send me a one-off payment via PayPal. Click on the "Business Enquiries" button to reveal the email address on this page: http://youtube.com/lcc0612/about More about me: http://about.me/lcc0612 Official Twitter: http://twitter.com/0612tv ----- 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.
Html code for embedding videos on your blog
Text Comments (65)
Alex Zubkov (9 days ago)
Made damn well, by any chance do you ever try id3v2 chapters management for audio files with FFMPEG?
0612 TV w/ NERDfirst (8 days ago)
Hello and thank you very much for your comment! Glad you found the video useful =) I'm afraid I don't have experience with chapter management. However, the metadata portion of the documentation seems useful, perhaps you can start your search there: https://ffmpeg.org/ffmpeg-formats.html#Metadata-1
Lydell Aaron (15 days ago)
Fantastic work.
0612 TV w/ NERDfirst (15 days ago)
Thank you very much! Glad you liked the video :)
GOZARCK (1 month ago)
thankyou! very useful.:ok:
0612 TV w/ NERDfirst (1 month ago)
You're welcome! Glad to be of help =)
PAVAN RAJPUT (3 months ago)
Hey how can add muliple transition like fade,swap,circleopen in multiple video concat in one single video
PAVAN RAJPUT (3 months ago)
thank for helping please tell me more about to make attractive multiple transition on images or video
0612 TV w/ NERDfirst (3 months ago)
Hello and thank you for your comment! Unfortunately if you're planning on using multiple videos / transitions things may start looking less pretty! I haven't tried it myself but I found someone else trying to do the same thing: https://stackoverflow.com/questions/35852622/combining-videos-with-ffmpeg-using-crossfades-and-plain-cuts
TypeError (3 months ago)
Thanks :)
0612 TV w/ NERDfirst (3 months ago)
You're welcome!
junaid qureshi (6 months ago)
sir can u play a mp4 file (AVC1 libavcodec h264)
0612 TV w/ NERDfirst (6 months ago)
Hello and thank you for your comment! That sounds fairly simple, but I'm afraid I can't advise further without knowing the context to your question.
Cerbyo (6 months ago)
ffmpeg -i output.mkv -filter "unsharp=lx=7:ly=7:la=1.5" newoutput.mkv the command doesn't work. Its l not 1 right? la instead of 1a? lx ; ly etc? Still doesnt work cannont connect video filter to audio input error reinteitiliatin giflters fialed to inject frame into filter network: invalid rgument erroe while processsing the decodded datat for stream 0:1 conversation failed
Cerbyo (6 months ago)
okay using -vf instead of -filter worked properly on an mkv file (not so much on a .flv, made it go from like 1080p to 240p quality wise).
0612 TV w/ NERDfirst (6 months ago)
Before I delve too deep into this, let's address the obvious first. Using "-filter" may tell FFMPEG to target both video and audio streams. Try using -vf (or -filter:v) to target only the video stream first.
videoschmo (6 months ago)
What line would I use to deinterlace my video? Thank you
videoschmo (6 months ago)
0612 TV w/ NERDfirst thank you!
0612 TV w/ NERDfirst (6 months ago)
Hello and thank you for your comment! FFMPEG offers several deinterlacing filters, you can try yadif (-vf yadif). For more: https://video.stackexchange.com/questions/17396/how-to-deinterlacing-with-ffmpeg
Arun Raj (8 months ago)
Hello, How to change some particular frames as compression effect(macro block) in a video.
0612 TV w/ NERDfirst (7 months ago)
Hello and thank you for your comment! I'm not sure I understand what you're trying to do. Could you elaborate further?
Sir, how to add utf-8 subtitles to video using ffmpeg. we are seeing the letters distorted kindly help
0612 TV w/ NERDfirst (10 months ago)
Hello and thank you for your comment! Unfortunately I have no experience in this. However, you can check if you've specified an encoding correctly: https://en.m.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/subtitle_options#Set_Subtitles_Character_Encoding_Conversion
Siddharth Das (1 year ago)
Can you tell me how to vary the timecodes that I'm using with my frames. Like incrementing 1 second to the timecode for example.
0612 TV w/ NERDfirst (1 year ago)
Hello and thank you for your comment! I'm afraid I've never done this before, but you may want to check and see if the -timecode option can be of use to you. Scroll up a little in the following link to see: https://ffmpeg.org/ffmpeg.html#filter_005fcomplex_005foption
The Triple A (1 year ago)
thanks for the video, but how do you specify the output video framerate for the showwaves filter?
0612 TV w/ NERDfirst (1 year ago)
You're welcome! Glad to be of help =)
The Triple A (1 year ago)
thanks a lot man, appreciated your afford!
0612 TV w/ NERDfirst (1 year ago)
Hello again! Sorry about that - Looks like you need one more -r switch! This worked for me: ffmpeg -i x.wav -filter_complex "showwaves=rate=60:mode=cline" -r 60 sample.mp4
The Triple A (1 year ago)
thanks for the reply, but the video will still encode in it's default framerate value which is 12.5fps. This is what I typed : ffmpeg -i "My sweet lord.flac" -filter_complex "showwaves=rate=60:mode=cline:size=3840x1440" sample.mp4 EDIT: this didn't work either: ffmpeg -i "My sweet lord.flac" -filter_complex "showwaves=mode=cline:rate=60:size=3840x1440" sample.mp4
0612 TV w/ NERDfirst (1 year ago)
Hello and thank you for your comment! You can specify the frame rate using the rate option, eg. "showwaves=rate=30" for 30fps output.
Johnny English, PhD (1 year ago)
I see no link annotation at 1:45. Just thought I'd let you know.
0612 TV w/ NERDfirst (1 year ago)
No problem! I did add it after your comment, so thanks for letting me know!
Johnny English, PhD (1 year ago)
Ah, yes. I see it up in the top-right. Thanks.
0612 TV w/ NERDfirst (1 year ago)
Hello and thank you very much for your comment! I've just added it in now, though it doesn't appear as an annotation, but as a card on the upper right. Didn't realize YouTube has completely removed it's annotation editor.
Thank you! How can i get filter chromakey? there is not this filter in ffmpeg -filters
0612 TV w/ NERDfirst (1 year ago)
Hello and thank you for your comment! Chances are you have a pretty old version of FFMPEG. Chroma key is a default filter so as long as you have the latest version it should already be there.
Patrick Merina (1 year ago)
Hi! Great Video! Amateur coder here. I was just going to ask if the filters can be applied and be changed without interrupting the video being played? THANK YOU SO MUCH FOR YOUR TUTORIALS!
0612 TV w/ NERDfirst (1 year ago)
Hello and thank you for your comment! As far as I'm aware, if you're calling ffmpeg from the command line, you cannot switch out or add new filters. However, for filters with a disable function, you may be able to switch them off or on during certain timestamps, using the "t" parameter.
ojatro (1 year ago)
Very informative video. Thanksfor sharing.
0612 TV w/ NERDfirst (1 year ago)
Hello and thank you very much for your comment! Very happy to be of help =)
Anatoly Strashkevich (1 year ago)
nice, thanks!
0612 TV w/ NERDfirst (1 year ago)
You're welcome! Glad to be of help =)
Hoàng Minh Chiến (1 year ago)
can you make a example of ffmpeg video selective color ?
navilor (1 year ago)
Validated as working but using the selectivecolor filter slows things down tremendously. -vf "selectivecolor=reds=0 -.2 -0.2 +.1:yellows=0 0 -.2 0:cyans=-.5 .5 .5 -.25" You can also use a PhotoShop asv file: -vf "selectivecolor=psfile=tealandorangefix.asv"
0612 TV w/ NERDfirst (1 year ago)
Hello and thank you for your comment! I've just looked up the syntax and it is indeed a bit complex. I might do a video on this sometime, but for now in words: You have to first target colors using the filter. Then, for each color, you can increase or decrease its cyan, magenta, yellow and black levels. For example, to reduce the yellow from green areas, I would say: ffmpeg -i infile -vf "selectivecolor=greens=0 0 -0.5 0" outfile The format is selectivecolor=<color to target>=<c> <m> <y> <k> Where c,m,y, and k are separated by spaces and are numbers that run from -1 to 1.
Bill Admond (1 year ago)
Could you give a sample code to shrink a video? I'm getting always errors!
0612 TV w/ NERDfirst (1 year ago)
Hello and thank you for your comment! Your code would look something like this: ffmpeg -i infile -vf "scale=640:480" outfile Replace "infile" and "outfile" with your desired input and output file names. Replace "640" with your target width and "480" with your target height. If that doesn't work, please copy the error message you're getting so I can better help you!
how can we combine the frames in order to make a video without any loss using ffmpeg?
0612 TV w/ NERDfirst (1 year ago)
Hello and thank you for your comment! It's not very clear what exactly you're trying to do and what result you are expecting, but it sounds like you want to encode a higher frame rate video down to a lower frame rate one by combining frames? If so, the filter involved is: -vf "tblend=all_mode=average" -r <target frame rate> You can manipulate the -q:v flag to further tweak quality if needed.
Abu Gbak (1 year ago)
This is a beautifully made video. It was very clear and useful. If you had a Patreon, I would donate to you immediately for your service.
0612 TV w/ NERDfirst (1 year ago)
Hello and thank you very much for your comment! Happy to be of help =) I do actually have a patreon (http://patreon.com/lcc0612). I also accept one-time donations via paypal. Thank you very much for your support!
Nicholas Delport (1 year ago)
Freaking awesome info Video! been looking for this, thanks for the clear explanations and guide! anyway you could make a video on using ffmpeg for multi bitrate profiles with rtmp streaming to hls? and explaining the different options available to you?
0612 TV w/ NERDfirst (1 year ago)
Hello and thank you for your comment! I wouldn't know where to start on this as I have never used FFMPEG for streaming before! However, this _is_ one of the more powerful and less-known features of this platform, so I'm definitely interested in exploring! I may do something on streaming eventually though I don't know if I'll ever address what you're looking for I'm afraid!
Hi Icco612 Another great video mate! I saw what I believe to be Marina Bay Sands, so I guessed you were Singaporean! Would like to ask you about your username and channel name! What is the significance of those letters and numbers? :) I can see some of those filters possibly being useful if one wants to apply some quick colour correction to ones footage. Guess I will have to experiment one day! Anyways good to know what possibilities exist, so thanks for detailing out here what else we can do with FFmpeg. By the way... just curious... what things are you currently working on or playing with at the moment image/video/tech wise... ? Have a great weekend mate!
0612 TV w/ NERDfirst (1 year ago)
Hello and thank you very much for your comment! Yes I'm Singaporean, and what you saw in the video was indeed MBS! lcc0612 comes from my name and birthday. It's horrible in terms of marketing because nobody can remember it =P Unfortunately at present moment I'm quite overwhelmed with work so I haven't been experimenting a lot with image / video. My work actually puts me in contact with quite a bit of robotics and microcontroller platforms so I've been playing with those a bit! Have a good weekend too!
Oppo Balangan (1 year ago)
Can you show us how to convert .anyvideo to .gif without loosing its quality thanks
0612 TV w/ NERDfirst (1 year ago)
Hello and thank you for your comment! Firstly, please clarify - When you sat ".anyvideo", is there a particular file format with that extension you're looking at? Or do you mean any video in general? Second, actually it's not quite possible to convert a video to GIF without loss of quality because of the way GIF represents color - Every pixel can only be one of 255 colors (aka 8-bit color) which is not quite enough to represent the full gamut of colors in a video.
my favorite filter (windows compile only -vf format=gray to get grayscale.) They way I get around it is NOT to compile the linux code. I just use the windows .exe under Wine... it works fine in command line.
0612 TV w/ NERDfirst (1 year ago)
Hello and thank you for your comment! If you just want the frame to look grayscale, you can simply use -vf hue=s=0 instead, and that'll be cross-platform compatible.
buaydianway (2 years ago)
kudos bro! good video! you must do more tutorial video on FFMPEG and earn from youtube!
buaydianway (2 years ago)
i was actually searching on how to download video & getting url of videos embedded on website & came across your video. great job keep posting.
0612 TV w/ NERDfirst (2 years ago)
Hello and thank you very much for your comment! That's the plan =) If you have any more requests for FFMPEG content (after next week's episode), feel free to let me know and I'll see what I can do!
Farbfilmstudio (2 years ago)
OMG so nice THX!
0612 TV w/ NERDfirst (2 years ago)
You're welcome! Glad you liked the video!

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.