Archive for the ‘Video Encoding’ Category

I have bought an EasyCAP

Tuesday, October 21st, 2008

So i have a lot of family videos on several analog media (VHS-C, Super VHS, Hi-8 and 8mm) that i want to finally convert to something not so vulnerable to aging, DVD being an option but Blu-Ray saying “me! me!” on my head.

Even the fact that I have several workstations with professional level video capture devices, those machines are usually working doing renders or any other thing and is not that I can waste days capturing all that media there, so i decided to buy one of those EasyCap devices on eBay and give it a try.

The specifications are pretty outstanding for what it is, and specially, for the $15 price… AND it is compatible with Mac OS (by using the non-free VideoGlide app) which makes it even better.

Just some highlights:

  • Complies with Universal Serial Bus Specification Rev 2.0
  • Supports NTSC, PAL (B), Video format
  • Video input: RCA composite or S-Video
  • Audio input: Stereo audio (RCA)
  • Dimension(Main Body): 8.8cm x 2.8cm x 1.8cm typical credit card size is 8.5cmx5.4cm)
  • Powers by USB 
  • Supports high quality video resolution for 
  • NTSC: 720 x 480 @30fps
  • PAL: 720 x 576 @25fps

Im still waiting for it to arrive, and i will post several video examples and personal impressions as soon as i get it.

iPhone and iPod Touch compatible video encoding, server side.

Sunday, October 12th, 2008

Some days ago, I published a tutorial with some bash scripts to automate the whole process of encoding MP4 files with H264 video and HE-AAC audio which are playable by flash players and the like.

Since I’m working on a really big project which involves a “youtube like” behavior, i though it would be cool to also create iPhone / iPod compatible streams (I’m amazed at the fact that 3% of the people coming to this site is using iPod’s or iPhone’s)… so, I did some modifications to the original script for it to generate the compatible streams.

Now, how am i dealing with this… well… let me explain you:

The iPhone specification states:

Video formats supported: H.264 video, up to 1.5 Mbps, 640 by 480 pixels, 30 frames per second, Low-Complexity version of the H.264 Baseline Profile with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; H.264 video, up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Baseline Profile up to Level 3.0 with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; MPEG-4 video, up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats

This means that the high profile streams that I am generating with the MKMP4 script won’t play, simple as that. So i have 2 possible approachs:

  1. I could just use a single low profile stream for the iPhone and iPod, and since the stream is H264 and low complexity AAC audio, it will just play fine on the flash players too.
  2. I could have 2 different files, one for the flash players (making use of b-frames, entropy coding, and a high profile stream, which substantially improves the final video quality).

I decided to use the option 2, mostly because i want to give desktop users as much quality as possible, and i want to use the HE-AAC encoder to save some extra bandwidth that i can instead use for the video stream, so I am using 2 different files, one for desktop users, and a different one for iPhone or iPod users.

(more…)

MKMP4: An automated H264 / HE-AAC (aacPlus) encoder script for Mac and Linux / Unix

Friday, September 26th, 2008

I have been nothing but amazed about the feedback that i got on my prior tutorials on how to automate the whole chain of free and open source tools to create amazing quality video at really low bitrates (great for flash streaming, etcetera).

I usually write such tools and scripts for myself or for clients, but due to the fact that it seems a lot of people is interested in the process, I’m releasing here the new version of my encoding tools for the Mac and any Linux / Unix variant.

Needed tools and applications

For all this to work, you will need the following things

Extra pre-requisites for Mac OS X

Mac OS X users need to install the Apple Developer Tools (aka XCode) in order to compile software, also, for building the x264 encoder, you will need to get and install YASM.

Now, you have to build and install all the tools, AND they have to be on any directory in your executable path. My scripts assume that all the tools are in your executable path.
(more…)

An automated and rock-solid encoding engine solution for your youtube-like site.

Tuesday, August 5th, 2008

It was some days ago when i was contacted by one of the visitors of this blog in order to create a “black box” solution to solve the video encoding part of a video sharing website similar to youtube.com.

As you maybe know, i have posted some months ago a really basic script to automate some of the tasks, but, what about integration with your actual website framework ? what about queue management, what about multi-server encoding environment ?

Those are all the usual questions when a potential customer calls, so i spent some days developing a complete black-box solution for this issue, using all open-source software, with the following features.

  • Fully automatic video encoding queue management.
  • Support for 1 to n encoding nodes with fully automatic transaction control (still in beta-testing).
  • Support for the following video formats: Windows Media, Quicktime, DV, Avid DV, DivX, xVid and almost any imaginable format (any format supported by mplayer is actually 100% supported)
  • Support for HE-AAC audio (Stereo near-CD quality sound at 48kbps).
  • Fully automatic thumbnail generation in 3 different positions of the video stream, supported output formats are JPG, PNG and GIF.
  • Fully automatic metadata injection, including all the popular “iTunes like” tags.
  • Fully automatic iPod Touch / iPhone compatible stream generation.
  • Support for more than 1 output format (managed from a presets file).
  • Fully automatic Pixel and Display aspect ratio correction for proper video resizing and scaling.
  • Possibility to select how many CPU cores to use for the encoding process (only on multicore cpu’s)

