0% found this document useful (0 votes)
17 views

File Formats and Codecs

The document discusses common file formats used in visual effects work, including EXR, TGA, TIFF, PNG, and JPEG. It explains that EXR is a high dynamic range format that supports lossless compression and embedding of multiple render passes. TGA supports up to 32 bits per channel but is not HDR. TIFF can be HDR and supports various compression types. PNG is useful for sequences due to lossless compression and relatively small file sizes. JPEGs and GIFs are generally not suitable due to loss of quality from compression.

Uploaded by

Mohd Ruman
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

File Formats and Codecs

The document discusses common file formats used in visual effects work, including EXR, TGA, TIFF, PNG, and JPEG. It explains that EXR is a high dynamic range format that supports lossless compression and embedding of multiple render passes. TGA supports up to 32 bits per channel but is not HDR. TIFF can be HDR and supports various compression types. PNG is useful for sequences due to lossless compression and relatively small file sizes. JPEGs and GIFs are generally not suitable due to loss of quality from compression.

Uploaded by

Mohd Ruman
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

https://www.pluralsight.

com/blog/film-games/vfx-file-formats-
you-need-to-know

Because a video file is a single file that contains all of your


project's frames, any time there any errors that cause an
incomplete file it, means you need to re-render the entire video
file.
Then again, instead of rendering out one really big video file
you can render out a bunch of smaller image files where one
image file equates to a frame of your project.
When the inevitable happens and the render crashes, you'll
need to re-render the entire file exactly the same as if it were a
video file, but instead of this re-render being all of the frames
it's just the image files for the frames that crashed.

Common Image File Formats


