I think I'll post something new I learned every week (mostly weekends). Here goes the first. This is about Video Encoding. Here are somethings I learned in the process of research.
Sources:
Quantization (Image Processing)
HOWTO Mencoder Introduction Guide
Webopedia
Video codecs and formats are not the same thing. MPEG 4 for e.g. is a video format, Xvid is a codec. Codecs create the actual videos.
Then there are multimedia containers. The container is what will contain the encoded video and audio. You can put anything into the container format (as long as it supports it - e.g. video and audio). One e.g. of a container format is AVI.
Some programs to do video encoding:
- VirtualDub (gui + commandline)
- mencoder (commandline)
Some terminology/concepts useful when using these programs:
- Quantization: a lossy compression technique achieved by compressing a range of values to a single quantum value.
- I-frame: also known as the Key frame, these frames contain information frame information without reference to any other frames (think of it as 1 snapshot in a movie; this will make more sense as you read P-frame and B-frame(s) below). Hence I-frames take the most bits to store, but improve the video quality
- P-frame: P-frames follow I-frames and contain information that has changed since that I-frame (such as color information and content change). Hence, they depend on the I-frame to fill in their data. P-frames are also aptly called delta-frames.
- B-frame: B-frames or bi-directional predictive frames rely on the frames preceeding and following them. They contain data of what has changed between the 2 frames.
- GOP: stands for Group of Pictures
The [I/P/B]-frame quantization values range between 1-31. The higher the number, the more compression (hence more loss of information --> smaller file size --> lower quality)
Bitrate is how much bits per second to store the data (higher means more bits are used to store per second of data, meaning more information stored).
Based on the above 2 factors (at least at a basic level), the quality and file size of videos can be controlled. The challenge is to find the right values that would optimize the quality to fit your space needs (possibly time needs as well, i.e. how long you have to encode)
Of course, one thing to be remembered is the encode's quality would depend on the source's quality. It wouldn't matter if you had quantization values of 1 and bitrate of 2000Kbps if the source is very poor)
Also, there are other options you can play with that would have an effect in the quality and time taken like motion detection etc..but think of this as a basic starting point
[ add comment ] | [ 0 trackbacks ] | permalink |




( 2.8 / 24 )
Calendar