There are a several more features that I’m still developing. If you are interested and you want more details, you can contact me at: diego (at sign here) massanti.com. I don’t bite ;)

MediaInfo for Mac: Know everything about your media files.

Wednesday, January 30th, 2008

You should consider this piece of software my “hello world” project in the Mac development arena, because, even the fact that i have pretty good skills when it comes to OO development, I’m totally new when it comes to the Mac, and I’m using this project mainly as a learning experience.

Attention: download links were moved

In order to keep things organized, the download links and general information for MediaInfo Mac were moved into this new website.

MediaInfo Mac ScreenshotIn the past few days i have been working in a full Aqua version of a linux tool called “Mediainfo”, so this is the result.
Let me introduce you to “MediaInfo Mac”.

MediaInfo Mac does just one thing: it gives you a lot of information about multimedia files, even files that QuickTime can’t read, and it does that by using a custom Universal Binary build of the linux library “libmediainfo” by Jerome Martinez as its core.
This application is obviously OpenSource and i will make all the sources available as soon as i finish cleaning the code and configuring an SVN repository on this server.
MediaInfo Mac requires any PowerPC or Intel Macintosh computer running MacOS X 10.4 “Tiger” or newer.
If you have any question or suggestion, feel free to leave your comment below :).

A BIG thank you goes to Rainer Brockerhoff, (who is a true monster in the Macintosh development area), for having the patience to answer a lot of my questions, and also, to the guys at #macdev on freenode for helping me to understand a lot of things in the “Cocoa Arena”. Thank you, i really appreciate your time.

In order to keep things in organized, anything in relation with MediaInfo Mac is going to be on this new website.

IF you are any kind of software tracker, there is a feed with MediaInfo updates, and it is compatible with the AppCast definition.

Encoding high quality h.264 / aacPlus v2 media for web streaming with Flash 9, version 2.

Tuesday, January 1st, 2008

Update Notice

This post has been updated with a newer and improved script and instructions, please visit the new one HERE.

It was some months ago when I wrote a tutorial about how to encode good quality h.264 video with aacPlus audio in order to use the great capabilities of the new flash player version 9.0.115 (that in case you missed it, now can play h264 video and aacPlus v2 audio).
Due to some personal convictions for my prior tutorial, i decided to use FFMPEG, and while it does the job pretty well, it has some limitations (specially in the video scaling / resizing area). So in my particular case, I had to use several php / bash scripts in order to feed the encoders with the proper resizing data, etcetera.
Well, let me introduce you to the 2nd version of my h.264 / aacPlus v2 tutorial.

This time I used Mencoder, an amazing tool that comes with the mPlayer package, and i also created what i think is a really nice bash script to make the process almost 100% smooth and simple.

These are the things you will need:

(more…)

Creating good quality h264 video for the upcoming Flash Player and Flash Media Server

Friday, September 28th, 2007

Important

This tutorial has been updated (and improved) a lot, for the new version please follow this link.

UPDATE: I realized that when i read a tutorial about anything, in most cases, i want to first see what result im going to get so then i can decide if the tutorial is worth reading (or not), so here is a head by head comparison: 

This is an h264 file encoded by the guys at apple.com, it’s the TV Commercial for the brand new iMac: ORIGINAL VIDEO

This is the same file re-encoded using the steps on this tutorial: RE-ENCODED VIDEO

Obviouisly, there is an small quality degradation, but keep in mind that apple’s original movie is 14MB in size, while mine is 1.5MB ;).
You can play my MP4 video with almost any video player out there, but remember that not all video players out there support HE-AAC audio (or aacPlus) and b-frames, so if you play the file with a player like QuickTime, it is NOT going to work.
I recommend mPlayer or VLC media player to play this kind of video, and obviously, Flash Player will play the file perfectly too.

Update for Macintosh users:

I updated the bash script on this post so it can be used also by Macintosh users, so instead of using the NERO Digital AAC Encoder, Macintosh users can take advantage of the native 3GPP AAC Plus V2 encoder that i just compiled. Visit this post for more information about it.

Like a lot of people out there, i was really happy when i found the press release from Adobe, stating the addition of h.264 video support and HE-AAC Plus audio to their upcoming Flash Player versions, and also, to the upcoming Flash Media Server.
After following several “Tutorials” all over the web, i found that there was not any single one that gave me the results that i wanted; that is, good video quality, with the less possible file size, so after a lot of trial and error and after a lot of help and optimizations by the guys at the ffmpeg and x264 IRC channels, i decided to create this tutorial that will most probably help you a lot to encode good quality h264 video, with HE-AAC Plus Audio, and all this inside an MP4 container with tags and all ready to deliver to your visitors.

There are several things that you will need in order to do this:

Some friendly bookmarks:
SVN checkout for x264:
svn checkout svn://svn.videolan.org/vlc/trunk vlc-trunk
SVN checkout for ffmpeg:
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg

First of all, I’m assuming that you are running Linux, Mac-OS X or any other UNIX variant. I never tried this on windows because I am pretty sure that there are lot of really nice programs that you could buy to do the job.
(more…)