{"id":641,"date":"2014-02-18T01:58:22","date_gmt":"2014-02-18T05:58:22","guid":{"rendered":"http:\/\/eugenecormier.com\/?p=641"},"modified":"2014-02-18T01:58:22","modified_gmt":"2014-02-18T05:58:22","slug":"linux-dvd-conversion-to-h264-aac-mp4","status":"publish","type":"post","link":"http:\/\/eugenecormier.com\/?p=641","title":{"rendered":"Linux DVD conversion to h264 aac mp4"},"content":{"rendered":"<p>So I get a week off, and what really needs to be done?!? I&#8217;ve been noticing the deterioration of my massive, 200+, DVD collection which contains ALL my former concerts, ensembles, studio recitals, grad recitals etc&#8230;<\/p>\n<p>This of course is very precious to me and maintaining my data\/media is always a balance of: newest and greatest way, good compression, high quality audio and video, longevity, and last but not least convenience.<\/p>\n<p>For a long time now, the best option for me has been a transfer to the DVD format, and I have well over 200+ DVD vids of our concerts. I&#8217;ve been watching video codecs with hope, and finally with h264 and aac I have to say it really is incredible quality at a highly compressed bitrate.<\/p>\n<p>So with the h264 (x264 in linux) codec (the video\/size ratio is very good) and my dying DVDs, I decided to get this done, and I&#8217;ve learnt a few key commands that I&#8217;d like to share with whoever will listen. I&#8217;ll break it into steps:<\/p>\n<blockquote><p>1) Getting the info off the disc<br \/>\nSince these are all personal discs, a conversation about libdvdcss as it&#8217;s not needed. There are two good ways of doing this (the former is quicker, while the latter is far better at regaining lost data<\/p>\n<p>ddrescue works really well if there are no\/few problems with the disc (free from scratches):<br \/>\ndd_rescue -n -b 2048 \/dev\/cdrom dvd.iso<\/p>\n<p>dd can be brutally slow, but gets everything:<br \/>\ndd if=\/dev\/cdrom of=dvd.iso conv=noerror,sync<\/p><\/blockquote>\n<blockquote><p>2) joining VOBs<br \/>\nThere are two ways to do this too. I&#8217;ll give the most logical and easiest first although I notice no difference at all between the two.<\/p>\n<p>use cat:<br \/>\ncat VTS_01_1.VOB VTS_01_2.VOB VTS_01_3.VOB > combined.vob<\/p>\n<p>use ffmpeg (you need 1.1 or newer for concat):<br \/>\nffmpeg -i  concat:VTS_01_1.VOB\\|VTS_01_2.VOB\\|VTS_01_3.VOB -c copy combined.vob<\/p>\n<p>One neat thing about the ffmpeg command is you can include everything else and come up with a finished product like:<br \/>\nffmpeg -i  concat:VTS_01_1.VOB\\|VTS_01_2.VOB\\|VTS_01_3.VOB -c:v libx264 -crf 23 -c:a libfaac -ac 2 -ab 192k finished-video.mp4<\/p><\/blockquote>\n<blockquote><p>3) Encoding video<br \/>\nI use ffmpeg for this:<br \/>\nffmpeg -i combined.vob -c:v libx264 -crf 23 -c:a libfaac -ac 2 -ab 192k test.mp4<\/p>\n<p>to break this last example down:<br \/>\n-i combined.vob -> is the concatted vob file<br \/>\n-c:v libx264 -> this is the codec (x264)<br \/>\n-crf 23 -> this is how you set the constant quality, a lower number means higher quality, bigger file<br \/>\n-c:a libfaac -> audio codec (faac)<br \/>\n-ac 2 -> stereo sound (channels = 2)<br \/>\n-ab 192k -> the audio bitrate, higher is better\/bigger<\/p><\/blockquote>\n<p>and that&#8217;s pretty much it. For a 1 hour concert at 720p I&#8217;m getting about a 500-600mb file which is really good, and I&#8217;m using all open source software. I&#8217;m plowing through these videos, getting them backed up and safe. As soon as I complete this, the next stage is to run out to pick up a new 2TB HD, copy the files to that and move them offsite (just in case the house burns down&#8230;. you can NEVER be too safe with your data!<\/p>\n<p>I like the quote: <\/p>\n<blockquote><p>&#8220;There are two types of people in this world, those who have lost data, and those who are going to lose data&#8221;<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>So I get a week off, and what really needs to be done?!? I&#8217;ve been noticing the deterioration of my massive, 200+, DVD collection which contains ALL my former concerts, ensembles, studio recitals, grad recitals etc&#8230; This of course is very precious to me and maintaining my data\/media is always a balance of: newest and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":509,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,5,6],"tags":[],"class_list":["post-641","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guitar","category-linux","category-music"],"_links":{"self":[{"href":"http:\/\/eugenecormier.com\/index.php?rest_route=\/wp\/v2\/posts\/641","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/eugenecormier.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/eugenecormier.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/eugenecormier.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/eugenecormier.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=641"}],"version-history":[{"count":5,"href":"http:\/\/eugenecormier.com\/index.php?rest_route=\/wp\/v2\/posts\/641\/revisions"}],"predecessor-version":[{"id":646,"href":"http:\/\/eugenecormier.com\/index.php?rest_route=\/wp\/v2\/posts\/641\/revisions\/646"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/eugenecormier.com\/index.php?rest_route=\/wp\/v2\/media\/509"}],"wp:attachment":[{"href":"http:\/\/eugenecormier.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=641"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/eugenecormier.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=641"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/eugenecormier.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}