Use FFmpeg!

<!-- USE FFMPEG -->



FFmpeg is the Swiss Army Knife of command line tools for video and audio. It does many things you already want; for example, FFmpeg makes it easy to convert between almost any video or audio format you can think of. It also does some cool things you may not have considered trying before, like facilitating the usage of YouTube as a gigantic downloadable mp3 library. Also, considering that Flash video is the more or less the de facto official video format of the web (and thereby appears to be the future of video on the web), FLV is a very important format to be able to convert from and to. FFmpeg makes this work incredibly easy.

Let's start this tutorial/guide with the mp3 stuff, then move on to more basic/intended usage, and then go on to something cool.

Extracting mp3 from YouTube videos (2 steps):

Let's say you like a song you heard on YouTube, but cannot find the mp3 anywhere online and there's nothing available at the record store. Back in the 1980s you would have been screwed -- you might have been upset enough to try a new drug called "crack" cocaine. But now with The Internet and FFmpeg, you can avoid becoming addicted to crack by downloading a DRM-free mp3 file that will play anywhere, directly from the YouTube video itself! Here's how:

  • First, download the video from YouTube. You can find the .flv file in the source code, but services like KeepVid have utilized YouTube's API to easily allow you to download the video directly from YouTube's server's in a higher quality .mp4 format.
  • Second, take the video, "video.mp4" and run it through FFmpeg like this:
    ffmpeg -i video.mp4 -ab 192k audio.mp3
    This will give you an mp3 with a fairly standard quality of 192kbps. You can make that value higher or lower if it pleases you, but remember your source: audio from a YouTube video. The saying, "You can't polish a turd," is true.

Extracting a clip from a longer video (1 step):