Whether you're rendering out of 3D software or just rendering
down smaller compositions in your compositor, there are
countless image formats out there that can be used with VFX
software. Which format you use can really just be personal
preference, but there are always pros and cons to each file
format that you should know about. So let's take a look at some
of the most common formats you'll need to keep in mind so you
can decide what will work best for your projects. It's important
to point out there are quite a few proprietary formats that can
be very useful depending on your workflow. These weren't
covered simply because you're probably going to need to use
them if their native software is in your pipeline. For example,
PSD or AI files from Photoshop and Illustrator are popular
enough formats that they are accepted by a wide range of VFX
software. However, if Photoshop isn't in your pipeline, you
probably don't have much benefit to rendering out PSDs. For
that reason we're going to focus on non-proprietary, standard
image file formats.
OpenEXR (EXR)
The EXR file format is an incredibly powerful image file format
that is both high dynamic-range (HDR) and surprisingly space
efficient. It was originally created by ILM specifically for use in
the VFX industry and, since it's creation, has quickly caught on
as an industry standard format supported by most high-end 3D
and compositing programs. If you're rendering with a linear
workflow and want to save space while maintaining quality
with lossless compression or rendering a lot of passes, the EXR
file format is a great option. While it supports 32 bits per
channel (bpc), it's more common to use half of that at 16 bpc.
One reason you may want to use 16 bpc instead of 32 bpc is
simply because half of the data takes a lot less time to render,
and for most projects you won't notice much of a difference in
the output quality. Another great feature of the EXR format is
you can embed multiple render passes into a single image
sequence. You can learn more about OpenEXR on it's site.
Targa (TGA)
TGA files are very common in the industry because they can
still offer great quality and are very widely supported. This file
format was originally created by Truevision. And although TGA
files aren't HDR, they are a solid choice if you're not working in
HDR and you're not sure what other format to use. When you're
using the TGA format, you'll most commonly run into an option
to save in either 24 or 32-bit. That extra 8 bits is the alpha
channel; so basically a 24-bit TGA includes red, green and blue
(RGB) channels whereas a 32-bit TGA file will include red,
green, blue and alpha (RGBA) channels. You can learn more
about the TGA file format here.
Tagged Image File Format (TIFF)
While this certainly isn't how it originated, the easiest way to
think of TIFF files is as a merger of EXR and TGA files.
Actually, the TIFF file format was originally created by a
company who was subsequently bought by Adobe for use in the
graphic design industry. Like TGA files, TIFF files are used
widely both inside and outside of the VFX industry. And like
EXR files, TIFF files are HDR that can support up to 32 bpc.
When using TIFF files, you'll have the ability to choose from
various compression types including lossless compression.
Just be aware that not all software will support the various
compression types TIFF offers. So which one you choose really
depends on what's supported by the software you want to use.
If you're not sure what compressions your compositing software
supports, you can always go for uncompressed for the widest
range of support. Unfortunately though, uncompressed TIFF
files can take up quite a bit more space than either TGA or EXR
files. For example, when rendering out an image sequence it's
perfectly normal to see 32-bit (RGBA) non-HDR TIFF files that
can almost be five times the size of comparable PNG files. This
can really start to eat away at hard drive space unnecessarily
when you're rendering out a lot of sequences. You can learn
more about TIFF files here.
Portable Network Graphics (PNG)
While it is commonly known for its use in web design, the PNG
file format is actually used quite a bit in the VFX industry as a
solid alternative to the TGA format. Like the TGA file format, a
PNG file isn't HDR, but it can support 32-bit images with up to 8
bpc for each of the red, green, blue and alpha (RGBA)
channels. By far the biggest benefits to using the PNG file
format as a VFX artist is it can offer alpha and lossless image
compression, all while maintaining a relatively small file size. If
you've got a lot of image sequences that you'll be rendering out
of a tool like After Effects, PNG files are a great alternative to the
slightly larger TGA files. You can learn more about the PNG file
format on it's site.
Image File Formats to Stay Away From
As previously mentioned, there are a lot of file formats out
there. Just like a lot of these lend themselves to being
beneficial for VFX artists, there are a lot of formats you
probably should avoid using regularly unless there's a good
reason to.
JPEG
The JPEG file format is one of, if not the most, popular image
format on the internet. As a result, it's something every VFX
artist is going to get from time to time either as reference, stock
or even assets to use. Unfortunately, the JPEG file format
doesn't have the ability to be lossless. So every time a JPEG
image is saved, it loses a little more quality. They might look
great on the internet, but that doesn't always translate to
looking good in your VFX projects. Use JPEGs with caution
and, if possible, try to find a lossless file format.
GIF
Like the JPEG format, another common file format on the
internet is the GIF file format. Technically, GIF files might seem
like they'd be a good file format for VFX work. They can be
uncompressed (or there's some lossless compression support
as well), have alpha channels, and are relatively small in size.
However, the algorithms behind the GIF file format simply don't
support the color range required for VFX work. Hence, most
GIF files you'll find can't retain full photographic range of colors,
and the quality suffers pretty significantly. If at all possible, you
should try to avoid the GIF file format for your VFX projects.
http://www.spherevfx.com/written-training/miscellaneous-written-
training/file-formats-channels-and-colour-depth/

File Formats, Channels and Colour Depth


When choosing the correct file formats to work with, people will tend to either
use .jpg or .tga because they’ve been using it for years, or have no idea what to
use out of the tens of formats available. The aim of this section is to demystify
file formats by breaking them down into four main areas of consideration: type,
number of channels, colour depth and compression.
2D File Formats
2D film formats are those formats that hold only 2D image data and metadata,
not 3D information.
Below are a list of the more common 2D film formats used in the visual effects
industry:
.avi (Audio Video Interleave)
.cin (Kodak Cineon Bitmap)
.dpx (Digital Picture Exchange)
.dtex (Deep Textures)
.exr (openEXR)
.hdr (High Dynamic Range Image)
.jpg (Joint Photographic Group)
.iff (Interchange File Format)
.png (Portable Network Graphic)
.psd (Adobe Photoshop Document)
.mov (QuickTime)
.r3d (RedCode Raw)
.sgi (Silicon Graphics Image)
.ptex (Per-Face Texture Map)
.tif (Tagged Image File Format)
.tga (Truevision Targa Graphics)
.rla (Wavefront RLA)
.psd (Adobe Photoshop Document)
2D Colour Depths
When it comes to talking about colour depths there is an old school mindset that
can sometimes bring confusion. Below is a screen grab from the 2014 Autodesk
3dsMax manual (Managing Scenes, Files, and Projects > Image File Formats
> TGA (Targa) Files). Note the wording on the left, 24 or 32 bits. This is
assuming 24 bits is RGB and 32 bits is RGB + Alpha.
The thought behind this is that 8 bits (256 colours per channel) + 8 bits + 8 bits
= 24 bits. Then when you add in another 8 bits for the Alpha you get 32 bits –
this seems to make sense, but it’s wrong! We know this because a .tga file can
only support 16.7 million colours.
The correct bit depths are listed below.
1 bit (integer) 2 colours per channel 8 colours
2 bit (integer) 4 colours per channel 64 colours
4 bit (integer) 16 colours per channel 4,098 colours
8 bit (integer) 256 colours per channel 16,777,216 colours
10 bit (integer) 1,024 colours per channel 1,073,741,824 (1 billion)
colours
16 bit (integer) 65,536 colours per channel 281,474,976,710,656 (281
thousand billion) colours
32 bit (integer) 4,294,967,296 colours per 7.92281625142643e28 (80
channel octillion) colours

