<?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>my tech blog &#187; canon</title>
	<atom:link href="http://billauer.se/blog/tag/canon/feed/" rel="self" type="application/rss+xml" />
	<link>https://billauer.se/blog</link>
	<description>Anything I found worthy to write down.</description>
	<lastBuildDate>Thu, 12 Mar 2026 11:36:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Some blurbs about tweaking mplayer&#8217;s codecs</title>
		<link>https://billauer.se/blog/2009/12/canon-codec-decoder-h264-listdll/</link>
		<comments>https://billauer.se/blog/2009/12/canon-codec-decoder-h264-listdll/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 17:34:08 +0000</pubDate>
		<dc:creator>eli</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[500d]]></category>
		<category><![CDATA[canon]]></category>
		<category><![CDATA[clsid]]></category>
		<category><![CDATA[codec]]></category>
		<category><![CDATA[decoder]]></category>
		<category><![CDATA[guid]]></category>
		<category><![CDATA[h.264]]></category>
		<category><![CDATA[mencoder]]></category>
		<category><![CDATA[mplayer]]></category>
		<category><![CDATA[slr]]></category>

		<guid isPermaLink="false">https://billauer.se/blog/?p=405</guid>
		<description><![CDATA[The (non-) problem The truth is that there never was a problem. What really happened was that I got things confused between a few versions of mplayer/mencoder, and only the latests (of those I have, 1.0rc1-3.2.2) does the job. Bus since I wrote down some things I might want to return to some day, here&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<h3>The (non-) problem</h3>
<p>The truth is that there never was a problem. What really happened was that I got things confused between a few versions of mplayer/mencoder, and only the latests (of those I have, 1.0rc1-3.2.2) does the job. Bus since I wrote down some things I might want to return to some day, here&#8217;s the whole blob.</p>
<p>What got me on this, was that using mplayer (version 1.0 of some rc&#8217;s) to play my Canon 500D&#8217;s movie clips, I get the sound OK, but an image which flashes the real thing every now and then (keyframes?) and shows some grey garbage otherwise. And tons of error messages on the console.</p>
<p>On some other version the image looks OK, but A/V sync is lost soon enough. And many error messages indicate that the decoder doesn&#8217;t get it right (a lot of &#8220;Consumed only 136509 bytes instead of 1365120&#8243; alikes). That isn&#8217;t very promising.</p>
<p>It&#8217;s worth to note, that mplayer/mencoder choose the native ffmpeg libavcodec by default. As ffmpeg improves, these issues are fixed.</p>
<p>My real goal is to convert the clip to something descent using mencoder. I don&#8217;t even think about editing a video in H.264. So all I need now is to find the right video decoder.</p>
<p>But I prefer to use the decoder supplied by Canon (spoiler: I never managed to). Since I own the camera, and got the software legally, why not use the codec they sent me? Only one problem&#8230;</p>
<h3>What is the DLL of the codec used?</h3>
<p>In order to &#8220;steal&#8221; the codec from the Canon application, I needed to know which DLL Canon uses to play its own videos. In order to do that, I opened Zoombrowser, and ran the ListDLL command line utility (which can be downloaded from <a href="http://download.sysinternals.com/Files/ListDlls.zip" target="_blank">here</a>). The utility spits out all DLLs of all processes running, but using the &#8220;&gt;&#8221; redirection in a command window, all data goes to a file. Then I double-clicked a video, and ran ListDLL again, redirecting the data to another file.</p>
<p>The difference between the files is most probably the DLLs loaded to play a clip. This worked because I ran Zoombrowser from scratch.</p>
<p>With my favourite diff application, I got a long list of new DLLs. These two caught my eyes:</p>
<pre>C:\Program Files\Canon\Canon MOV Decoder\CanonH264Filter.ax
C:\Program Files\Canon\Canon MOV Decoder\CanonIPPH264DecLib.dll</pre>
<p>Hmmm&#8230;  In retrospective, I could have figured that one out without heavy tools. But at least I know which they are now.</p>
<h3>Installing the codec</h3>
<p>I copied both files mentioned above to /usr/local/lib/win32. Then I added the following entry to the /usr/local/etc/mplayer/codecs.conf:</p>
<pre>videocodec canonh264
  info "Canon's H.264 decoder"
  status working
  fourcc avc1,AVC1
  fourcc h264,H264
  fourcc x264,X264
  driver dshow
  dll "CanonH264Filter.ax"
  guid 0xb7215ee3, 0xaf54, 0x433f, 0x9d, 0x2f, 0x22, 0x64, 0x91, 0x69, 0x84, 0xf6
  out YUY2
  out BGR32,BGR24,BGR15</pre>
<p>As for the output formats, I guessed them. Odds are I got it wrong.  As for the GUID, I managed to find a class with a &#8220;FriendlyName&#8221; saying &#8220;Canon H.264 Decode Filter 1.3&#8243;, and it has the class ID B7215EE3-AF54-433F-9D2F-2264916984F6. So basically that&#8217;s it.</p>
<p>Anyhow, this didn&#8217;t work at all. When I ran mencoder with -vc canonh264, it ended with</p>
<pre>Forced video codec: canonh264
Opening video decoder: [dshow] DirectShow video codecs
Called unk_GetVersionExW
Segmentation fault</pre>
<p>I won&#8217;t even try to pretend that I understand what went wrong here, but GetVersionExW happens to be a function exported from Windows&#8217; kernel32.dll, retrieving information about the current operating system. I&#8217;m not clear on whether the function was never found, or if the decoder wasn&#8217;t happy with the answer it got. This way or another, a segfault is a segfault. I thought this was the place to give up. I&#8217;ll use the good old ffmpeg decoder.</p>
<h3>A remark about H.264</h3>
<p>Canon&#8217;s choice of H.264 as the encoding format is a bit bizarre, since it&#8217;s a version of MPEG-4. And just for general knowledge: MPEG-4 is horrible. In particular it has this annoying thing about stale regions in the frame, which look bad and basically don&#8217;t heal. But I suppose that MPEG-2 would require too fast writes to the flash or something. The result is still pretty bad.</p>
<h3>Summary</h3>
<p>Trying to fix video issues late at night is not necessarily the wisest thing to do.</p>
]]></content:encoded>
			<wfw:commentRss>https://billauer.se/blog/2009/12/canon-codec-decoder-h264-listdll/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Canon EOS 500D: Using the wrong driver intentionally</title>
		<link>https://billauer.se/blog/2009/07/canon-eos-500d-drivers-windows-2000-inf/</link>
		<comments>https://billauer.se/blog/2009/07/canon-eos-500d-drivers-windows-2000-inf/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 15:48:18 +0000</pubDate>
		<dc:creator>eli</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[500d]]></category>
		<category><![CDATA[canon]]></category>
		<category><![CDATA[drivers]]></category>
		<category><![CDATA[eos]]></category>
		<category><![CDATA[WIA]]></category>
		<category><![CDATA[windows 2000]]></category>

		<guid isPermaLink="false">https://billauer.se/blog/?p=336</guid>
		<description><![CDATA[Foreword Before I say a word, my children, I have to warn you: What I&#8217;m about to teach you here is basically how to mess up your computer. It&#8217;s how to make Windows install the wrong driver for a USB device (possibly PCI devices as well). Don&#8217;t complain about a headache when you want to [...]]]></description>
			<content:encoded><![CDATA[<h3>Foreword</h3>
<p>Before I say a word, my children, I have to warn you: What I&#8217;m about to teach you here is basically how to mess up your computer. It&#8217;s how to make Windows install the wrong driver for a USB device (possibly PCI devices as well). Don&#8217;t complain about a headache when you want to switch to the correct driver (or just another one): Once Windows adopts a driver for a device, it develops certain sentiments for it, and will not give it up so easily.</p>
<p>Also, my children, I have to confess that I still use Windows 2000 these days. It&#8217;s about time I went on for at least XP, but I have too much installed software to carry with me (none of which will run, I fear, after an upgrade).</p>
<p>Having these issues out of the way, let&#8217;s get to business.</p>
<h3>My motivation</h3>
<p>I bought a brand new Canon EOS 500D, which came with a brand new EOS Digital Solution disk (v20.0, if we&#8217;re at it). It&#8217;s black, it&#8217;s pretty, it autoboots, but it tells me to go &amp;@^%$ myself with my ancient operating system (Windows 2000, as mentioned). Canon&#8217;s &#8220;support&#8221; is more like a black hole, so I&#8217;m on my own. All I want is to download the pics to my computer. When I plug the camera in, I get &#8220;Found new hardware&#8221; but no driver to get it working with.</p>
<p>I was slightly more successful with Linux (Fedora 9, on my laptop). gphoto2 managed to download the images (using command line, which is cool) using PTP (Picture Transfer Protocol) but I want this working on my desktop.</p>
<p>Now here&#8217;s the problem in summary: The camera connects to the computer and says: &#8220;I was made by Canon (manufacturer number 0409) and I&#8217;m a 500D camera (product ID 31CF), and I support the standard interface 6.1.1, which means &#8220;Still Imaging&#8221;. An XP computer would say &#8220;Aha! A camera! Let&#8217;s try PTP, even though I&#8217;ve never heard about this device!&#8221; but a Windows 2000 won&#8217;t talk with strangers (if they are cameras, that is).</p>
<p>Drivers for this camera for Windows 2000 are not to be found. I tried to find a generic PTP driver for Windows, but couldn&#8217;t find one. There&#8217;s a generic interface (WIA), but no generic driver. Then I thought: Since any camera driver would talk PTP with any PTP camera, why not put just any Canon driver to talk with my camera? After all, the driver just transfers files. I hope.</p>
<p style="padding-left: 30px;"><em><span style="text-decoration: underline;">Update</span> (</em><em>February 5th, 2010)</em><em>: I got the following laconic mail from Canon&#8217;s help desk today:</em></p>
<p style="padding-left: 30px;"><em>&#8220;Dear Customer,</em></p>
<p style="padding-left: 30px;"><em>The EOS 500D camera can only be connected to personal computers with either Windows Vista, Windows XP or Mac OS X operating systems. Unfortunately Windows 2000 is not supported&#8221;</em></p>
<p style="padding-left: 30px;"><em>Wow! That&#8217;s a piece of valuable information after having the camera for over six months!</em></p>
<h3>The black magic</h3>
<p>It just so happens, that the 400D <a href="http://software.canon-europe.com/software/0024783.asp?model=" target="_blank">has a PTP TWAIN driver</a> for Windows 2000 (the installation file is k6906mux.exe). So I downloaded that one, and installed it as is. Which didn&#8217;t help much, of course. But it left me the INF file at the destination directory. That allowed me some wicked manipulations.</p>
<p>The trick is to bind the driver&#8217;s software to the specific hardware ID. So I opened the INF file, and found the part saying:</p>
<pre>[Models]
%DSLRPTP.DeviceDesc%=DSLRPTP.Camera, USB\VID_04A9&amp;PID_3110</pre>
<p>That means, &#8220;if some device says it was made by 04A9 (Canon) and that its product ID is 3110 (EOS 400D, I suppose)&#8221;, use this driver.</p>
<p>Hey, this is an open invitation for intervention! I simply changed it to:</p>
<pre>[Models]
%DSLRPTP.DeviceDesc%=DSLRPTP.Camera, USB\VID_04A9&amp;PID_31CF</pre>
<p>(actually, I did it on a copy of the file)</p>
<p>And then I went for all these places saying</p>
<pre>[DSCamera.Addreg]
HKLM,"%DS_REG%\TWAIN\EOSPTP",DeviceDesc,,"EOS Kiss_X REBEL_XTi 400D"
HKLM,"%DS_REG%\TWAIN\EOSPTP",ModelName,,"EOS Kiss_X REBEL_XTi 400D"</pre>
<p>and changed them to something saying it&#8217;s a 500D using 400D driver. Just free text so I know what I&#8217;m doing.</p>
<p>By the way, you may wonder where I had the 500D&#8217;s product ID from. The answer is Linux again. There&#8217;s a utility called lsusb, which supplies all that info. You can get it in Windows too, I suppose. I just don&#8217;t know how.</p>
<h3>Putting it to work</h3>
<p>At this point, I plugged in my camera, and powered it on. Windows told me it found new hardware, great, and then asked me to supply a driver (a couple of wizard windows ahead). It actually wants an INF file, so I gave it the one I cooked.</p>
<p>Since the VID/PID in the file match those given by the camera, Windows installed the drivers and associated them with the camera from now on. Mission accomplished.</p>
<h3>Did it work?</h3>
<p>The truth is that the result isn&#8217;t very impressive. Maybe because Canon&#8217;s own EOS utility failed to talk with the camera this way, and Picasa&#8217;s interface with the TWAIN driver is a bit uncomfortable. But the bottom line is that I can now download the images to my Windows 2000 computer.</p>
<p>On the other hand, maybe it&#8217;s this ugly with proper drivers as well. The most important thing is that it works, after all.</p>
]]></content:encoded>
			<wfw:commentRss>https://billauer.se/blog/2009/07/canon-eos-500d-drivers-windows-2000-inf/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
