Saturday, December 26, 2015

Running Deluge in a Finch jail and fixing Socks5 proxy

I wanted to run a Socks5 proxy on my NAS4Free machine, but I found out that Transmission can't do that. There are some alternatives and I chose Deluge to do the job. In this post I will show you how to get Deluge started in a jail and more importantly how to get Socks 5 running.

First I disabled the bittorent service in NAS4Free.
Then I created a new jail following these instructions: Jails-how-to




And then I added Deluge to the jail following this: [HOWTO] Install Deluge in Finch / Qjail.
All in all this went rather smoothly. I can access Deluge from the browser with a webclient using IP:8112 (in my case http://192.168.0.252:8112). I'm using this checkMyTorrentIp.png.torrent to see if I'm using my actual IP or the proxy IP. At the moment I'm using my actual IP as I didn't setup a proxy yet.


Alternatively you can install Deluge in Windows. Uncheck Classic Mode in interface, restart Deluge and choose the Deluge daemon on your NAS box:


Next I setup the proxy. Choose preferences. Choose proxy. And fill out the proxy settings:


Choose apply and now the IP address in checkmytorrentip.net should show the proxy IP. Which in my case didn't. To overcome this I had to change the config.

First I saw that after starting deluge on NAS4Free I received an error:  
/usr/local/etc/rc.d/deluged start
..
RuntimeError: Protocol not supported
 
To fix this error, do /usr/local/etc/rc.d/deluged stop and do /usr/local/etc/rc.d/delug_web stop
Now edit /usr/local/deluge/.config/deluge/core.conf and change and save.
"listen_interface": "", --> "listen_interface": "",

Second remove /usr/local/deluge/.config/deluge/session.state

Now /usr/local/etc/rc.d/deluged start and in checkmytorrentip.net should show the proxy IP.





Saturday, January 10, 2015

Normalize ac3 in MKV container

A few of my home videos have a really low volume sound. I couldn't find a good solution to achieve a louder video, so I worked out a solution by combining different tools to do the work.

So I start with a MKV container which has video in AVC and audio in AC-3 format. The goal is a new MKV container with audio in AC-3 in a higher volume. For instance the file below (filename AV200011.B,mkv).


I will show the following steps:


1. In VirtualDub with mkv plugin and ac3 decoder extract ac3 audio stream as wav using full processing mode
2. In VirtualDub extract video as avi using direct stream copy
3. In Audacity load wav file and normalize it
4. In Audacity with FFmpeg to new ac3 file
5. In MKVToolNix GUI merge video from step 2 and audio from step 4 to new mkv container


1. Extract audio

First download and install Virtualdub (I used VirtualDub 1.10.4) and install the Matroska plugin by copying the plugin to the plugins32 folder. Then install an ac3 decoder called AC3ACM by running the 'Install the 32-bit codec.bat'. Open VirtualDub and do File|Open video file and load the mkv container.


Do Audio|Full processing mode and leave other options. Now choose File|Save WAV...


2. Extract video
In Virtualdub extract video as avi using direct stream copy. Now choose Audio|No audio and Video|Direct stream copy. File|Save as AVI...



3. Normalize audio
 Download and install Audacity (I used Audacity 2.0.6). Then install FFmpeg. To do this open Audacity and choose Edit|Preferences... and choose Libraries. Click Download and install FFmpeg.


Now in Audacity load wav file and do Effect|Normalize it.
Before:



After:



4. Export wav to ac3
In Audacity with ffmpeg export wav to new ac3 file

5. Remux (merge) MKV
In MKVToolNix GUI merge video from step 2 and audio from step 4 to new mkv container

Done!