Working out the maths…


2^bit depth, ie 2^8 = 256 Colour Per Channel
256³ (or 256x256x256) = 16,777,216 (16.7 million)
Based on the ‘Short scale, U.S. and Modern British’
The next question is, which file formats support which bit depths?

8 bit 10 bit 16 bit 32 bit


.bmp (integer) .cin (float) .cin (float) .exr (float)
.jpg (integer) .dpx (float) .dpx (float) .hdr (float)
.png (integer) .exr (float) .psd (float)
.rla (integer) .iff (integer) .rla (integer)
.sgi (integer) .psd (float) .tif (float)
.tif (float) .png (integer) .dtex (float)
.tga (integer) .rla (integer) .ptex (float)
.yuv (integer) .sgi (integer)
.tif (float)

Float vs. Integer


Some file formats can support both Integer and Float (or Log) whereas others
are only Integer. With 16 bit for example, both formats still hold the same
number of colours but Float can vary the range of data (HDR support) whereas
Integer can only support values from 0 to 1.

In computing, floating point describes a method of representing real numbers in


a way that can support a wide range of values. Numbers are, in general,
represented approximately to a fixed number of significant digits and scaled
using an exponent. The base for the scaling is normally 2, 10 or 16. A number is
typically represented in the form:
Significant digits × base exponent
The term floating point refers to the fact that the radix point (decimal point, or,
more commonly in computers, binary point) can “float”; that is, it can be placed
anywhere relative to the significant digits of the number. This position is
indicated separately in the internal representation, and floating-point
representation can thus be thought of as a computer realisation of scientific
notation. Over the years, a variety of floating-point representations have been
used in computers. However, since the 1990s, the most commonly encountered
representation is that defined by the IEEE 754 Standard.
The advantage of floating-point representation over fixed-point and integer
representation is that it can support a much wider range of values. For example,
a fixed-point representation that has seven decimal digits with two decimal
places can represent the numbers 12345.67, 123.45, 1.23 and so on, whereas a
floating-point representation (such as the IEEE 754 decimal32 format) with
seven decimal digits could in addition represent 1.234567, 123456.7,
0.00001234567, 1234567000000000, and so on. The floating-point format
needs slightly more storage (to encode the position of the radix point), so when
stored in the same space, floating-point numbers achieve their greater range at
the expense of precision.
The speed of floating-point operations, commonly referred to in performance
measurements as FLOPS, is an important machine characteristic, especially in
software that performs large-scale mathematical calculations.

Channels

The next option for file formats after how many colours they can support, is the
number of channels they can hold. For example a .jpg can support only colour
(RGB) so it has 3 channels. Where as a .tga can support RGB and Alpha, so it
can hold up to 4 channels of data.

Below is a chart showing the various Visual Effects file formats arranged by the
number of channels each can support.

3 channels 4 channels 6 channels 18 channels 500 1,023


.avi .dpx .ptex .rla channels channels
.cin .mov .psd .exr
.hdr .pic .tif
.jpg .png
.ptex
.tga
https://www.pluralsight.com/blog/creative-professional/understanding-video-formats-uses

Understanding Video Formats and Their Uses


By Pluralsight on March 27, 2014

Containers and Codecs

