Friday, August 3, 2012

Use VLC to Bulk Convert WMA to MP3

I had a pile of WMA files that I wanted to bulk convert to mp3 and I did not want to pay for some shareware solution.   I settled on using a bash script that invoked VLC to do the job.  I found several good examples online of how to do this:
http://jcandrioli.wordpress.com/2010/11/24/how-to-convert-wma-to-mp3-using-vlc-instead-of-mplayer/
http://wiki.videolan.org/Transcode

I settled on the videolan wiki as my method of choice.

To start you need to have VLC and ffmpeg installed; the first url has an example of getting those on Ubuntu based systems.  After you have those you need to write a short bash file to do the work.

#!/bin/bash
acodec="mp3"
arate="128"
ext="mp3"
mux="ffmpeg"
vlc="/usr/bin/vlc"
fmt="wma"

for a in *$fmt; do
$vlc -I dummy -vvv "$a" --sout "#transcode{acodec=$acodec}:standard{mux=$mux,dst=\"$a.$ext\",access=file}" vlc://quit
done


Put the script in the folder with your wma files.  From the command line make the script executable:

#chmod +x wma2mp3.sh

then execute
#./wma2mp3.sh

I did not use the ‘arate’ variable and the mp3’s sounded fine, however my wma files were from an audiobook so quality is not quite so important.  Also this was not exactly fast but it works.   The script was still running when I retired for the night, it was running at least an hour at that point.  In all I converted 341 files averaging 4 Meg each.


The videolan wiki also gives batch script  examples for doing this in Windows.
The one thing I did not like was that this process just appended .mp3 after the wma extension which offended my sensibilities.  I will fix that  later.  In the meantime that can easily be addressed with the bulk file renamer included with my MINT linux distro.

Thursday, August 2, 2012

Retina Can't Make SSH Connection

I could not successfully Retina scan a Red Hat 5x virtual server even though I could fully scan other similarly configured servers on the same ESXi platform.  I was able to successfully ssh to the target from one of the other VMs but could not establish an ssh connection via Retina.  There was nothing in the logs on the target showing failed connections etc but the Retina logs showed that the connection attempt timed out.
After troubleshooting the target and the Retina server I came up with a clue at
“http://forums.eeye.com/index.php?/topic/2305-registry-error-threshold-exceeded/”
I ended up setting
HKEY_LOCAL_MACHINE\SOFTWARE\eEye\Retina\5.0\Settings\SSH\DataTimeout to 60, it was 15.

This fixed the problem.  Why the one VM server had an issue with timeouts I do not know since it is configured the same as the other VMs I could scan.

For 64-bit systems use: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\eEye\Retina\5.0\Settings\SSH