linux

Linux DVD conversion to h264 aac mp4

So I get a week off, and what really needs to be done?!? I’ve been noticing the deterioration of my massive, 200+, DVD collection which contains ALL my former concerts, ensembles, studio recitals, grad recitals etc…

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.

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’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.

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’ve learnt a few key commands that I’d like to share with whoever will listen. I’ll break it into steps:

1) Getting the info off the disc
Since these are all personal discs, a conversation about libdvdcss as it’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

ddrescue works really well if there are no/few problems with the disc (free from scratches):
dd_rescue -n -b 2048 /dev/cdrom dvd.iso

dd can be brutally slow, but gets everything:
dd if=/dev/cdrom of=dvd.iso conv=noerror,sync

2) joining VOBs
There are two ways to do this too. I’ll give the most logical and easiest first although I notice no difference at all between the two.

use cat:
cat VTS_01_1.VOB VTS_01_2.VOB VTS_01_3.VOB > combined.vob

use ffmpeg (you need 1.1 or newer for concat):
ffmpeg -i concat:VTS_01_1.VOB\|VTS_01_2.VOB\|VTS_01_3.VOB -c copy combined.vob

One neat thing about the ffmpeg command is you can include everything else and come up with a finished product like:
ffmpeg -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

3) Encoding video
I use ffmpeg for this:
ffmpeg -i combined.vob -c:v libx264 -crf 23 -c:a libfaac -ac 2 -ab 192k test.mp4

to break this last example down:
-i combined.vob -> is the concatted vob file
-c:v libx264 -> this is the codec (x264)
-crf 23 -> this is how you set the constant quality, a lower number means higher quality, bigger file
-c:a libfaac -> audio codec (faac)
-ac 2 -> stereo sound (channels = 2)
-ab 192k -> the audio bitrate, higher is better/bigger

and that’s pretty much it. For a 1 hour concert at 720p I’m getting about a 500-600mb file which is really good, and I’m using all open source software. I’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…. you can NEVER be too safe with your data!

I like the quote:

“There are two types of people in this world, those who have lost data, and those who are going to lose data”

stsbanner

Shattering the Silence – in one week!!!

Shattering the Silence, Acadia’s New Music Festival starts next week and the guitar department will be well represented. The Acadia guitar quartet is going to play Philip Glass’ 3rd String Quartet (Mishima), Leo Brouwer’s Cuban Landscape With Rain & a brand new piece from Martin Campbell (Acadia composition student) called ‘Perspectives’.

It should be a great series. See the following link for more information:
ShatteringTheSilence.ca

tomregan2014

Tom Regan Memorial Concert tonight!

