PhreakNIC20: FFmpeg I didn't know it could do that! - poiupoiu

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone this is the ffmpeg talk I actually started this right after immediately after at last Freaknik as I calm what topic do I know about that I can present on ffmpeg well everyone knows how little bit how to use it so I thought ffmpeg I did you know what can do that so quick intro me I pronounce it free of wheel I converted back to the Linux back in 2012 I like long walks on the beach and coding editing videos I I don't know how many hours I've spent reading documentation on video codecs and reading code at comparisons and pulling around so um I like mythtv run that SSH is awesome btrfs loving that now so does the raid 5 6 stuff figured out uh a couple left's all right nerve got all right aha rsync awesome i like means to photography in like everyone else here on and heard so ffmpeg is called the Swiss Army knife of video tools its command line it can run inside of a screen inside of ssh meaning you can ssh into somewhere set a start screen up do thing alright detach come back hey everything rather than everything's done it is open source it's not quite a GPL man brimstone but it's awesome it opens nearly every video format out there so ffmpeg formats so for all of these you see a little dee dee muxing supported these are all the file the file types that it can actually open and then code a couple and one new ones on there they can do Lego Mindstorms encoding and decoding does anyone remember this one pink video yeah being car yeah it can do gamecube videos ps2 videos hey they go every it can decode everything i can also encode a time lego mindstorm again flv and it's ton of different filters out there again so the a2a you here are the audio the audio filters alone video filters I mean you can do so many things has anyone ever used YouTube they use ffmpeg why reinvent the wheel so if you go to ffmpeg gorg / ffmpeg dash all that has all the documentation on or you can just do again it just goes on and on and on and on so many things that can do so a couple little I'm going to have a lot of command line up here so try to preface everything with trying to interpret things so operations that happen before the I operate on the inputs whereas after the I operate on the alcohol well so the ffmpeg r60 here dash I file name one file name to that is completely different operations than ffmpeg I file name one dash are 16 well the first one we'll do is actually set the frame rate that will force the frame rate on the file one s 60 frames per second this one will actually set the frame rate on the second one for 60 and will actually add frames or delete frames as needed dash I is that for your input f4 format rape rape rape frame rate as hollow as you saw different kinds of audio codec and did an audio and video codecs so their terminology is C colon any for audio codec v4 video as for subtitle VF video filter very same thing their method of doing things as video adesh VF and then you do the filter title the filter option and then the filter value with equal signs between so FPS equals FPS equals thirty thousand divided by one one will actually result in a 29.99 seven frame rate but the option in the filter name are the exact same so it's kind of weird use commas to to chain everything in so you can do take your input crop it and then you can rescale it and then you can transform that route rotate it if you want all in that specific order a dash T for the time or dash T 0 for you can actually set say I'll get to it a little bit but T for T and T over time so first thing ffmpeg can do read mocks videos so avi mp4 MKV MPG Bob those are fought those are more code those are containers those extensions but they're mostly they're the containers themselves so then p for everyone's phone can play that but what you don't see is inside that mp4 container and that file it has information out the frame rate information about the code at the bid rate as information about audio subtitled metadata like the chapter tags sub titles that has all that inside the actual container so simple enough to convert from say an mp4 to an MKV or a avi to an MKV or even an impediment a V I like MKV because it's open source and it accepts every file format out there mp4 can only do AC for audio and ACN wave i believe and um mostly I think it's xpedx or xvid and x2 are h.264 for video and that is if you try to feed something else so it blows off and so no I can't do it and then matroska so go yeah the sub time I was like sure I'll do it I don't care it'll take everything mp3 for audio wave anything so f MPEG DASH on file name one deci copy and file name to that alone grab all the strings from filing we're from file one and delving into edit file to with zero loss of quality and be done in seconds different format different container container yes or if you want to you can choose just to copy one video of the video from this and transcode is something else so here you can say from filename to deci audio the for the audio codec the AC built-in codec useful for ripping and injuries or yes then yeah it just is just a different just a different stream in the candy container so why not and they say if you want to then take AC audio and use the lib x265 video codec and you can encode it into MKV alternately you can say ffmpeg video following three SS to stream skip so this will actually but after the eye it will use accurate Frank skip frame rate so have to chug through the entire thing and they gets to four minutes and twenty eight point one two three seconds and then we'll start right there and go to nine minutes def see copied short so this will take a 35 minutes now for minute and 32 second file you get moving on you can point to the specific frame this one yes so say you have the movie hackers everyone has a copy and did it so good video of a good video bad horrible audio hilarious movie and then they have a hacker to AC for whatever reason it came across as an audio only and then you have the hackers on hackers commentary from freaknik 10 that iron geek has available for download what is going to combine all three FFM today I for hackers your API dish I again for hackers AAC dash I hackers on hackers and then you can do with the map functions to do map 0 because 0 means 1 colon v now you're specifically saying take the first input and grab just the video and now dash map 1582 and grab the dita first string which is in this case just audio and then the other third input and grant just the audio see copy and summation this will take video feed from the AVI and the two audio feeds and then spit it out into a single video file that has two audio tracks again no loss in quality and will be done in five or six seconds number three default settings so this is a very valid case right here ffmpeg I file Bob file to that before well you don't seek on here though is it saying it's saying it's recognizing that you want the mp4 file so it's recognizing all right mp4 container with a move Adam at the end which is just a chef and before an audio encoded via the AAC codec set to 128 kilobits a second and then h.264 compliant video encoded via the x264 codec encoded at CRF 23 would end use preset medium concentrate factor so the is a way of doing to pass quality video in a single pass whereas if you say you set the video bitrate or you want to target bit rate of one megabit that's great for slow-moving for example but for really fast moving then you're getting one megabit whereas if you target via a CRF you can say it operates a dynamically so if you have a episode of a kids show at CRF 22 versus a action movie at 22 same run length they would have completely different bit rates to it so it's an accurate way of saying I want this quality and I don't care what bitrate you get so and then a preset medium so really all out this is what these this command looks like all spelled out can also do a DVD compliant video from a MPEG with then you can pass into a couple different other programs but getting that DVD compliant MPEG at first so again just f of MPEG file dash target DVD and then you can do also a vcd for old school video CDs you do DVDs and a couple of different other couple different targets out there you Jerry I do not believe there is a YouTube target I could very well be wrong because every time I say yeah I know all about it oh well I got showed up there again it just goes on the ffmpeg filters again the PF video filter AF audio filter a couple of my favorites were the crop detect and then uh and then pipe a dash a4 format for a null and then have everything dumped down to the dev null direct file well that will do is you can say to a crop detect and audio detect with the audio and video filters here or a volume detect and they lecture 1 through the entire video and then say alright well based off of what I could see here's your audio the audio histogram in terms of decibels you know how much and then it also tell you what the loudest sound is so you can raise up the audio without having to worry about any clipping then the crop detect whenever you're running it'll actually go through all the look for the black borders and say they all right here is this oh and here's a nice little format to say crop this um filme Chantell aside and pull up and yeah those are all deal with inverse telecine so if you want to talk about that i can i can talk your ear off about I vtc it is a way of coming up with five video frames from four to fit the 24 frames per second film standard into the 30 frames a second DVD ntsc standard so and if you actually want to there should be an ffmpeg workshop tomorrow and and I actually have a couple of I have a example of doing that so a couple other ones yet of yet another DNA lacing filter so and again there isn't just one piece there are at least two or three different deinterlacing filters in there I guess that field match is a field matching telesign is one way of inverse telecine pull up and then setting the FPS is one way pull up and setting the rate is another way sometimes it works fine sometimes it doesn't um for whatever reason I was that again just why I hackers yeah I have that one of them did a using the inverse telecine of FPS it worked fine and then about halfway through it would start every couple frames to get off what but if you do the HR it works so that's a little less a gripe in mind but I couldn't tell you where it does that so you can also do screenshots and gifts too hard G so here is just saying set to stream skip since it is before the dash I is actually operating on key frames so this will actually just go if you tell us to go an hour and 20 minutes in if it's the SS is after it'll go do it go go go and sit there all day if the dash SS of pumped-up finds it right away and it does it as accurately as you can to the key frame so the end put your movie dash t say five seconds dash are for 15 frames a second and dash movie great but this is open source there's got to be other ways of doing the same thing oh so you know there's another way of doing it when that's making a to pass so the firt up here at the top line is just using a very generic palette so if you do the VF halogen have been a video filter for collagen it'll actually spit out a it's like a 216 village exactly yes sir it'll actually spit out a gift palette and then from there you can say use your input for the palette and then use your input from the video use the complex filter which I haven't even I barely scratched the surface on all my use on it and then palette use do that and that will actually spit out a much nicer looking video or much much nicer looking gif file if you use the one up here it'll actually have a lot of like a little bunch of dots kind of in a grid for the Anna through everything but also you can use it on images so you can say take the gift that you just created and then Kermit transcode it into an mp4 or you can take a bunch of JPEGs so this is a its term in its firm that it is its method of saying image dash three zeros and then a digit for everything from that using following that pattern or everything I'm sorry yeah everything in that pattern that JPEG it'll grab that you say I want to set the framework to 10 frames a second would that be useful for like making yeah claymation videos um uh not long exposures in terms of photography uh sorry whatevs yeah time lapse thank you yes so create your own time lapse from just a bunch of images you can make it in there you got her ohh-ho you got to have the Carlton so you have to watch the girls Oh which one alright so this was something that I actually just started doing oh and by the way that uh that pallet jen i learned about that last week so again there is a gift files have a limitation 216 colors corral video usually they have more than 260 exactly and so I was actually trying to get it up the the scene whenever in a the force awakens whenever the guy yells traitor and throws down is a she throws down his blaster and pulls out the whatever that thing was I was trying to get that into a gift and I was like huh it looks kind of blocky surely but gotta be another way and again like I said I learned about that last week I'm using ffmpeg now for four years and I still learning things all the time about it so then also it can speed up video tracks and audio tracks so if you want to go to half speed then just your input file is normal that dash AF for audio filter the a tempo for audio temple equals 0.5 and the v F equals set pts and then with the value of equals 2 times the pts well this is saying it is the playback time stamp so it's saying your new playback time stamp is actually going to be twice that of the original wait doesn't it somehow that one still confuses me but then chain that with the FPS filter so now this will take a normal film and slow it down at keep it up still 30 frames a second I've actually implemented this in my myth myth TV set up now where you're saying normal speed AF a set pts and so the set pts equals pts x 0.8 DF do the same exact same thing radio frame and then the same frame rate this is very handy because now you have a one hour movie shorten to 41 minutes you know I have kids I not life I'm not going to sit here put your workout video yeah but the interesting thing so the interesting thing is with the a tempo it actually does pitch correction while it's doing it with that audio filter but if you use that a set pts it actually does more of a cutting think it doesn't actually change so much the tempo or not the UH it does change the tempo but it doesn't actually change the tones of it so in terms of the frequency I can't i'm not entirely sure about that one i think it probably how it operates is it don't sever did basically process it in the raw and then recompress is it so it probably is at the original frame original audio frequency that but I assume it still sounds sounds good yes it still centex for this case 20 millisecond slices it cuts out every fifth one and so retains the same pitch well increasing the tempo but it is if you're unless you really are like home well this is only 41 minutes you kind of it really is hard to see ya so I've seen some of the podcasting clients a science-fiction they can cut that down they also speed up audio can you do the same kind of thing yeah exact same thing you can I can operate entirely on just on audio is with a bunch of because it's a command line I just did it in a for loop said all right for all these five for all these audio files actually set the tone to do this use this video he says audio codec and spit it out and again since its command line you can do that and scrape it all again you can go to you can go twice as fast so you just would set the pts to half of what it would be or if you want to go in faster you can go to ludicrous speed power points so very similar changing the tongue of things can also compose two videos side by side now this one I have an asterisk by because it's in the manual and it's online and documentation is there but I've never done it because that is the actual command yeah from what I get it is saying create a bat a null video with the size of 200 x 100 pixels label at the background and then take the first input video and then not entirely sure what that one does that I have to really look at that one up but again it's facc ffmpeg is so deep scale it down to 100 by 100 pixels and labeled that is left do the same thing for the right then take the background with the left overlay it and then do the same thing with on the right hand side adding a side by side Jean 3d so now i'm sure that can probably it's very easy way of doing it that screen recording so on the lennox side there's the dash F for formats x11 grab video size 1600 x 900 framerate 25 frames a second dash i three input and that's just saying the default video device and dubbing this to freaknik 20 does empat MKV oh ok it was running so here's me editing slides a little bit beforehand but it actually can do screen recording while I was gone VLC has something very similar and I was actually talking with an operator who is speaking next door I believe tomorrow okay I was talking with him a little bit ago and he was saying that there is a crazy Chinese sketchy executable that can do all these crazy things but if you look at it it's a front end for ffmpeg if you handbrake is that one never used handbrake before show of hands pretty much using the ffmpeg kind of crazy but again you can get really in-depth fit you can say you can capture the audio as well with the dash of pulse for pulseaudio you can specify two audio tracks for left right it can also dig in boxing that's also in the workshop tomorrow if anyone's interested in still and you can specify codecs bit rates everything visual one I said I like means so it can also start a mailing list fight so we're not particular with how we communicate at all are we on the mailing list they always say please follow the netiquette when posting on the ffmpeg mailing list especially avoiding top posts if you send it a reply to an email and you don't you'll get a please be on top post it's considered a written back in February one person goes why gmail outlook in thunderbird other and others don't default to top and he was unaware and he kind of I that I had to think Franklin well why is it that way eventually okay there's a lot of good discussion but then there was one guy I really hope it was a troll says gmail.com does not include options to right at the bottom outlook if you have this option but this application is payment evolution does not have that option thunderbird does not have this option if you have came ill but does not allow evarin Singh the ancient texts how was babby formed another person says click the three little dots you reply and I'm the rude when you are insulting and toppled top posting the entire time they're so seriously if you do look at the mailing list archives back in February 2016 you see a little couple of things here there a couple things there and then you see 50 threads and 50 emails to this and it was just a mailing list bite and it was just like all right sit back and watch it burns this is an awesome they need to do weigh in feynman so questions comments complaints session yes sir all right could you prepare to dress the capabilities of ffmpeg vs Man voter ok med encoder is what been designed by the impire group um I actually was really on the fence between ffmpeg and men coder and encoder how are you announce it an encoder has a lot better inverse telecine but back in 2012's whenever they first got the field mash and decimate filters incorporated into ffmpeg personally I just I don't know and players like okay that works but for whatever reason I just I just like ffmpeg more I've not done nearly as much homework with men encoder it has a lot of the same filters a lot of same functionality but for me I just like ffmpeg more there's also a fork from ffmpeg that happened a couple years back called lid AV and Ubuntu part of the reason why I actually switched it away from them was if you type ffmpeg a couple years back with their default repositories it's a oh this command is actually ffmpeg is going to be is now deprecated and will be going away soon it's like what so there's a lot of drama that went into it but basically you want to is using the lib AV team's version of it live AV has hired on developers to do the same thing that the same filters that ffmpeg users have done their developers have done live a bee tends to kind of be more from what I read they tended to be a little bit more snotty and a lot more but we can do it this way we're going to do it this way and do things without they break things all the time ffmpeg developers they tended now they're tending to be a lot more conservative and open and a lot better in terms with their development mailing list so but speaking directly to minh co torn ffmpeg i'm sorry i can't really speak much about that i need to spend more time reading about that one the code where do all those wonderful things yes the only one that only reason why I've ever actually compiled ffmpeg from source and they do have very helpful wiki's on different for compiling on debian compiling on fedora and all the other good layup yummy linux distros out there is the lib f DK AAC so a the ffmpeg group has their own internal AAC decoder but the fraunhofer company group or some of the people who actually came up with the AAC and mp3 specifications to begin with you can't they have their source open as the FD k AAC codec but because of libraries are sorry because of licenses they are restricted from distributing the codec compiled so the solace is available you just need to actually compile it so that is the only reason why I've actually ever compiled the ffmpeg yes sir could you contrast and compare virtualdub virtual notice windows and ffmpeg is Linux and better virtual know whatever goes on windows I use a lot of virtual dub virtualdub by itself does not actually support it only supports a couple different video for windows codex everything has to go through video for windows it only does not handle audio well at all it doesn't view variable frame rates whereas ffmpeg all that is built in native to it and like I said ffmpeg works it's cross-platform so I did actually a lot of testing on the on a windows box using a compiled version those VLC VLC I think veiled it's an interesting relationship between VLC and ffmpeg they're actually VLC is actually last I remember they were actually hosting ffmpeg source and development because of all the live AV fall out and the fork um ffmpeg ffmpeg and VLC use a lot of same codecs like live x264 they use that one quite a bit everyone uses live x264 but I don't I think they use their own internal system they're only lose their own internal stuff and any others yes this drunk it out of the box already has out of the box it would have to be one of the variants of ubuntu like studio boom 2 or whatever it's called um the on a leash with a clinic maybe Lennox I'm asking I honest I don't know I have to take a look at it cookies yes but the big thing is debian now ubuntu I primary I run those mostly so Debbie and I know for a fact and if you just app install ffmpeg pulls ffmpeg and not the lid AV version but the actual from the ffmpeg developers themselves going to does it older versions of Ubuntu jumped but they said they made that switch within the past year i believe [Music] 12 they still were using the lib AV version but you can I'm sure there's a way to change the packages to point to a different version I mean it's open source is Linux okay any others so besides like speeding up your video else you do with it are you using an mpeg-4 mostly what I actually do is I use ffmpeg to encode rip movies and put them on my media share so um routinely put a blu-ray rips on there for personal use obviously entirely um no seriously though I mean pop a DVD in waetford do not do not steal this movie pay for it oh here's the unscalable loading escape soon you pay for it okay or I just use Cody you know click click click streaming across the network work done that kids it's great to kids move translate to a lower quality you know kids don't care and I throw like six thousand won a tablet I've never thought about slowing it down for them but I did a lot of we didn't know what to do but mostly kids movies putting them on my network server so I can watch them anywhere in the house I can watch them whenever I want I have a mythtv set up as well at home that use the ffmpeg script I use some ffmpeg scripts to now they scale it down from so in a magnet TD and codes as MPEG file at eight megabit great quality except if you want to put on your phone or take it anywhere or watch it across the network then I've scripts that actually compress it down to a 720 x 480 resolution change the audio out to a stereo audio boosted by three decibels and then encoded using x264 different presets and all this and then boom what was five gigs as now 120 mex in some cases some people have on older formats such as VHS hmm I've used it to restore some history by with it because it can read directly from video capture yes not necessarily fun as long and yeah very much very well said I've actually was trying to trying to figure out how to do it with my current setup unfortunate looks like I had to buy some more hardware to do just that to convert some home VHS home videos but yes the ffmpeg can read directly from the from the / dev biol the special file that linux gives a video encoder or a video input device and then from there alright hit play enter just dumps it and then there you go perfect hot or not a perfect copy but very good yeah there's your video this is your full-time job now this is my hobby now like I said uh I way back in 2003 2002 I came across a couple it was like seven hundred megabyte movies like how did they do that so I literally downloaded how this the how the the scene rules were for Neverland releasing a video and what's interesting is ffmpeg is actually flat up said don't use it because the audio cover for everything else about it they say severe the audio coder use the Nero codec but you slid x2 still use x264 to encode your video well ffmpeg is using the load x264 it is using probably more up-to-date version than half the people out there are it was the audio encoder is the issue but you can choose different audio code and codecs so but literally i SAT there and I read page after page after page after page and read every d ever read about every option I could about at the time xvid and divx and what every single option was and what how to get the best quality out and then um started like well this does out or not I'm sorry not to sell it ates coming out windows 8 yeah i think is a good time to go to linux so since then I was like all right the only thing I was keeping me back was a video encoder looked around for men encoder ffmpeg live AV tried to kind of hurt what's all of them all right ffmpeg Denis had the to me had the best promise so I said our items spend a year learning that and it took good couple and it took about a year to kind of wrap my head around a lot of the intricacy but it is a very very very powerful program and especially if you can just set it off running in a screen session and walk away SSH back in from a different thing oh hey let me walk pop back in oh it's already done there you go if you have something over at a different location and you just want to you don't care about the size are you dumb sorry you want a smaller size you know you just want to watch on your phone yeah okay ffmpeg scripted shrink it down copy it over to your phone there you go you're sitting there watching last night's episode of the walking dead or whatever on your phone so any others on the problems I had with many quarter is it doesn't do tasks in parallel no mmm every is linear I wonder if ffmpeg leverage a little bit more so every base machine has multiple course right here's if you said in screen walk away when I got 16 cores is going to split 16 job is probably one core for track maybe uh that depends entirely on the codec they AAC encoders are limited to one thread my laptop is a quad core hyper threaded and I can guarantee you it uses one percent of all whenever I'm encoding of the video so it definitely uses up a lot of use of my cpu usage and spends up the fans pretty good it's a good a good heater any others when you open the hendersonville I've got some video to work with gotcha give me an ssh she'll give me a ssh shell okay i can rest SSH n all right let me cut this little video out here okay I need to do this I'll get it to ya yes sir any death if you have much experience like editing video for the command line as opposed to using a GUI with that pathetic is actually that's what I think that's what I want to experiment with just fun right you know it seems like it's obviously you can do it yeah you know you can do a piece at a time or you can do like many like many clips at once into one video so we have you had an experience it's kind of do that my understanding is with if you were going to take if you're going to take one chunk of a video in code that 12 chunk of another video encode that they container the information has to be exactly the same or else they will not concatenate very well they would our copy very well you would need to actually it would have to do a full recompression transcode the entire thing so in that case it's like I could do this but I'm a quality nerd you know the y FF mpegs place in that particular role is to pre and code everything that it's same base level and then we'll everything will see no m-maybe use it later to get into your different output containers link oh yeah but like I said I know for a fact at one point I'm Google actually did use ffmpeg folk to handle you upload one video to youtube and then all right they just had scripts it's erich von this transcoded to this format run this Prince scale it back to this and set the bit right to this and just to all the different formats and resolutions out there it's scriptable you can run everything you set up a for loop to run it I can read as you see it can read pink video I mean come on bean I'll read real audio sorry the real audio real video real audio I think so actually that all right it wasn't terrible okay I was her yep oh wait elicitor because of you I nervous as i see it was all we had a binky nights at a chess i stayed real video your life but I mean yeah I mean it can even when we commander three movies I didn't know that they had oh I guess they did have the video they have mark hamill in it yeah was a part of the tiger yeah heart of the Tigers number three ya know I was wrapped up the killer out there can't remember but yeah I would have thought they use like being for that as well but I know I can read windows media video to Microsoft X and V X 11 the screen capture there you go sony ps3 Wow hmm fantasies all right any others all right thank you very much [Applause]
Info
Channel: phreaknicstaff
Views: 608
Rating: undefined out of 5
Keywords: PhreakNIC, FFmpeg
Id: Dl2kUskbIo4
Channel Id: undefined
Length: 44min 10sec (2650 seconds)
Published: Sat Dec 03 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.