Let's say you really like a segment of a movie, and want to share it with the world. Here's how you can post it to YouTube using free software, make sure the audio syncs up with the video (often times it doesn't, if a certain option is not included in the command) and upload it faster than the dopes uploading video in mpeg or avi format:
ffmpeg -ss 00:06:09 -t 00:00:15 -i mmm.avi -async 1 -qscale 3.5 -vcodec flv seriously.flv
The first part of the command -ss 00:06:09 -t 00:00:15 means to start at 00:06:09 into the movie, and to play for 15 seconds. -i mmm.avi is where you tell FFmpeg to use mmm.avi as the input file. Yes, that's right -- you define the segment before you define the input file.

-async 1 is optional, but it is very helpful for a situation where the audio in your new cropped clip does not sync up with the video.

-qscale 3.5 is a variable command that changes the quality of your cropped clip. 3.5 is a good value here for YouTube -- it seems about equal to the quality of YouTube videos. A lower value means a higher quality. When you're happy (or frustrated to the point of not being able to work any more) with the results, simply upload to YouTube.

If you want to do something cool, like make a mux (or music video, if you prefer that term) a la Pink Floyd + The Wizard of Oz, try this:
ffmpeg -ss 00:04:25 -t 00:05:15 -i superman.avi -i grandma.mp3 -map 0:0 -map 1:0 -qscale 3.5 -vcodec flv killer.flv
When you want to make a simple video like what we're describing, this is a good way to do it. There are a couple of examples here.

The only option we haven't gone over yet here is -map. This is used in conjunction with the two input files to tell FFmpeg where to put them in the output. Here we have the first input file going to stream position 0 on output file 0 and the second input file is going to position 1. -map options correspond to the position in the command of input files -- so the first -map tells FFmpeg where to map the first input file specified in the command, the second tells where to map the second input file, and so on. It will make more sense if you try it. Use the format above if you get lost.

If you want to do something cooler, like this, where multiple video files are combined (see intro and outro), you will need to use another command line tool called cat. This tool concatenates files (it joins them together). It doesn't work with all video formats -- for instance, it will not work with .flv, but it will work with .avi. It also doesn't play nicely with certain differences between files, such as differences in video dimensions or bitrate. To really use this tool well you may need to consult the man page for ffmpeg or some mailing lists to see how other people solved their problems...but if you just need to join two files, here's how you do it:
cat mick.avi killar.avi > killar-milk.avi
And after this, you should run the resulting file killar-milk.avi through FFmpeg to rebuild the part of the file that tell video players their duration. If you don't, you probably won't be able to see the entire new video.

Since videos with different resolutions are incompatible, here's a hint that should help you combine two videos of different resolutions: you can resize videos with the -s option. the format is wxh (width x height) so if you want your video to be 480x196, your option looks like this:
-s 480x196

Hope all this helps. Leave questions and comments in the comments area. Try combining these commands in new and novel ways to achieve interesting results. Really freak it. At the very least, post something online that has never been posted before; it's easy.

When you use the right tools, the Internet is your oyster.


FFmpeg is available for Linux, Mac, and Windows. Officially it's only available to be compiled from source, but you can use Google to easily find a build for your operating system. If you use Linux, check your favorite repository for your chosen distro -- if it isn't included, abandon your distro for a good one.

ffmpeg is pretty fucking cool.

241 comments:

«Oldest   ‹Older   201 – 241 of 241   Newer›   Newest»
casinositezone.com said...

I wanted to thank you for this excellent read!! I definitely loved every little bit of it. I have you bookmarked your site to check out the new stuff you post. I am writing on this topic, so I think it will help a lot. I leave my blog address below. Please visit once.! 토토
<

SEO CANADA said...

Some truly nice and utilitarian info on this internet site , besides I think the layout holds wonderful features 안전놀이터

UFABET1688 said...

It’s perfect time to make some plans for the longer term and it is time to be happy. I’ve learn this post and if I could I desire to counsel you some fascinating issues or tips. Perhaps you can write next articles regarding this article. I want to read more issues about it. แทงบอลยังไงให้รวย

สล็อตxo said...

I don't think it can be one of those who analyzed the important advice that I found in the specified location. My family and I thank you for your generosity, and you can follow the airline you choose. Thank you for your important information that you receive on your website.สล็อตxo

dgdfgerg said...

Hello! I could have sworn Iíve visited this website before but after going through a few of the posts I realized itís new to me. Regardless, Iím certainly delighted I came across it and Iíll be bookmarking it and checking back regularly! 메이저놀이터

Anonymous said...

Thank you for wonderful website..Yeah, i agree with what was said in your blog. Thank you very much for all the info. and your hard work..I invite you to the page where you can read with interesting information on similar topics. 토토꽁머니

dgdfgerg said...

I found that site very usefull and this survey is very cirious, I ' ve never seen a blog that demand a survey for this actions, very curious..hi was just seeing if you minded a comment. i like your website and the thme you picked is super. I will be back. 먹튀검증커뮤니티

Anonymous said...

That’s the reason concentrate on you have to particular footwork ahead of when writing. Is going to be feasible in order to much more appealing article in this way..I would like to thank you for the efforts you have made in writing this article 꽁머니3만

Owen Rida said...

Terrific article! That is the kind of information that are meant to be..shared across the internet. Disgrace on the search engines.together with everyone’s favorite activity, sex.Two foot fetish guys, one of which wanted me to smear peanut butter on my feet. 안전공원

Robert11 said...

Wonderful illustrated information. I thank you about that. No doubt it will be very useful for my future projects. Would like to see some other posts on the same subject! That is a beneficial viewpoint, however isn’t make every sence whatsoever dealing with which mather. Any method thanks in addition to i had make an effort to share your current post straight into delicius but it surely is apparently an issue using your websites is it possible to you should recheck this. many thanks again. Nice post. I learn something more challenging on different blogs everyday. It will always be stimulating to read content from other writers and practice a little something from their store. I’d prefer to use some with the content on my blog whether you don’t mind. 먹튀폴리스보증업체

Robert11 said...

I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! keep up the good work 먹튀폴리스

Anonymous said...

I should say only that its awesome! The blog is informational and always produce amazing things. Best transport

CiLlian said...


This seems to be the age of the entrepreneur,
슬롯사이트

Here I am once again trying to explain things to people.
슬롯사이트

Blight said...


We stumbled over here by a different website and thought I might check things out
검증카지노

These are genuinely wonderful ideas in about blogging.
온라인카지노


Anonymous said...

great inspiring article. Schlüsseldienst Helmstedt

Anonymous said...

Wow! Such an먹튀검색

Anonymous said...

First rate data! I. 토토궁

Anonymous said...

very exciting and includes sets of wonderful information . 토담토담토토

Anonymous said...

sets of wonderful information . 토담토담토토

hastenchemical said...

Fly Ash proves to be a vital component for construction in Florida, enhancing the strength and durability of concrete. Its sustainable properties make it an eco-friendly choice, contributing to greener building practices across the state. Embrace Fly Ash for Florida for your construction needs and build with environmental responsibility in mind.

Charbonnel said...

Indulge in the rich and delectable taste of a chocolate bar in Riyadh. Whether you prefer classic favorites or exotic blends, Riyadh offers a delightful array of chocolatey delights to satisfy your cravings. Treat yourself to a heavenly experience of cocoa goodness in the heart of the desert city.

leadingit said...

At the forefront of technological innovation, this leadingit company in UAE pioneers transformative solutions. With a dynamic blend of expertise and vision, they propel businesses towards digital excellence. Elevating industries through cutting-edge services, they stand as a beacon of progress in the UAE's IT landscape.

Anonymous said...

heavy equipment catering in midland texas delivers seamless solutions for large-scale operations. Ensuring uninterrupted efficiency, this service provides on-site sustenance to crews operating heavy machinery. Elevate productivity with convenient and nourishing catering tailored to the demands of the industry.

Antony said...

The article was up to the point and described the information about education and learning.
New Jersey Federal Criminal Lawyer
New Jersey Federal Criminal Defense Lawyer

johnnydepp said...

very useful tutorial. Lexington Reckless Driving

johnnydepp said...

very useful. Lexington Reckless Driving

Tara said...

"Step into the world of health and fitness with AHFR Blog, your comprehensive guide to wellness. Explore expert advice, evidence-based insights, and transformative stories. Whether you're on a fitness journey or seeking nutritional wisdom, AHFR Blog is your trusted companion for a healthier, happier lifestyle."
dui lawyer new kent va





Tara said...

The "Fuckin-FFmpeg" blog is a technical haven for multimedia enthusiasts and developers. Dive into insightful content covering FFmpeg, a powerful multimedia framework. With a blend of tutorials, tips, and updates, this blog provides a comprehensive resource for navigating the intricacies of FFmpeg and enhancing multimedia processing capabilities.
reckless driving lawyer virginia





Tara said...

The "Fuckin-FFmpeg" blog is a technical sanctuary for multimedia enthusiasts. Dive into a wealth of content covering FFmpeg, a potent multimedia framework. With tutorials, tips, and updates, this blog serves as a comprehensive resource, empowering readers to navigate the intricacies of FFmpeg and enhance their multimedia processing capabilities.
reckless driving lawyer virginia





Tara said...

The "Fuckin-FFmpeg" blog is a no-nonsense guide to mastering FFmpeg, the powerful multimedia framework. Dive into concise tutorials and practical tips that demystify video and audio processing, offering a straightforward approach to harnessing FFmpeg's capabilities. Elevate your multimedia skills with this blog's frank and informative content.
divorce lawyers stafford va





Anonymous said...

A DUI Attorney in Fairfax, VA Provides Skilled Defense. They negotiate the complexities of DUI accusations, refute the evidence, and lessen punishments thanks to their strategic acumen and local understanding. Put your trust in their knowledge to protect your rights and get the best result for your Fairfax, Virginia case.
DUI Lawyer Fairfax VA

shofialisa said...

FFmpeg is a powerful open-source software suite that allows users to record, convert, and stream audio and video content across various platforms. Renowned for its versatility and wide range of capabilities, FFmpeg supports a multitude of audio and video formats, making it a popular choice for multimedia enthusiasts, content creators, and developers alike. traffic lawyer chesterfield virginia

Tara said...

AHFR Blog is your go-to source for all things health, fitness, and lifestyle. With expert insights and practical tips, it guides readers on their journey to a healthier, more balanced life. From fitness routines to nutrition advice, AHFR Blog is a trusted companion for those seeking a holistic approach to well-being.reckless driving lawyer virginia





Tara said...

"Step into the world of health and fitness with AHFR Blog, your go-to source for expert insights and wellness inspiration. From workout routines to nutrition tips, AHFR delivers actionable advice to elevate your health journey. Embrace a vibrant lifestyle and stay informed on the latest trends with AHFR's dynamic and informative blog."
traffic lawyer manassas va




파워볼사이트 said...

Thanks for share your information.

gostopsite.com said...

Woah! I'm really enjoying the template/theme of this website.

sportstotomen.com said...

This is very interesting, You’re an excessively skilled blogger

19guide03.com said...

Thank you for providing a good quality article.

slotplayground.com said...

Woah! It’s simple article, yet effective. Thanks for this

Relax said...

Sharing your favorite movie segment on YouTube can be a breeze with the right tools and techniques. Ensuring audio-video sync and faster uploads elevates your viewing experience. After the tech-savvy task, unwind and relax at the Massage Center in Karachi for a well-deserved break from the digital world.

Direct Admission in SIBM Pune said...

Great Article Shared. Thanks

«Oldest ‹Older   201 – 241 of 241   Newer› Newest»

Post a Comment