GoPro CineForm® is a 12-bit, full-frame wavelet compression video codec. It is designed for speed and quality, at the expense of a very high compression size. Image compression is a balance of size, speed and quality, and you can only choose two. CineForm was the first of its type to focus on speed, while supporting higher bit depths for image quality. More recent examples would be Avid DNxHD® and Apple ProRes®, although both divide the image into blocks using DCT. The full frame wavelet as a subject quality advantage over DCTs, so you can compression more without classic ringing or block artifact issues.
Pixel formats supported:
- 8/10/16-bit YUV 4:2:2 compressed as 10-bit, progressive or interlace
- 8/10/16-bit RGB 4:4:4 compressed at 12-bit progressive
- 8/16-bit RGBA 4:4:4:4 compressed at 12-bit progressive
- 12/16-bit CFA Bayer RAW, log encoded and compressed at 12-bit progressive
- Dual channel stereoscopic/3D in any of the above.
VLC could not decode the format 'CFHD' (CineForm)' So far to get around this I've used this plugin, but it's limited to 2.2.4 and it has some bugs in playing multiple video files. Does anyone else have the same issue? I tried on another machine with no luck. Codec not supported: VLC could not decode the format 'CFHD' (No description for this codec) jbk on Feb 2, 2016. This codec was RE'd 2 weeks ago and was merged in FFmpeg and libavcodec this weekend, by a member of the VideoLAN non-profit organization. Expect it in VLC.
Compression ratio: between 10:1 and 4:1 are typical, greater ranges are possible. CineForm is a constant quality design, bit-rates will vary as needed for the scene. Whereas most other intermediate video codecs are a constant bit-rate design, quality varies depending on the scene.
- The complete source to CineForm Encoder and Decoder SDK. C and C++ with hand-optimized SSE2 intrinsics for x86/x64 platforms, with cross platform threading.
- TestCFHD - demo code for using the encoder and decoder SDKs as a guide to adding CineForm to your applications.
- WaveletDemo - a simple educational utility for modeling the wavelet compression.
- CMake support for building all projects.
- Tested on:
- macOS High Sierra with XCode v8 & v9
- Windows 10 with Visual Studio 2015 & 2017
- Ubuntu 16.04 with gcc v5.4
CineForm-SDK is licensed under either:
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Setup
Clone the project from Github (git clone https://github.com/gopro/cineform-sdk).You will need CMake version 3.5.1 or better for the full SDK.WaveletDemo is just three files: wavelets.c, utils.c, utils.h so it can be easy build without CMake.
Using TestCFHD
After building it.
This tool uses the just build CineForm SDK to compress and decompress a generated image, testing the codec with a range of images and pixel formats. Open TestCFHD.cpp to learn of configuration options.
Configuring TestCFHD
Within Example/TestCFHD.cpp, here are some key configuration controls:
The TestCFHD defaults to using the asynchronous encoder for the greatest performance on multi-core systems, which encodes ‘n’ frames simultaneously. For the highest performance, the number of frames to encode at once should match the number of CPU threads available, set by POOL_THREADS. To keep you CPU busy, have a POOL_QUEUE_LENGTH greater than the number of CPUs.
Asynchronous performance on a 4Ghz 8 core Broadwell E system:
Decoding Existing Files
As this is origin source it should decode all existing CineForm AVI or MOV files. Two sample files have been included showing YUV 4:2:2 and RGB 4:4:4 encoding.
Using WaveletDemo
After building it.
Files showing the decoded image, and differences and stored within ..data
Configuring WaveletDemo
Within Example/WaveletDemo/wavelets.c: here are some key configuration controls:
Play with the BITDEPTH, to see the impact on quality. Change the number of LEVELS to see how wavelets work. Set the ERRORGAIN to amplify the difference between the source and the decoded image. Increase the GENERATIONS to see it makes very little difference on the quality.
The CineForm video codec was developed in between 2001 and 2002 as a light weight compressed alternative for DV or other consumer formats of the time. However its notoriety wouldn’t come unto around 2003 when CineForm HD when was developed, which moved the codec a from consumer 8-bit YUV, to offering 10-bit YUV and 12-bit RGB/RGBA for more professional digital intermediate work. The codec was ideal for the transition to HD, as its efficiency improved with the resolution increase, a bonus of it being a native Wavelet codec. Also as wavelet’s can be designed to do sub-resolution decoding at a very high rate, editing of HD would perform like SD (fast) whenever needed.
CineForm RAW was added in 2005, the first to offer substantial compression directly from CFA Bayer image sensor data. Once RAW was a compression profile, this is when CineForm stopped being like other codecs, which strive to encode (compress) and decode (decompress) to the same or as close as possible to the source image. Compressing RAW was straight forward, but decompressing back to RAW didn’t help the workflow, as most video editing tools (even today) do not handle native RAW well. To support RAW workflows the CineForm decoder would “develop” the image, applying demosaicing filters, color matrices, CDL color corrections and 3D LUTs before presenting the decoded image to the NLE, compositor or video editing tool. CineForm is still the only codec that does this, it was marketed as Active Metadata.
Active Metadata was used to enable stereoscopic 3D encoding and presentation, the third significant major feature addition to the codec core (first HD, second RAW.) The 3D support within the CineForm codec, was one of the reasons leading to the CineForm acquisition by GoPro in 2011.
Over the last six years at GoPro, the CineForm codec has been licensed to Adobe, FXHome and others and was tweaked and made into a standard through SMPTE as VC-5. VC-5 is a superset of the CineForm compression engine, it is better defined and can handle more pixel formats and resolutions than CineForm, although doesn’t include the Active Metadata engine, nor does it have a performance implementation for video yet. GoPro added VC-5 to their GoPro Hero5/6 Black edition cameras for compressing RAW photos – in camera a 24MByte DNG would be stored as a 4-7MByte GPR file using VC-5 compression.
There is a fourth wave for the original CineForm, as resolution goes beyond 4K, the benefits of wavelet compression are seen again. This demand for higher resolution is coming from 360° video production. GoPro’s Omni 360° rig would output 8Kp30 or 6Kp60 as CineForm files, as there is little else with the efficiency and performance to encode such demanding content. The upcoming GoPro Fusion, and small form-factor 360° camera shooting over 5K, will lead to a lot more CineForm content.
Wavelet Transforms
The wavelet used within CineForm is (mostly) a 2D three-level 2-6 Wavelet. As that will mean very little to most, the WaveletDemo has been included to help learn the principles. If you look up wavelets on Wikipedia, prepare to get confused fast. Wavelet compression of images is fairly simple if you don’t get distracted by the theory. The wavelet is a one dimensional filter that separates low frequency data from high frequency data, and the math is simple. For each two pixels in an image simply add them (low frequency):
- low frequency sample = pixel[x] + pixel[x+1]
- two inputs, is the ‘2’ part of 2-6 Wavelet.
For high frequency it can be as simple as the difference of the same two pixels:
- high frequency sample = pixel[x] - pixel[x+1]
- this would be a 2-2 Wavelet, also called a HAAR wavelet.
For a 2-6 wavelet this math is for the high frequency:
- high frequency sample = pixel[x] - pixel[x+1] + (-pixel[x-2] - pixel[x-1] + pixel[x+2] + pixel[x+3])/8
- i.e 6 inputs for the high frequency, the ‘6’ part of 2-6 Wavelet.
The math doesn’t get much more complex than that.
To wavelet compress a monochrome frame (color can be compressed as separate monochrome channels), we start with a 2D array of pixels (a.k.a image.)
If you store data with low frequencies (low pass) on the left and the high frequencies (high pass) on the right you get the image below. A low pass image is basically the average, and high pass image is like an edge enhance.
You repeat the same operation vertically using the previous output as the input image.
Resulting in a 1 level 2D wavelet:
For a two level wavelet, you repeat the same horizontal and vertical wavelet operations of the top left quadrant to provide:
Repeating again for the third level.
Vlc Codecs Windows 10
Quantization
All that grey is easy to compress. The reason there is very little information seen in these high frequency regions of the image (generated from WaveletDemo) is the high frequency data has been quantized. The human eye is not very good at seeing subtle changes in high frequency regions, so this is exploited by scaling the high-frequency samples before they are stored:
- high frequency sample = (wavelet output) / quantizer
Entropy Coding
After the wavelet and quantization stages, you have the same number of samples as the original source. The compression is achieved as the samples are no longer evenly distributed (after wavelet and quantization.) There are many many zeros and ones, than higher values, so we can store all these values more efficiently, often up to 10 times more so.
Run length
The output of the quantization stage has a lot of zeros, and many in a row. Additional compression is achieved by counting runs of zeros, and storing them like: a “z15” for 15 zeros, rather than “0,0,0,0,0,0,0,0,0,0,0,0,0,0,0”
Variable length coding
After all previous steps the high frequency samples are stored with a variable length coding scheme. In CineForm classic Huffman coding is used. Again a lot of theory is turned into a table which maps sample values to codewords with differing bit lengths – not a lot of complexity.
The lack of complexity is what makes CineForm fast.
To Decode
Reverse all the steps.
While I showed that the steps involved are fairly simple, and much can be modeled in only 800 lines of source code (WavetletDemo), the CineForm SDK is currently over 160k lines of code. There are many paths through the CineForm codec that where hand-optimized, each path for different source pixel format – back in 2003 realtime encoding of 1920x1080 was bleeding edge. There are also older bitstream formats supported by the SDK, even a 3D wavelet (volumetric, not stereoscopic) from 2003 which compressed two frames into one crazy wavelet. There are old tools for handling interlaced that are quite different than progressive image encoding. Finally there is all the Active Metadata code for color development, stereoscopic and 360 projection, which extends this codec to being a lightweight video editing engine – all the realtime effects within GoPro Studio use this engine.
← Back to VLC Features
This is a new page that lists the audio/video codecs that VLC can or cannot read. It is still under development, don't hesitate to add a some FourCC and infos.
It should now be a bit more complete than the official features page on VideoLAN website.
If you have any question about those codecs, just consult our Knowledge Base or our friends on the Multimedia Wiki. If you don't find information, search with Wikipedia or Google.
- 1Video Codecs
Video Codecs
Widely Used Video Codecs
Name | FOURCC | Playable | Encoder | library | Comment |
---|---|---|---|---|---|
MPEG-1 Part 2 | mpeg, mp1v, mpg1, PIM1 | Yes | Yes | libmpeg2 , ffmpeg | |
MPEG-2 Part 2 | mp2v, mpg2, vcr2, hdv1, hdv2, hdv3, mx*n, mx*p | Yes | Yes | libmpeg2 , ffmpeg | |
MJPEG (A/B) | Yes | Yes | ffmpeg | ||
Divx (1, 2, 3) | DIV1, DIV2, DIV3, mp41, mp42, MPG4, MPG3 | Yes | Yes | ffmpeg | |
DivX 4, 5, 6 , 3ivx D4, MPEG-4 | DIV4, DIV5, DIV6, col1, col0, 3ivd | Yes | Yes | ffmpeg | |
MPEG-4 Part 2 (AVP), Xvid | DIVX, Xvid, mp4s, m4s2, xvid, mp4v, fmp4, 3iv2, smp4, ... | Yes | Yes | ffmpeg | |
H.261 | h261 | Yes | Yes | ffmpeg | |
H.262 | h262 | Yes | Yes | ffmpeg | Same as MPEG-2 Video |
H.263 / H.263i | h263 | Yes | Yes | ffmpeg | |
H.264 / X.264 (MPEG-4/AVC) (MPEG-4 Part.10) | h264, s264, AVC1, DAVC, H264, X264, VSSH | Yes | Yes | ffmpeg (decode), x264 (encode) | |
Sorenson 1 (Quicktime) | SVQ 1 | Yes | Yes | ffmpeg | |
Sorenson 3 (Quicktime) | SVQ 3 | Yes | No | ffmpeg | |
DV | Yes | Yes | ffmpeg | ||
Cinepak | cvid | Yes | No | internal, ffmpeg | |
Theora | thra | Yes | Yes, violated | libtheora | |
WMV 1/2 (7/8) | wmv1, wmv2 | Yes | Yes | ffmepg | |
WMV 3 / WMV-9 / VC-1 | wmv3, wvc1, wmva | Yes | No | ffmpeg | Not all profiles are supported. See DMO. |
On2 VP3, | VP31, VP30, VP3 | Yes | No | ffmpeg | |
On2 VP5 | VP50, VP5, VP51 | Yes | No | ffmpeg | |
On2 VP6 (used by FLV) | VP60, VP61, VP62, VP6F, VP6A | Yes | Yes | ffmpeg | |
On2 VP7 | VP7 | No | No | ||
Flash Screen Video | FSV1 | Yes | Yes | ffmpeg | |
Indeo Video 3 | IV31, IV32 | Yes | No | ffmpeg | |
Indeo Video 4/5 | IV41, IV51 | Yes | No | libavcodec | |
Real Video 1.0, 1.3, 2.0 | RV10, RV13, RV20 | Yes | Yes | ffmpeg | |
Real Video 3.0, 4.0 | RV30, RV40 | No | No | ||
Dirac | BBCD | Yes | Yes | dirac | |
Huffyuv / | Yes | Yes | ffmpeg |
Rarer Video Codecs
Rare codecs | FOURCC | Decoder | Encoder | library | Comment |
---|---|---|---|---|---|
Apple Animation, Graphics, Video, QuickDraw | 'rle','smc ','rpza', 'qdrw' | Yes | No | ffmpeg | |
SheerVideo | No | No | Professional use, no open source decoders | ||
CorePNG | ?? | ?? | |||
MSU Lossless | ?? | ?? | |||
Snow | Yes | Yes | |||
Pixlet | ?? | ?? | |||
Rare codecs (Asus V1, Asus V2) | ASV1, ASV2 | Yes | Yes | ffmpeg | |
Game Codecs (Some) | Yes | No | ffmpeg | ||
Tarkin | No | No | |||
QPEG | QPEG | Yes | untested ??? | ffmpeg |
Audio Codecs
Name | FOURCC | Decoder | Encoder | library | Comment |
---|---|---|---|---|---|
MPEG-Audio 1 Layer-1/2 | mpga | Yes | Yes | libmad (decoding), twolame (encoding) | ISO/IEC MPEG |
MP3 | mp3, .mp3, LAME | Yes | Yes | libmad (decoding), ffmpeg-mp3lame | ISO/IEC MPEG - (recompile needed for encoding) |
AAC | mp4a | Yes | Yes | faad (decode), faac (encoding) | ISO/IEC MPEG |
HE-AAC | Yes | untested ??? | faad (decode), libaacplus + ffmpeg (encoding) | ISO/IEC MPEG, AAC+ encoding through libaacplus + ffmpeg (patched) - untested RECOMPILE VLC & ffmpeg for this Audio codec | |
AC-3 | a52, a52b | Yes | Yes | liba52 (decode), ffmpeg (encode) | |
ATRAC | atrc | Yes | No | ||
iLBC | ILBC, ilbc | untested ??? | untested ??? | QuickTime (decode) | (check for encoder and free decoder) |
Mu-Law | Yes | No | ffmpeg | (check for encoder) | |
NellyMoser | Yes | No | ffmpeg | ||
QCELP (PureVoice) | Qclp | Yes | No? | ffmpeg | Usually in QCP container. buggy? |
Real Audio | lpcJ, 28_8, dnet, sipr, cook, atrc, raac, racp, ralf | Yes | No | Some work. Half don't | |
Shorten | shrn | No | No | ffmpeg and ffplay do it. VLC doesn't. (It is in the FOURCC list in VLC's modules/codec/avcodec/fourcc.c --Dionoea) | |
Speex | spex | Yes | Yes | libspeex | |
Vorbis | vorb | Yes | Yes | libvorbis | |
DTS | dts | Yes | No | libdca | DTS-HD unsupported |
MPC | Yes | No | libmpcdec | ||
WMA 1/2 | wma1, wma2 | Yes | Yes, violated | ffmpeg | WMA9 is not supported |
Flac | flac | Yes | Yes | libflac | lossless |
Apple Lossless Audio Codec | alac | Yes | No | ffmpeg | lossless |
Monkey's Audio | Yes | No | lossless | ||
Musepack | Yes | No | libmpcdec | ||
ADMPCM (various) | Yes | Yes | ffmpeg and internal | ||
AMR | samr | Yes | Yes | ffmpeg + libamrnb + libamrwb | RECOMPILE VLC for this Speech codec |
Sonic | SONC | Yes | Yes | ffmpeg |
Cfhd Codec For Vlc
Subtitles Codecs
- Transcluded from Subtitles codecs
Subtitle Name | Extension | Subtitle Type | Character Encoding | Line Break | Text Styling | Metadata Info | Timings | Timing Precision | VLC media player Support |
---|---|---|---|---|---|---|---|---|---|
AQTitle | *.aqt | Text-based | None | Yes | No | No | Framings | Dependent on Frame | Yes (0.9.0 and over) |
Blu-Ray | N/A | Image-based | N/A | N/A | N/A | No | Elapsed Time | Unknown | Yes (1.1.0 and over) |
CVD subtitles | *.cvd | Image-based | N/A | N/A | N/A | No | Elapsed Time | Unknown | Yes |
DKS | *.dks | Text-based | None | Yes | No | No | Elapsed Time | Unknown | Yes (0.9.0 and over) |
DVB subtitles | N/A (in DVB streams) | Image-based | N/A | N/A | N/A | No | Elapsed Time | Unknown | Yes |
DVD subtitles | N/A | Image-based | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown |
JACOsub | *.jss | Text-based | None | Yes | Yes | No | Elapsed Time | 10 Milliseconds (1/100th sec) | Yes (0.9.0 and over), no styles |
Kate | N/A (inside OGG) | Text-based | None | Yes | Yes | No | Unknown | Unknown | Yes (0.9.0 and over), no styles |
MicroDVD | *.sub | Text-based | None | Yes | No | No | Framings | Dependent on Frames | Yes |
MPEG-4 Timed Text | .ttxt | XML | Unknown | Unknown | Yes | No | Elapsed Time | 1 Millisecond | Yes |
MPL2 | *.mpl/.txt | Text-based | None | Yes | No | No | Sequential Time | 100 Milliseconds (1/10th sec) | Yes, no italic |
MPSub | *.sub | Text-based | None | Yes | No | Yes | Sequential Time | 10 Milliseconds (1/100th sec) | Yes (0.9.0 and over) |
OggWrit | N/A (inside Oggs) | Text-based | None | No | Yes | Yes | Sequential Granules | Dependent on Bitstream | untested ???- Not specified yet. |
Phoenix Subtitle | *.pjs | Text-based | None | No | No | No | Framings | Dependent on Frames | Yes (0.9.0 and over) |
PowerDivX | .psb | Text-based | None | No | No | No | Elapsed Time | 1 Second | Yes (0.9.0 and over) |
RealText / SMIL | *.rt | HTML-based | Unicode (UTF-8) | Yes | Yes (SMIL) | No | Elapsed Time | 10 Milliseconds (1/100th sec) | Yes (0.9.0 and over) |
SAMI | *.smi | HTML-based | Unicode (Windows-1252) | Yes | Yes (CSS) | Yes | Framings | Dependent on Frames | Yes |
Structured Subtitle Format | .ssf | XML | None | No | Yes | Yes | Elapsed Time | 1 Millisecond | No |
SubRip | *.srt | Text-based | Informally Unicode | Yes | No | No | Elapsed Time | 1 Millisecond (1/1000th sec) | Yes |
SubStation Alpha | *.ssa/.ass | Text-based | None | No | Yes | Yes | Elapsed Time | 10 Milliseconds (1/100th sec) | Yes, 0.9.0 and over |
SubViewer | *.sub | Text-based | None | Yes | No | Yes | Elapsed Time | 10 Milliseconds (1/100th sec) | Yes |
SVCD subtitles | *.svcd | Image-based | N/A | N/A | N/A | No | Elapsed Time | Unknown | Yes |
Teletext | Unknown | Text-based | Unknown | Unknown | Unknown | Unknown | Unknown | Unknown | Yes |
Universal Subtitle | *.usf | XML | Unicode (UTF-8) | No | Yes (XML DTD) | No | Elapsed Time | 1 Millisecond (1/1000th sec) | Yes, 0.9.0 and over |
VobSub | *.sub, *.idx | Image-based | N/A | N/A | N/A | N/A | Elapsed Time | 1 Millisecond (1/1000th sec) | Yes |
VPlayer | *.txt | Text-based | None | Yes | No | No | Framing or Time | 10 Milliseconds (1/100th sec) | Yes |
XSUB (DivX subtitles) | N/A (embedded in .divx) | Image-based | N/A | N/A | N/A | No | Elapsed Time | 1 Millisecond | Yes (1.1.0 and over) |
Codecs For Vlc Media Player
Format/Container/Muxers
Name | extensions | Playable | Savable | Comment |
---|---|---|---|---|
3GP | .3gp | Yes | untested ??? | |
AIFF | .asf, .wmv | Yes | No | |
ASF | .asf, .wmv | Yes | Yes | |
AU | .au | Yes | ||
AVI | .avi | Yes | Yes, violated | |
DMF | untested ??? | untested ??? | ||
FLV | .flv | Yes | Yes | through ffmpeg |
MOV | .mov | Yes | Yes | |
MP4 | .mp4 | Yes | Yes | |
OGG | .ogm, .ogg | Yes | Yes | |
MKV | .mkv, .mka | Yes | No, WIP | Summer of Code 2007 Project |
MPEG-2 / TS | .ts, .mpg | Yes | Yes | |
MPEG-2 / ES, PS, PVA, MP3 | .mpg, .mp3, .mp2 | Yes | Yes | |
NSC | .nsc | Yes | No | |
NSV | .nsv | Yes | No | |
Nut | .nut | Yes | Yes | Muxable through libavformat |
Real | .ra, .ram, .rm, .rv , .rmbv | Partial | No | version 4 and 5, no support for version 3 |
Raw (a52, dts, aac, flac, .dv, .vid) | .a52, .dts, .aac, .flac, .dv, .vid | Yes | ?? | |
True Audio Codec | .tta, .tac | Yes | No | |
Ty Tivo | .ty | Yes | No | |
Wav | .wav, .dts | Yes | Yes | |
Xa | .xa | Yes | No |
HD-Discs codecs
- Transcluded from HD-Discs codecs
Codec | VLC 1.0 | VLC 1.1 | VLC 1.2 | VLC 3.0.6 | Remarks |
---|---|---|---|---|---|
H.264 | Yes | Yes | Yes | GPU acceleration recommended VLC DxVA2 or VLC VAAPI. | |
VC-1 | Partial | Partial | Partial | VC-1 Interlaced isn't ready | |
MPEG-2 | Yes | Yes | Yes | FFmpeg or libmpeg2 | |
EAC3 | Yes | Yes | Yes | FFmpeg, libavcodec > 52.0 | |
TrueHD | Yes | Yes | Yes | FFmpeg, libavcodec > 52.40 | |
DTS Core | Yes | Yes | Yes | libdca or FFmpeg | |
DTS-HD Master Audio | No | No | No | Core is played | |
Blu-Ray Subtitles | No | Yes, libavcodec > 52.40 | Yes | FFmpeg | |
HD-DVD Subtitles | No | No | No | ||
HD-DVD Files (.evo) | No | No | No | ||
Blu-Ray folders | Partial | Partial | Partial | ||
Discs | No | No | Partial |