All video files are made up of two key components: A container and a codec. Of these, the
container is the most visible to you on a computer because it's identified by its extension. For
example, a file with an .mov file extension is a video file that has the QuickTime container
extension. What's not so readily visible is the codec. A codec is the driver for how the
container format is decoded by the program. There may be hundreds of codecs that are
available for each container type and without the correct codecs installed on your computer, it
won't know how to open the video file properly.

To get a better idea of how containers and codecs work together, let's look at a metaphor in
the real world. A simple tin can have any number of things inside of it. It is, very literally, a
versatile container that could hold anything from food, oil, paint or even compressed gasses.
The label on the outside is how you know what its contents are and, by extension, what type
of container it is. Depending on the type of container is probably going to determine how
you'll open the can. For example, you probably won't try to pry open a can containing
compressed gasses in the same way you would a can that contains food. Just knowing what's
inside isn't quite good enough. You'll need to know what to do with the contents. For this,
many tin cans have some simple directions for what to do with its contents printed directly on
the label. It could be anything from instructions on how to open the can to a recipe for the
contents once you have it open.
This is essentially how a computer handles video files. The file extension is a label that tells the
computer what container type the video file is. By knowing the container type, the computer knows
how it needs to open the file. For instance, an .mov file might open in QuickTime's native player
whereas an .avi file could open in Windows Media Player. But just like knowing the container type
for the tin can isn't enough in the real world, a computer needs more than just knowing what type of
container a video file is. That's where the codec comes in. The codec is basically the directions for
how to play the video once it's opened.

Identifying Containers and Codecs

The easiest way to identify the container format for any given video file is to show the file extension
on your computer. Once you've done that, the file extension will tell you what the container type is.
As mentioned previously, codecs aren't as easy to see. In most cases, you'll want to go to the
properties of the video file in your video player. The exact steps are going to vary depending on your
player. For the sake of this example, we'll use the VideoLAN Client (VLC) player because it can let
you see codecs and works on a wide range of operating systems. With VLC, once you open the video
file you can go to Tools > Codec Information to see what codec was used for the video.
https://www.makeuseof.com/tag/all-you-need-to-know-about-video-codecs-containers-and-compression/

All You Need to Know about Video Codecs, Containers, and Compression
Bryan Clark March 13, 2015
What Is a Codec?
A codec – or coder/decoder – is an encoding tool that processes video and stores it in a
stream of bytes. Codecs use algorithms to effectively shrink the size of the audio or video
file, and then decompress it when needed. There are dozens of different types of codecs, and
each uses a different technology in order to encode and shrink your video file for the
intended application.
Depending on the codec, this encoding occurs in one of two ways: lossy or a lossless
compression.

Lossy Compression
When looking for manageable file sizes, lossy compression is the most viable method
available. While you certainly lose quality in audio, video, or both, the compression is a
necessary evil (currently) in a world dominated by the need to share and store what would
otherwise amount to impractical file sizes. Your average Blu-ray, for example, can exceed 40
gigabytes, and that sort of storage space would not only be expensive, but it’d make digital
downloads and purchases inconvenient, if not an outright waste of time. The key when using
lossy compression is to settle on the highest quality compression format for your intended
use, so that you walk the fine line between loss of quality, and file size.

Lossless Compression
Lossless compression works much like a ZIP or RAR file in that after compressing and
decompressing, the file is essentially the same. Through use of smart algorithms, the file doesn’t lose
much quality, but it’s not an efficient way to store large files because there isn’t much compression
that actually takes place. In addition, online transmission of large video files uses far too much
bandwidth (although H.265 encoding may change that) to make it a viable compression option.
Unless you work in the film industry, or in video editing, it’s unlikely you’ll ever share video files in a
lossless format (if even then). To put it into perspective, even a 4k television doesn’t contain the
resolution needed to display a film shot on a modern camera and delivered without some sort of
compression. In fact, it’s not even close (yet). While 4k video is beautiful, it’s not even close to the
size of an uncompressed video format.
While a Blu-ray film is less than 50 gigabytes (if it has to fit on one disc), the first downloadable 4k
movie is a whopping 160 gigabytes!
Completely uncompressed 1080p video is a mind-boggling 410 gigabytes per hour, and that doesn’t
include the audio file, which could add an additional 7 gigabytes per hour depending on how it was
recorded. All-in-all, these files are all but useless for a consumer market with current technology.

