﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-knight</title><link>http://www.cnitblog.com/knight/</link><description /><language>zh-cn</language><lastBuildDate>Wed, 29 Apr 2026 06:01:19 GMT</lastBuildDate><pubDate>Wed, 29 Apr 2026 06:01:19 GMT</pubDate><ttl>60</ttl><item><title>DvdRippers in the linux world</title><link>http://www.cnitblog.com/knight/archive/2005/12/06/5202.html</link><dc:creator>knight</dc:creator><author>knight</author><pubDate>Tue, 06 Dec 2005 01:24:00 GMT</pubDate><guid>http://www.cnitblog.com/knight/archive/2005/12/06/5202.html</guid><wfw:comment>http://www.cnitblog.com/knight/comments/5202.html</wfw:comment><comments>http://www.cnitblog.com/knight/archive/2005/12/06/5202.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/knight/comments/commentRss/5202.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/knight/services/trackbacks/5202.html</trackback:ping><description><![CDATA[<!--StartFragment --><div class="wikitext"><strong><tt>vobcopy</tt></strong> <a href="http://vobcopy.org/projects/c/c.shtml">http://vobcopy.org/projects/c/c.shtml</a><p> </p><pre xml:space="preserve"> vobcopy  [-b  size[bkmg] ] [-e size[bkmg] ] [-f] [-F fast_factor ] [-h]       [-i input-dir ] [-l] [-m] [-n title-number ] [-o output-dir ] [-O  sin-       gle_file(s)_to_rip ] [-t name ] [-v [-v]] [-I] [-V] [-1 aux_output_dir1       ] [-2 aux_output_dir2 ] [-3 aux_output_dir3 ] [-4 aux_output_dir4 ]</pre><p>vobcopy copies DVD .vob files to harddisk, decrypting (if you have libdvdcss installed) them on the way (thanks to libdvdread and libdvdcss) and merges them into file(s) with the name extracted from the DVD.</p><p>Normall usage:</p><p>Copy main title to DiskName_01.vob: vobcopy</p><p>Mirror whole disk to DiskName/VIDEO_TS/: vobcopy -m</p><p>(it figures out DiskName and dvd mount point and device itself)</p><hr class="wikiline"/><strong><tt>cpdvd</tt></strong> <a href="http://www.lallafa.de/bp/cpdvd.html">http://www.lallafa.de/bp/cpdvd.html</a><p> </p><pre xml:space="preserve"> cpdvd: $Revision: 1.10 $ $Date: 2004/01/31 09:53:41 $ Usage: cpdvd [options] &lt;targetDir&gt;</pre><p> </p><pre xml:space="preserve">  -t &lt;num&gt;  copy title &lt;num&gt;    (repeat for more titles/none: whole disc)  -m &lt;mnt&gt;  set DVD mount point (default: DVD_MOUNT or "/dvd")  -d &lt;dev&gt;  set DVD device      (default: DVD_DEV or probe automatically)  -v        use vobcopy for data transfer   (default: cpvts)  -c        use tccat for data transfer  -f        force mount and unmount of dvd device  -i        only fetch info and exit  -n        dummy mode (do not execute copy commands)</pre><p>Normall usage: You simply give a target directory (will be created automatically) insert a DVD and that's all:</p><p> </p><pre xml:space="preserve"> cpdvd MyMovie</pre><p> </p><pre xml:space="preserve"> (doesn't use the DVD's name.)</pre><p> </p><hr class="wikiline"/><strong><tt>dvdbackup</tt></strong> - <a href="http://dvd.chevelless230.com/dvdbackup.html">http://dvd.chevelless230.com/dvdbackup.html</a><p><tt><strong>dvdbackup</strong></tt> will create a DVD-Video structure under <tt>/my/dvd/backup/dir/TITLE_NAME/VIDEO_TS</tt>.</p><p>To backup the main feature of the DVD:</p><p> </p><pre xml:space="preserve"> dvdbackup -F -i/dev/dvd -o /my/dvd/backup/dir/</pre><p>To back up the ENTIRE DVD:</p><p> </p><pre xml:space="preserve"> dvdbackup -M -i/dev/dvd -o/my/dvd/backup/dir/</pre><p>Note: On some linux distributions, the symbol <tt>UDFFindFile</tt> is no longer exported from libdvdread, and instead has been made a static function. It seems that the dvdbackup utility needs to link with this function. As a workaround, one can still download the older version 0.9.3 of libdvdread from:</p><pre xml:space="preserve">  <a href="http://dvd-create.sourceforge.net/libdvdread-0.9.3.tar.gz">http://dvd-create.sourceforge.net/libdvdread-0.9.3.tar.gz</a></pre>One could configure this version of libdvdread to build it in a local directory, using for example:<pre xml:space="preserve">  ./configure --prefix=$HOME/libdvdread-0.9.3</pre>You could then link dvdbackup with this local version of libdvdread using something like this:<pre xml:space="preserve">  gcc -o dvdbackup.o -c dvdbackup.c -I$HOME/libdvdread-0.9.3/include  gcc -static -o dvdbackup dvdbackup.o \    $HOME/libdvdread-0.9.3/lib/libdvdread.a -ldl</pre>You may prefer not to use the <tt>-static</tt> flag, and instead set LD_LIBRARY_PATH to include the local <tt>$HOME/libdvdread-0.9.3/lib</tt> directory.<p> </p><hr class="wikiline"/>StreamDVD <a href="http://www.badabum.de/streamdvd.html">http://www.badabum.de/streamdvd.html</a><p>StreamDVD is a fast tool to backup Video DVDs 'on the fly', there will be no ripping, demultiplexing, recoding, remultiplexing .... You can select the wanted title, chapters, video, audio and subpicture streams and also a resize factor and StreamDVD will write a 'ready to author' vob file to stdout.</p><p>StreamDVD is slower for 'basic' ripping, but is the only one that does simple (fast) requantizing.</p><p>Typical use:</p><p>First determine a requantizing factor:<br/>streamanalyze -t 1 -i /mnt/dvd Factor : 1.077</p><p>If the factor is above about 1.5, use -s to pick streams, or -c to pick chapters.</p><p>Use the factor and whatever other options you used (-s, -c) on this line:<br/>dvdauthor -t -o /movies/movie1 -f 'streamdvd -i /dev/dvd -t 1 -f 1.077|'</p><p>Then use dvdauthor to reconstruct the dvd menu:<br/>dvdauthor -T -o DiskName/</p><p> </p></div><p id="zoundry_bw_tags">  <!-- Tag links generated by Zoundry Blog Writer. Do not manually edit. http://www.zoundry.com -->  <span class="tags"><span class="tagspaces">Technorati</span> : <a href="http://technorati.com/tag/linux%20dvd" rel="tag">linux dvd</a></span> </p><img src ="http://www.cnitblog.com/knight/aggbug/5202.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/knight/" target="_blank">knight</a> 2005-12-06 09:24 <a href="http://www.cnitblog.com/knight/archive/2005/12/06/5202.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>结构内存对齐</title><link>http://www.cnitblog.com/knight/archive/2005/10/14/3287.html</link><dc:creator>knight</dc:creator><author>knight</author><pubDate>Thu, 13 Oct 2005 19:27:00 GMT</pubDate><guid>http://www.cnitblog.com/knight/archive/2005/10/14/3287.html</guid><wfw:comment>http://www.cnitblog.com/knight/comments/3287.html</wfw:comment><comments>http://www.cnitblog.com/knight/archive/2005/10/14/3287.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/knight/comments/commentRss/3287.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/knight/services/trackbacks/3287.html</trackback:ping><description><![CDATA[以delphi为例：<br/>TTest = record<br/>c1: char;<br/>i1: Integer;<br/>c2: char;<br/>c3: Char;<br/>end;<br/>这个结构如果用sizeof取其占用的内存大小，是多少呢，是1+4+1+1=7么，不是，是4*3 = 12; 这是因为32位编译的时候，默认结构会自动内存对齐(32bit = 4byte)。<br/><br/>如果要想让这个结构占用7个字节的话，必须加上packed关键字。如下：<br/>TTest = packed record<br/>c1: char;<br/>i1: Integer;<br/>c2: char;<br/>c3: Char;<br/>end;<br/><br/>c中也有类似的语法，如<br/><font size="2">#define <font color="#CC0033">ATTRIBUTE_PACKED</font> __attribute__((packed))</font><br/>typedef struct {<br/>...<br/>} ATTRIBUTE_PACKED record_t;<br/>__attribute__ ((packed)); 是说取消结构在编译过程中的优化对齐。<br/>__attribute__ ((aligned (64))); 是说让dummy成员对齐在64-bit自然边界上。<br/><br/><br/>再附两种情况增加理解：<br/>TTest = record<br/>c1: char;<br/>i1: Integer;<br/>end;<br/>//占用8字节<br/><br/><div>TTest = record<br/>c1: char;<br/>i1: Integer;<br/>c2: char;<br/>end;</div><div><div>//占用12字节</div><div><div>TTest = record<br/>c1: char;<br/>end;</div><div>//占用1字节</div></div></div><br/><img src ="http://www.cnitblog.com/knight/aggbug/3287.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/knight/" target="_blank">knight</a> 2005-10-14 03:27 <a href="http://www.cnitblog.com/knight/archive/2005/10/14/3287.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>测试blog客户端</title><link>http://www.cnitblog.com/knight/archive/2005/10/14/3286.html</link><dc:creator>knight</dc:creator><author>knight</author><pubDate>Thu, 13 Oct 2005 19:11:00 GMT</pubDate><guid>http://www.cnitblog.com/knight/archive/2005/10/14/3286.html</guid><wfw:comment>http://www.cnitblog.com/knight/comments/3286.html</wfw:comment><comments>http://www.cnitblog.com/knight/archive/2005/10/14/3286.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/knight/comments/commentRss/3286.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/knight/services/trackbacks/3286.html</trackback:ping><description><![CDATA[那天下了一个blog客户端，今天打算试验一下好不好使，好使的话以后偶就用客户端写blog了<br/><br/>配置关键<br/>xml-rpc url:<br/><a href="http://www.cnitblog.com/knight/services/metablogapi.aspx">http://www.cnitblog.com/knight/services/metablogapi.aspx</a><br/><br/><img src ="http://www.cnitblog.com/knight/aggbug/3286.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/knight/" target="_blank">knight</a> 2005-10-14 03:11 <a href="http://www.cnitblog.com/knight/archive/2005/10/14/3286.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>