There’s going to be lots of classical guitar offerings at the TR concert tonight including:

  • The Acadia Guitar Quartet (Me, Alec Leard, Matthew Martin & Jeff Torbert) will play the entire 3rd String Quartet by Philip Glass
  • The Cormier/Martin Guitar Duo will play Jongo by Paulo Bellinati
  • And Alec Leard, winner of this year’s Tom Regan auditions will be performing Tango en Skai by Roland Dyens
  • Should be a great night, everything gets started at 7:30.

    oro_band_photo

    ORO! Orkestra – Turko-Balkan Dance Musik

    I just wanted to let everyone know that I’ve been invited to join ORO!, a Turkish/Balkan Dance band. We’ve had a few rehearsals and it’s very fun music to play. We also have a number of performances coming up starting with this coming weekend and the Deep Roots Music Festival. Keep an eye on upcoming performances below, and be sure to check out ORO’s website and some of their videos.

    http://oro-orkestra.com/

    steve-reich-2

    Reich…

    So I’ve just gotten home from a few weeks on the road. Edmonton and Montreal were great. I got to hear many good players while I was out, but I’m very happy to be home again. The next thing that I’m getting ready for is another concert playing the great Steve Reich piece 2×5….time to dust off the strat again 🙂

    edmonton-kiwanis

    Upcoming Concerts/Masterclasses etc..

    Well it’s official, I’ll be judging the 2012 Montreal Guitar Competition this year again! you can read more about that here. I’ll be playing a concert as well as a masterclass that weekend which is right after I return from adjudicating the Edmonton Kiwanis (busy April this year). Also I’ve added some non-classical-guitar gigs to my upcoming events as well including: 2×5 Steve Reich (an amazing piece for 2 rock bands….I had to dust off the ol’ strat 🙂 and I’ll be playing in the Thomas Regan concert this coming weekend (Friday) with Matt Martin and playing Banjo in Kurt Weill’s Three Penny Opera on Sunday.
    E

    gentoo

    Gentoo on the MacBook Air

    It’s been a very long time since I posted anything, so it’s my new year’s resolution to do more this year. This first post of the year will be a computer post. Over the holidays I picked up a MacBook Air, and I have to say I love the design. Some of the highlights include: back-lit keyboard, multi-touch trackpad, fans & speakers hidden in the joint between the display and the keyboard & aluminium case. Apple really does a great job with design. But of course, I hate the simplicity of MacOSX. Yes I know it’s built on top of Darwin, but I like to be able to tinker with “everything” and run all my favorite programs. So the first thing to do when I got it was to delete everything and put on Linux. I won’t go through every detail, but I will mention the things that did not work out of the box. Hope this helps someone else!

    ##################################
    # MacOSX fixes – Do this before
    # removing MacOSX
    ##################################

    If you use only Linux, boot hangs for 30 seconds waiting for the Mac partition. To override this issue the following command (from MacOSX):
    bless –device /dev/disk0s1 –setBoot –legacy –verbose

    To stop the boot mac sound, issue the following command:
    /usr/sbin/nvram SystemAudioVolume=%01

    ##################################
    # Wireless Card
    # note the two <M>, these MUST be
    # built as modules for the wifi
    # card to work
    ##################################

    edit: in kernel 3.2+ you must turn off BCMA to get BRCM softmac enabled, which is now under drivers/network (not staging)

     

    Install: sys-kernel/linux-firmware

    [*] Networking support —>
    -*- Wireless —>
    <*> cfg80211 – wireless configuration API
    [*] Wireless extensions sysfs files
    <*> Common routines for IEEE802.11 drivers
    <*> Generic IEEE 802.11 Networking Stack (mac80211)

    Device Drivers —>
    Broadcom specific AMBA —>
    <M> BCMA support
    [*] Support for BCMA on PCI-host bus
    [*] Staging drivers —>
    <M> Broadcom IEEE802.11n PCIe SoftMAC WLAN driver

    ##################################
    # Intel Video Card
    ##################################

    edit: the hack below is not needed in kernels newer than 3.2

    I found this solution here: https://bugs.freedesktop.org/show_bug.cgi?id=39533#c25

    first edit /usr/src/linux/drivers/gpu/drm/i915/intel_bios.c
    and after the:
    DRM_DEBUG_KMS(“Found panel mode in BIOS VBT tables:\n”);
    drm_mode_debug_printmodeline(panel_fixed_mode);
    lines add the following:
    panel_fixed_mode->hdisplay = 1366;
    panel_fixed_mode->hsync_start = 1398;
    panel_fixed_mode->hsync_end = 1566;
    panel_fixed_mode->htotal = 1734;
    panel_fixed_mode->vdisplay = 768;
    panel_fixed_mode->vsync_start = 772;
    panel_fixed_mode->vsync_end = 776;
    panel_fixed_mode->vtotal = 792;
    panel_fixed_mode->clock = 72500;
    panel_fixed_mode->type = 0x48;
    panel_fixed_mode->flags = 0xa;
    drm_mode_set_name(panel_fixed_mode);

    Graphics support —>
    <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) —>
    <*> Intel 8xx/9xx/G3x/G4x/HD Graphics
    [*] Enable modesetting on intel by default

    ##################################
    # Intel Audio Card
    ##################################

    This worked automatically with pulseaudio, BUT I had to install gnome-alsamixer and turn up the “Surround” volume to get the speakers working

    ##################################
    # Webcam
    ##################################

    install the media-video/isight-firmware-tools
    download: http://www.mediafire.com/?81xtkqyttjt

    then ift-extract –apple-driver AppleUSBVideoSupport

    ##################################
    # SSD enhancements
    ##################################

    fstab should include (in this case sda1 is the ssd, the tmpfs is for gentoo to not compile on the ssd):
    /dev/sda1 / ext4 discard,noatime,data=ordered 0 1
    tmpfs /var/tmp/portage tmpfs nodev,nosuid,mode=1777 0 0

    add the following to the /boot/grub/grub.conf kernel line:
    elevator=noop

    linux

    Using ART Tubefire 8 with Linux

    About a month ago I decided that it was time for me to pick up some decent recording gear and get moving on a recording. Going to a studio was out of the question for me because 1) I love computers and recording and I want to be involved in every part of the creation and 2) due to my job (I’ve taught some recording courses) I have a substantial working knowledge of recording techniques. I went to my local music shop and after a few days of reading and browsing and going home and researching on the net I decided to grab a nice mic (AKG C-214, this is for classical guitar) and a tube mic preamp (ART Tubefire 8).

    I was really impressed with the versatility of the Tubefire. You can read more about it here, but to sum up it’s points: it is an eight channel, tube preamp which has been getting very good reviews for it’s price point…..and the real kicker, it has a built in ADC/DAC which runs into the computer via firewire. Even without the computer sound input though I was really interested in this unit because it has: eight channels – eight ins, eight outs (great for a live setting with a band), real tubes (push the input gain on the unit and you can really get some nice tube warmth), and phantom power.

    So I had made up my mind on this product….it really was everything I could possibly hope for…one last step (as a Linux guy)…..check for Linux support…I mean I’m pretty good with Linux these days, so even if I have to compile and hack a little….no problem (and before you start saying….oh why doesn’t he just reinstall windows/macosx and stop complaining….here’s the thing…..it’s not about using the other operating system…..it’s about not wanting to have to always keep the other operating system + recording software around so that I can get back to my original takes…..I use Ardour these days and it is definitely everything I will ever need in a recording program and I don’t feel like moving from a pro-tools powerhouse sort of program into say cubase or garageband)
    Anyways, I hit the net with my fingers crossed and learned that the project/program for firewire audio in Linux is ffado. After hitting their website and looking up Tubefire in the device support list (yes it was there at least) it was listed as “unknown”…..Damn….it was so close….it was everything I needed but no Linux support. So I thought about it and I came to the conclusion I could still use it as a preamp and run it into my computer via my Edirol UA-25 USB soundcard….which gives me all the nice tube warmth for recording, but I lose the ability to record 8 tracks at once (into individual tracks in Ardour) and play back eight tracks at once (again individually)….of course Ardour can record/playback as many tracks as your hard drive can keep up with….but it would be really nice to be able to mic a drum kit with eight mics, all running through a tube preamp into individual tracks on the computer for mixing a tweaking later….but oh well….now ….on to the fun and exciting bit

    Last night after owning the unit for a month….I decided to screw around with the computer side of things a bit and see what I could learn (I have been using it successfully as a stand alone preamp)…..so I plugged it in to my computer via the firewire and sure enough, the kernel detected the firewire interface and setup a file (/dev/raw1394) to handle input/output from the device….good start 🙂
    I’m using the now current Ubuntu (ver.9.04 Jaunty) so I installed the following packages: linux-image-rt, linux-restricted-modules-rt, jackd, qjackctl, ardour, ffado-dbus-server, ffado-mixer-qt4, ffado-tools and libffado0
    Next I ran the command (in a terminal): sudo chown myusername /dev/raw1394
    to give myself permission to access the firewire device and I fired up the ffado mixer. it discovered the Tubefire, there were some settings (which seemed to do nothing) and there was nothing in the mixer….ok what’s next….let’s try jack
    So I started up Jack control, went into settings and changed: driver = firewire, interface = hw:0
    hit the start button and voila….Jack was talking to something….I take a look at the input/output channels….OMG!!!! Jack is showing 8 inputs and 8 outputs…..now I’m starting to get really excited.
    Last thing to check…..I started up Ardour and again everything works….It looks like multiple inputs should work no problem (I only recorded one channel at a time, but I can’t see there being any problem) and I tested multiple playback channels at the same time…ran them into my Mackie and everything was fine….so I’m assuming (I’ll test more in the coming weeks) that recording 8 channels at once should work and playing back 8 separate channels should work too

    In the Jack setup if you select the sample rate to be any of the device’s supported rates and then start Jack, the unit correctly displays the correct rate by lighting the proper led light

    wow….I should have done this long ago….lets put this in the “I can’t believe it just worked out of the box category!!!!!”

    music

    Desert Island Discs

    While I was in school studying music, on more than one occasion I would hear my profs speak about “Desert Island Discs” ….. music they simply couldn’t live without. Well you may find this funny coming from a professional musician but I have finally come to the realization today that there is music I truly couldn’t live without …. so I’m going to start my own desert island disc collection 🙂

    #1
    Holst – The Planets – Montreal Symphony Orchestra w/ Charles Dutoit
    (label – London/Polygram)

    This is what started this whole post, and a no brainer for me. This work is so epic I can’t even begin to describe the depth of it. It’s truly a study in instrumentation and form. Holst does so much with so little material …. endless repetitions of a smattering of melodic motives. But in doing this the music still has a feeling of musical schizophrenia, contrasting sections of music make major tonal shifts and night and day differences in overall feel. And through all of this, every once in a while, he throws in the obligatory “sing along” melodies that just bring a smile to your face.

    This is absolutely in every respect a piece of music I could not live without!

    Eugene

    linux

    Mencoder – my hero

    I’m just starting to fully realize how truly amazing mencoder actually is. It’s helping me do things that I previously thought were impossible.

    For example, I have a few avi files which were split to fit on multiple cds. Now every time in the past that I’ve tried to combine these I’ve seen disaster (problems with audio/video syncing) until I tried mencoder. (I’ve also posted some other commands I find useful)

    To combine files:

    mencoder -forceidx -ovc copy -oac copy -o output.avi input1.avi input2.avi

    To encode subtitles into the video (the xvidencopts bitrate in this example is set to 400mb, you should change this to your desired file size and remember to leave in the minus sign before the number):

    mencoder -ovc xvid -oac mp3lame -xvidencopts bitrate=-400000 -subfont-text-scale 3 -sub subtitles-file.srt -o output.avi input.avi

    To encode video for a PlayStation3 dlna server:

    mencoder -ovc xvid -oac mp3lame -xvidencopts bitrate=-400000 -o output.avi input.avi

    Convert any video file to a DVD compliant MPG:

    mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -vf scale=352:240,harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800: vbitrate=5000:keyint=18:vstrict=0:acodec=ac3:abitrate=192: aspect=16/9 -ofps 30000/1001 -o outputfile.mpg inputfile.avi

    guitar

    Guitar Tip #2 – The mess guitarists call ‘legato’

    How often have I heard (or more than likely said!) ‘you need to play more legato’

    With legato on guitar there are many problems as well as many solutions.

    Aural:

    Problem:
    Very often I find that my students simply don’t hear their legato issues. This is usually a result of chopping up phrases in order to learn the piece. Then after some time you hear the choppy melody as being correct. My take on all music, with the exception of a few special circumstances, is that it is always composed of linear (horizontal) lines. I mean that even if you are simply playing from one chord to the next, the chords are not vertical clusters of notes disconnected from each other but are each a collection of individual notes and each note moves by step or leap to another note in the next cluster, or chord if you like. (remember that music, speaking in scientific terms, is sound over time which suggests a linear connection between sounds)

    Solution:
    You should try to hear the melody correctly before trying to play the piece. I can hear the music when I look at the score, but if you can’t it might not be a bad idea to try one of the following:

    1) play each phrase using only melody notes. Try to make the melody sound exactly as you would like it before moving on.

    2) listen to some recordings. Be very careful with this suggestion as I often hear many choppy interpretations on recordings.

    3) sight sing the melodies

    All three of these methods are an attempt to do one thing: get you to hear the melody correctly before you start to butcher it by trying to play the other supporting voices. After you have the right sound of the melody in your ear, then try to play the music while trying to maintain the melody’s original sound. Also remember that in the case of contrapuntal music there can be more than one melody (look at the Bach Bourree in E minor for a perfect example of music with 2 distinct lines to maintain)

    Technical:
    Unfortunately, for guitarists, just about everything is against us on our instrument

    1) Left hand: to create a legato line you must:

    • a) in the case of a position shift make the position shift at the last possible moment as fast as possible. To fix your shifting try subdividing the beat and making sure your shift happens after the last subdivision (in a fast piece subdividing with 16ths may suffice whereas a slower piece may need sextuplets or 32nds)
    • b) when crossing strings always try to use different fingers (if this is not possible I have found that practicing across the break making the movement as fast and clean as possible can yield wonderful results as well…..but only as a last resort)

    2) Right hand: when trying to maintain legato it is crucial that you never place the finger on the string before plucking…think of it as scooping the string. You need to set the string in motion without stopping the previous note (remember this is not always the case….there are many instances on guitar where you can easily plant a finger before plucking without sacrificing legato….it’s only if the melody remains on one string for 2 or more consecutive notes)

    Now on to the good stuff: the tricks!

    1) If you need to make a position shift as well as a string crossing: see if you can’t use some sort of small barre to remove the string crossing….if this is possible, now you only have to deal with the shift

    2) leave the melody note on: see if you can’t get the melody note before the break to use a left hand finger which won’t be needed for the note(s) immediately after the break…..this way as the finger holds the melody note, the other fingers can prepare and land the next note(s)

    3) *trick: if the last suggestion is impossible sometimes you can let the melody note go and leave other notes ringing while preparing for the next note(s) …..try it!! Unbelievable….if this is done well, it seems even though the melody note is gone, the remaining notes can trick the ear into still hearing the lost note/legato

    4) and finally one of the most useful tricks in a professional guitarist’s arsenal to create the illusion of legato is this: (first the situation) let’s say you have a melody with a large position leap in the middle, and this leap causes a break in the phrase (this is taking for granted that you cannot use an open string(s) to provide the legato while you leap). The problem here is that most of the time we are so focused on landing the notes after the break at the right time (metronomically speaking) that we actually cut the notes, before the break, short. What makes this worse is the sooner you cut notes after you pluck them the more noticeable it is (in this instance you can think of guitar as a percussion instrument….when we pluck a string we instantly get the loudest sound from the note and after that the note decays until it is inaudible). So the solution here is to give the note it’s full value or more (this will mess with timing in a minimal way, but it will also let the note decay some as well) and then make the leap as quickly as possible to the next note(s) landing them just a little late. If this is done well the effect is that the note before the break gently fades out and the break is reduced to the point of being negligible

    If legato issues plague your playing try some of these techniques out and see if you too can’t become a smooth player.