<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Shutter Angle &#187; video compression</title>
	<atom:link href="http://www.shutterangle.com/tag/video-compression/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.shutterangle.com</link>
	<description>The science and magic of shooting moving pictures</description>
	<lastBuildDate>Thu, 23 Apr 2015 09:19:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Introducing slimRAW: A Fast CinemaDNG Raw Video Compressor</title>
		<link>https://www.shutterangle.com/2015/slimraw-cinemadng-raw-video-lossless-compressor/</link>
		<comments>https://www.shutterangle.com/2015/slimraw-cinemadng-raw-video-lossless-compressor/#comments</comments>
		<pubDate>Wed, 22 Apr 2015 11:18:10 +0000</pubDate>
		<dc:creator>cpc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CinemaDNG]]></category>
		<category><![CDATA[raw video]]></category>
		<category><![CDATA[video compression]]></category>

		<guid isPermaLink="false">http://www.shutterangle.com/?p=2047</guid>
		<description><![CDATA[<p>CinemaDNG lossless compression has been an interest of mine for some time. I&#8217;ve described a possible workflow before. But it had some issues and the (lack of) speed was annoying, to say the least. So I&#8217;ve been thinking about a better solution.
This led to the creation of slimRAW. A fast CinemaDNG  [...]</p><p><a href="https://www.shutterangle.com/2015/slimraw-cinemadng-raw-video-lossless-compressor/">Introducing slimRAW: A Fast CinemaDNG Raw Video Compressor</a></p>]]></description>
			<content:encoded><![CDATA[<p>CinemaDNG lossless compression has been an interest of mine for some time. I&#8217;ve described a possible workflow <a href="http://www.shutterangle.com/2014/lossless-compression-for-dng-raw-video-dngstrip/">before</a>. But it had some issues and the (lack of) speed was annoying, to say the least. So I&#8217;ve been thinking about a better solution.</p>
<p>This led to the creation of <strong>slimRAW</strong>. A fast CinemaDNG compressor developed by yours truly.<span id="more-2047"></span><br />
<br />
<a href="http://www.slimraw.com"><img src="http://www.shutterangle.com/wp-content/uploads/2015/04/slimRAW-logo.png" alt="" width="548" height="113" class="aligncenter size-full wp-image-2060" /></a></p>
<p>slimRAW supports all types of uncompressed CinemaDNG and DNG raw video that I could get my hands on. It has been tested to work with footage from Blackmagic Design Cinema Camera (pre firmware 2.1); Digital Bolex D16; Sony FS700/FS7 CinemaDNG raw recorded through Convergent Design Odyssey 7Q/7Q+; Canon DSLR Magic Lantern raw converted to CinemaDNG/DNG through any of the available converters; Ikonoskop A-Cam dii; uncompressed CinemaDNG from Kinefinity cameras (including 6K from the KineMAX); Fastec Imaging TS and HiSpec high speed cameras; Indiecam indiePOV and indieGS2K (12-bit footage). Other sources are likely to work if the footage is 8, 12, 14 or 16-bit (but no guarantees).</p>
<p>slimRAW losslessly compressed CinemaDNG output has been tested to import fine in Blackmagic Design daVinci Resolve, Assimilate Scratch, The Foundry NUKE, Adobe Premiere Pro CC, Adobe SpeedGrade CC, and in Adobe software using Adobe Camera Raw for CinemaDNG/DNG import &#8211; After Effects, Photoshop, Lightroom. It should also work in any CinemaDNG conformant software.</p>
<p>An obvious application of slimRAW is to compress existing uncompressed CinemaDNG footage and free storage space without any loss of quality. But there is more to it. An important goal in development was to achieve faster than real time compression speeds. This would allow for practical offload-with-compression on location in one step: offloading video from camera or recorder storage to main storage while compressing it in the same time.</p>
<p>slimRAW compression was coded from scratch for performance. Processing is parallel and scales with available CPU cores. Example processing speeds (on a 3.4ghz Intel i7-4770 under Windows 7, running footage off SSD): around 110fps for Digital Bolex D16 2K CinemaDNG uncompressed footage and around 70fps for Blackmagic Design Cinema Camera 2.5K CinemaDNG uncompressed footage. slimRAW is fast enough that in a lot of cases performance is limited by storage bandwidth and not by the CPU. SSDs and RAID certainly help with that.</p>
<p>slimRAW also achieves the best compression ratios I&#8217;ve seen for lossless CinemaDNG compression (including software and hardware, i.e. cameras outputting losslessly compressed CinemaDNG). Lossless compression ratios aren&#8217;t fixed. They depend on the nature of source material: noisy and detailed footage will compress less than clean and defocused footage. With test footage from various cameras slimRAW compression ratios range from around 1.5:1 to 2.8:1 (a reduction of size to 66-35% of the original size). Some clips actually break the 3:1 barrier.</p>
<div id="attachment_2051" class="wp-caption aligncenter" style="width: 610px"><a href="http://www.shutterangle.com/wp-content/uploads/2015/04/sr-done.png"><img src="http://www.shutterangle.com/wp-content/uploads/2015/04/sr-done.png" alt="slimRAW CinemaDNG lossless compression" width="600" class="size-full wp-image-2051" /></a><p class="wp-caption-text">slimRAW has just finished working on some Canon 5D Mark3 Magic Lantern raw DNG footage.</p></div>
<p>slimRAW preserves all the original metadata. This includes CinemaDNG specific metadata like time code, frame rate, T-stop, etc. It doesn&#8217;t touch the color matrices or any other color related metadata. This means that in any video production application supporting losslessly compressed CinemaDNG there is no difference between the original files and the losslessly compressed files. Moreover, the compressed files should be easy to swap in place of the originals in existing projects. Applications using Adobe Camera Raw are exceptions since ACR modifies metadata in the input files on import and records settings in there.</p>
<p>Since support for CinemaDNG in Premiere Pro CC and SpeedGrade CC is incomplete, slimRAW provides a user selectable option to output losslessly compressed CinemaDNG files compatible with these two applications. The trade-off is a small sacrifice of compression. As a curious bonus feature, slimRAW can actually convert some uncompressed DNG video which is unsupported in Premiere CC to losslessly compressed DNG video which works with Premiere CC. The most notable example is DNG video converted from Canon Magic Lantern raw with ML&#8217;s raw2dng: Premiere CC will reject the uncompressed DNG video, but the slimRAW losslessly compressed sequences will import fine. </p>
<p>To recap, a few nice points about slimRAW:</p>
<ul>
<li>Speed.</li>
<li>Optimal compression ratios.</li>
<li>CinemaDNG metadata preservation.</li>
<li>Output compatible with a bunch of video production software.</i>
<li>Can offload-with-compression.</li>
<li>Checksum generation to help track data integrity through post.</li>
<li>Versions for both Windows and OS X.</li>
</ul>
<p>Read more on <a href="http://www.slimraw.com" title="slimRAW: lossless compression for CinemaDNG raw video">slimRAW&#8217;s website</a>.</p>
<p><em>Thanks to <a href="http://schoolpost.ca/" target="_blank">Csaba Nagy</a> and <a href="https://frankglencairn.wordpress.com/" target="_blank">Frank Glencairn</a> for testing and discussion.</em></p>
<p><a href="https://www.shutterangle.com/2015/slimraw-cinemadng-raw-video-lossless-compressor/">Introducing slimRAW: A Fast CinemaDNG Raw Video Compressor</a></p>]]></content:encoded>
			<wfw:commentRss>https://www.shutterangle.com/2015/slimraw-cinemadng-raw-video-lossless-compressor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lossless Compression for DNG Raw Video</title>
		<link>https://www.shutterangle.com/2014/lossless-compression-for-dng-raw-video-dngstrip/</link>
		<comments>https://www.shutterangle.com/2014/lossless-compression-for-dng-raw-video-dngstrip/#comments</comments>
		<pubDate>Thu, 27 Mar 2014 21:26:35 +0000</pubDate>
		<dc:creator>cpc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DNGStrip]]></category>
		<category><![CDATA[raw video]]></category>
		<category><![CDATA[video compression]]></category>

		<guid isPermaLink="false">http://www.shutterangle.com/?p=1767</guid>
		<description><![CDATA[<p>There are a lot of good things about raw video but data size is not amongst them. Uncompressed raw video can quickly add up and fill storage. One way of handling the size problem in post-production is to do some initial adjustments on the raw video, then bake to a lossily compressed format like  [...]</p><p><a href="https://www.shutterangle.com/2014/lossless-compression-for-dng-raw-video-dngstrip/">Lossless Compression for DNG Raw Video</a></p>]]></description>
			<content:encoded><![CDATA[<p>There are a lot of good things about raw video but data size is not amongst them. Uncompressed raw video can quickly add up and fill storage. One way of handling the size problem in post-production is to do some initial adjustments on the raw video, then bake to a lossily compressed format like ProRes, DNxHD or Cineform and only keep the compressed video for further post and/or archiving of the source material. The downside of this approach is that a bit of image integrity and re-processing options are ultimately sacrificed in lossy compression, which is not exactly the goal of optimal archiving and image quality.</p>
<p>This article describes an alternative simple workflow for <em>lossless</em> compression of DNG/CinemaDNG video footage, and also introduces DNGStrip &#8211; an utility that&#8217;s used to optimize file size. Lossless DNG compression allows a reduction in video file size while preserving all the benefits of a raw post workflow. <span id="more-1767"></span></p>
<p><strong>Update April 2015: I now have a much better <a href="http://www.shutterangle.com/2015/slimraw-cinemadng-raw-video-lossless-compressor/" title="slimRAW: a fast CinemaDNG compressor">solution for CinemaDNG/DNG lossless compression</a>, which solves all the issues mentioned here.</strong></p>
<p>Currently there are a quite a lot of cameras that shoot uncompressed raw DNG/CinemaDNG video, or processes which end up with DNG video sequences: Blackmagic Design Cinema Camera, Digital Bolex, Ikonoskop A-Cam DII, Kinefinity first generation cameras, Canon Magic Lantern raw video, Sony FS700 + Convergent Design Odyssey 7Q, etc. All of these would benefit from some kind of (lossless) compression.</p>
<p>Note that by <em>lossless</em> I don&#8217;t mean visually lossless. Lossless means <em>truly lossless</em>: pixels are exactly the same as in the uncompressed file. Key here is that the DNG standard provides for losslessly compressed DNG frames. In fact, that is exactly the compression format used in compressed DNG video produced by the Blackmagic Design Pocket Cinema Camera. Both Adobe Camera Raw and Blackmagic Design DaVinci Resolve 10+ support losslessly compressed DNG images. </p>
<p>So you start with uncompressed raw DNG/CinemaDNG sequences and end up with losslessly compressed raw DNG sequences. There are a couple of applications involved in the process. Both are free to use and available for Windows and Mac OS X.<br />
</p>
<h6><strong>Step 1: Adobe DNG Converter</strong></h6>
<p>Since Adobe spec&#8217;d the DNG standard, it isn&#8217;t surprising they provide an application that can compress DNG images. Adobe DNG Converter is straightforward to use for processing DNG video sequences. You specify a source folder containing the DNG footage and a destination folder for output; make sure that on the Preferences screen &#8220;JPEG Preview&#8221; is set to None and &#8220;Use Lossy Compression&#8221; is unchecked; then press Convert. That&#8217;s it. DNG Converter will recursively process any subfolders and compress sequences.</p>
<div id="attachment_1780" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.shutterangle.com/wp-content/uploads/2014/03/DNGConverter.png"><img src="http://www.shutterangle.com/wp-content/uploads/2014/03/DNGConverter.png" alt="Adobe DNG Converter Preferences" width="500" class="size-full wp-image-1780" /></a><p class="wp-caption-text">Adobe DNG Converter Preferences for losslessly compressing DNG video. Everything is either left unchecked or set to None.</p></div>
<p>You can stop at this stage and just use the resulting DNG sequences. That&#8217;s what many have been doing already. The compressed video works beautifully in DaVinci Resolve 10 and Adobe Camera Raw. And there is no speed penalty in Resolve for using compressed DNG video, or at least I can&#8217;t see any. If anything, compressed DNG needs less filesystem bandwidth and loads faster. The compressed footage is usually between 50% and 75% of the original size, depending on the nature of the source material. For example, the source footage for a short shot on Canon Magic Lantern raw was compressed from 710GB to 399GB, or about 56.2% of the original size. A sample Blackmagic Design Cinema Camera sequence was compressed to 75% of the original size. A sample Digital Bolex sequence was compressed to 51.5% of the original size. Note that these numbers are not representative of how footage from specific camera models will compress. Compression depends on content. More detailed images compress less; for example, shallow DOF images compress more and fine detail landscapes compress less.</p>
<p>There are both Windows and Mac OS X versions of DNG Converter. Current version is 8.3. Here are the links:<br />
<a href="http://www.adobe.com/support/downloads/detail.jsp?ftpID=5694" title="Adobe DNG Converter 8.3 for Windows" target="_blank">Adobe DNG Converter 8.3 for Windows</a><br />
<a href="http://www.adobe.com/support/downloads/detail.jsp?ftpID=5695" title="Adobe DNG Converter 8.3 for Mac" target="_blank">Adobe DNG Converter 8.3 for Mac</a></p>
<p>Now that the good stuff is out of the way, here is bad news. <strong>There are three problems with using Adobe DNG Converter for video compression</strong>:</p>
<ol>
<li>It is rather slow. The forementioned Canon raw footage &#8211; about 2:42h of 23.976 fps material in 1920&#215;960 resolution &#8211; took 4 to 5 times its real time duration (or more than 11 hours) to compress on a decent modern Intel I7 powered PC. Make sure DNG Converter is running in the foreground, running it in the background (without its UI window showing) will slow it further.</li>
<li>Be aware that DNG Converter will strip any CinemaDNG specific tags if they are present in the source DNG. These may include time code, frame rate, reel name, T-stop and similar metadata. That&#8217;s because DNG Converter is really meant to process raw stills and we are using it for video. This is not just a theoretical possibility, some cameras do use these tags. For example, the Blackmagic Design Cinema Camera uses the <em>TimeCodes</em> and <em>FrameRate</em> tags. If these are important to you, <strong>don&#8217;t use Adobe DNG Converter</strong>.</li>
<li>As DNG Converter is stills oriented, it is not entirely concerned with size and will not produce the smallest file possible. It includes a small resolution (but uncompressed) thumbnail image into each and every DNG frame (around 100KB per frame, depending on image aspect ratio) and it also adds some useless tags to every file (for example, a 5.5KB XMP tag of entirely useless metadata). This may add up to some substantial disk space when a lot of frames are involved.</li>
</ol>
<p></p>
<h6><strong>Step 2: DNGStrip</strong></h6>
<p>I have written DNGStrip to address issue number 3 and squeeze the maximum out of DNG Converter&#8217;s compression. DNGStrip is a free command line tool which processes DNG sequences produced by DNG Converter and strips them of thumbnails and unnecessary tags added by Adobe. It will also remove any JPEG previews included in the compressed DNG files in case you accidentally enable them when converting with DNG Converter. DNGStrip doesn&#8217;t change the actual image data in any way. DNGStrip is also pretty fast. Its speed will likely be limited by the speed of the storage drives used. It also keeps the files standard and therefore compatible with both Adobe Camera Raw and Resolve.</p>
<div id="attachment_1790" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.shutterangle.com/wp-content/uploads/2014/03/DNGStrip.png"><img src="http://www.shutterangle.com/wp-content/uploads/2014/03/DNGStrip.png" alt="DNGStrip Usage" width="500" class="size-full wp-image-1790" /></a><p class="wp-caption-text">A screenshot of DNGStrip usage info as displayed in the console.</p></div>
<p>You can easily predict the gains of running DNGStrip over your DNG Converter compressed footage. DNGStrip will generally reduce frames by the same amount of bytes, provided they have <em>the same aspect ratio</em>. For example, Blackmagic Cinema Camera raw frames, Digital Bolex raw frames and Canon Magic Lantern 16:9 raw frames will all be around 114KB smaller (116 638 bytes, to be precise), and Canon Magic Lantern 2:1 frames will be around 102KB smaller after being processed by DNGStrip. So if your footage is homogeneous the gains after running DNGStrip are proportional to the number of frames processed. The forementioned Canon Magic Lantern 2:1 footage (a total of 233 516 frames) was reduced by DNGStrip from 399GB to 377GB, which is 53.1% of the original 710GB size. Quite a serious reduction, considering there is no loss of quality whatsoever compared to the original footage.</p>
<p>To put this in perspective: 377GB for 233 516 frames of 23.976 fps video means an average bitrate of approx. 317 mbps (in 1920&#215;960). For Full HD (1920&#215;1080) that would be equivalent to about 357 mbps. In comparison, 10-bit DNxHD 4:4:4 23.976 fps in 1920&#215;1080 has a bitrate of 350 mbps. In other words, I am getting the full possible quality (14-bit raw, in case of Canon ML raw) at a bitrate comparable to a 10-bit intermediate lossily compressed codec. This is a real world example, but remember that gains will vary depending on the nature of the source material. The stripped raw footage plays in real-time in Resolve as long as your GPU can handle it (an oldish GTX 570 is good enough). This isn&#8217;t related to decompression, which is done on the CPU, rather to debayering and image processing. No need for fancy storage setups either, at least with 2K video. A clean or sufficiently defragmented HDD will do fine. I use a cheap WD Blue without issues. For 4K and above you will still likely need RAID or SSD though.</p>
<p>You can download DNGStrip here. Both the Windows and Mac versions are included in the .zip file.<br />
<a href="http://www.shutterangle.com/downloads/DNGStrip.zip" title="Download DNGStrip">DNGStrip for Windows and Mac</a></p>
<p>On Windows you may need to install the Microsoft C++ Visual Studio 2013 redistributable packages if they aren&#8217;t already installed on your system. Do this if you get an error about MSVCP120.dll or MSVCR120.dll &#8220;missing on your computer&#8221;. You can get the redistributables <a href="http://www.microsoft.com/en-us/download/confirmation.aspx?id=40784" title="Microsoft C++ Visual Studio 2013 redistributables" target="_blank">here</a>.</p>
<p>Some quick notes about DNGStrip:</p>
<ul>
<li>
DNGStrip is really only meant to be used with DNG Converter&#8217;s output. While it won&#8217;t do stupid things to differently sourced DNGs, running it over them is generally pointless.</li>
<li>
DNGStrip is straightforward to use. In most cases all you&#8217;ll want to type is (make sure the current directory is the same as the one you&#8217;ve extracted DNGStrip to):<br />
In Windows:<br />
<code>dngstrip -r SourceFolderPath DestinationFolderPath</code><br />
And in Mac OS X:<br />
<code>./dngstrip -r SourceFolderPath DestinationFolderPath</code></li>
<li>
Be careful when overwriting original files with the -ovr option. While I don&#8217;t expect any issues and the application itself will never overwrite files it doesn&#8217;t understand, it is better to be safe than sorry. Test with some bits of footage first. Also, note that overwriting is really meant to be used with SSD drives or when you plan to subsequently move the footage to another drive. Using -ovr with hard drives with the idea to leave the files there long term increases the fragmentation of the free disk space.</li>
<li>
For maximum speed it is best to use different physical drives for input and output, unless you are using SSDs. This also applies when running DNG Converter.</li>
</ul>
<p>More details about DNGStrip can be found in the ReadMe file included in the zip. Make sure to read that before use.</p>
<p><em>Credit goes to Zolac at <a title="BMCUser" href="http://www.bmcuser.com/" target="_blank">bmcuser.com</a> for pointing out the thumbnails in DNG Converter&#8217;s compressed output, and for discussion and testing DNGStrip.</em></p>
<p><a href="https://www.shutterangle.com/2014/lossless-compression-for-dng-raw-video-dngstrip/">Lossless Compression for DNG Raw Video</a></p>]]></content:encoded>
			<wfw:commentRss>https://www.shutterangle.com/2014/lossless-compression-for-dng-raw-video-dngstrip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