It’s also important to note that codecs aren’t just for compression of audio and video files. Once a
file has been encoded using a specific codec, that same codec must be used to decode the file in order
for it to play on your device. Not using the correct codec is what leads to the majority of device
compatibility or playback issues. This issue is becoming less common as modern containers often
include the required audio and video codecs needed to play the file.

Popular Codecs
XviD/DivX
DivX is a commercially sold codec, while XviD is an open source utility meant to function as an
alternative to its commercial cousin. Both codecs can decode the output of the other, as they are both
built on the implementation of MPEG-4. While still widely used, its often strictly for video encoding
and in conjunction with one of the more popular packs mentioned below.
MPEG-4
MPEG-4 is the most common streaming format and it consists of many parts, of which only MPEG-4
Part II is used for video coding. MPEG-4 Part II calls on video encoders such as DivX or XviD in
order to encode the video, while audio is typically carried in MP3 format. Modern updates to MPEG-
4 are now using H.264 as well.
H.264
This is the most popular choice for high definition material. H.264 is also a relative Swiss Army knife
of the codec world as it can utilize both lossy and lossless compression depending on the settings you
choose when encoding, such as frame rate, quality, and target file size. H.264 relies on x264 for
encoded video (as well as others, such as DivX or XviD), and audio is often encoded using AAC or
MP3 audio codecs depending on the size and quality you’re targeting.
H.264 is touted as 1.5 to 2 times as efficient as basic MPEG-4 compression, which leads to smaller
file sizes and seamless playback on more devices. That said, H.264 is now included in the MPEG-4
codec (part 10, known as AVC), so it could become a moot point in the near future as the codecs
become less reliant on a single encoding technology, and instead take on the role of a codec pack
which includes multiple encoding methods in a single package.
What is a Container?
A container exists solely for the purpose of bundling all of the audio, video, and codec files into one
organized package. In addition, the container often contains chapter information for DVD or Blu-rayBlu
movies, metadata, subtitles, and/or additional audio files such as different spoken languages. The
typical container runs like an executable (.exe) file on Windows. It uses a .bat file to tell the operating
system that there are executable le commands that need to be run together in order to achieve the
intended result.
Popular Containers
Flash Video (.flv, .swf)
Macromedia originally created Flash before they were ultimately acquired by Adobe in 2005. Flash is
an aging container that is being
ng phased out due to limitations in the technology, creating what Steve
Jobs used to refer to as “buggy” file handling. This led to a very public omission from iOS devices for
Adobe and it appears that this was the beginning of the end for the format. As HTML5
standardization takes hold,, we should see less Flash videos online, and the container is most likely
going to disappear with it.
MKV
MKV is a rapidly growing format that was designed to be future-proof.proof. The container itself supports
almost any audio or video format which makes it adaptable, efficient, and highly regarded as one of
the best – if not the best – ways to store audio and video files. In addition, it even supports multiple
audio,
udio, video and subtitle files even if they are encoded in different formats. Due to the options the
container offers, as well as its handling of error recovery (which allows you to play back corrupted
files), it has quickly become one of the best containe
containers currently available.
MP4
MP4 is the recommended format for uploading video to the web,, and services such as Vimeo and
YouTube have it listed as their preferred format. The MP4 container utilizes MPEG MPEG-4 encoding, or
H.264, as well as AAC or AC3 for audio. It’s widely supported on most consumer devices, and the
most common container used for online video. You really ca can’t
n’t go wrong with MP4.
The bottom line is, a container is a (mostly) useless bit of information when referring to video. Telling
someone to send you an MP4 file doesn’t give away any useful bits of information without
understanding how the video and audio itself were encoded. The container is just that, a place to store
the audio, video and the codecs needed to decode them for playback.
So, ultimately if you’re looking for advice on what to use, H.264 is quickly becoming the standard
codec, while either mp4 or MKV are worthy containers. MP4 might get the edge here because it is
better supported in consumer devices, and is the standard for most large streaming video sites.
Ultimately, the choice is yours, and as long as the video can be decoded and played on the other end,
there really aren’t a lot of bad choices you can make in terms of what to use

You might also like