<rdf:RDF
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xml:base='http://community.moertel.com/ss/rdf'>
    <s:Snip rdf:about='http://community.moertel.com/ss/rdf#Tech+Recipies/Improving+MJPEG+movies+taken+by+digital+cameras'
         s:cUser='tmoertel'
         s:oUser='tmoertel'
         s:mUser='tmoertel'>
        <s:name>Tech Recipies/Improving MJPEG movies taken by digital cameras</s:name>
        <s:content>\\&#xA;Many consumer-grade digital cameras (like the Canon A95) can record movies in the {link:Motion JPEG format|http://en.wikipedia.org/wiki/MJPEG}, in which each frame is represented as an independent JPEG image.  Most digital cameras can manipulate this format with ease because of their JPEG-processing prowess. The MJPEG format, however, does have some notable drawbacks:&#xA;&#xA;- __Low compression.__  Because each frame is independent, inter-frame similarities cannot be &quot;factored out&quot; and compressed away.&#xA;- __Exaggerated noise.__  JPEG compression results in small noise-like artifacts that are hard to notice in a single frame but jump out in movies, where inter-frame differences are easy to see.&#xA;&#xA;1.1 Re-encoding MJPEG movies to improve compression and perceived quality&#xA;&#xA;To get around these problems, I re-encode my digicam&apos;s MJPEG movies using the following ~~mencoder~~ recipe:&#xA;&#xA;{code:none}&#xA;mencoder ~~input.avi~~ __-vf eq2=1.6,hqdn3d__ -oac copy -ovc lavc -o ~~output.avi~~&#xA;{code}&#xA;&#xA;The magic occurs in the video-filter specification (in bold), which comprises two post-decoding processing steps:&#xA;&#xA;- __eq2=1.6__ &amp;#8211; Increases the gamma setting to 1.6, brightening the movie.  (I find that movies captured indoors are often too dark.)&#xA;- __hqdn3d__ &amp;#8211; Filters the video using a high-quality version of the ~~denoise3d~~ filter, which &quot;aims to reduce image noise, producing smooth images and making still images really still.&quot;&#xA;&#xA;To preview the effects of these filters before re-encoding with them, you can try them with ~~mplayer~~:&#xA;&#xA;{code:none}&#xA;mplayer ~~input.avi~~ -vf eq2=1.6,hqdn3d&#xA;{code}&#xA;&#xA;&#xA;1.1 QuickTime compatibility&#xA;&#xA;The ~~ffmpeg~~ tool can be used to re-encode movies for QuickTime compatibility:&#xA;&#xA;{code:none}&#xA;ffmpeg -i ~~input.avi~~ ~~output.mp4~~&#xA;{code}&#xA;&#xA;To avoid re-encoding artifacts, use a lossless codec in the initial ~~mencoder~~ step:&#xA;&#xA;{code:none}&#xA;mencoder ~~input.avi~~ -vf eq2=1.6,hqdn3d -oac copy __-ovc lavc -lavcopts vcodec=ffvhuff:vstrict=-1__ -o ~~temp.avi~~&#xA;ffmpeg -i ~~temp.avi~~ ~~output.mp4~~&#xA;rm -f ~~temp.avi~~  # the temp file can be large&#xA;{code}</s:content>
        <s:mTime>2005-12-21 18:10:00.574</s:mTime>
        <s:cTime>2005-12-21 17:10:04.004</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#Tech Recipes'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#Tech+Recipes'/>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='#tmoertel'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#space/Tech Recipies/Improving MJPEG movies taken by digital cameras'/>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li>
                    <s:Snip rdf:about='http://community.moertel.com/ss/rdf#Tech+Recipies/Improving+MJPEG+movies+taken+by+digital+cameras'>
                        <s:attachments
                             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
                    </s:Snip>
                </rdf:li>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#'/>
                <rdf:li rdf:resource='#pxsl'/>
                <rdf:li rdf:resource='#LectroTest'/>
                <rdf:li rdf:resource='#RPMs'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#space/space/space/Tech Recipies/Improving MJPEG movies taken by digital cameras'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#Asterisk PBX'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#space/space/Tech Recipies/Improving MJPEG movies taken by digital cameras'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#A Coder&apos;s Guide To Coffee'/>
            </rdf:Bag>
        </s:snipLinks>
    </s:Snip>
</rdf:RDF>
