Saturday, April 30, 2011

Media codecs

Shark007's codecs 32 bit
 (Even on 64 bit windows, there is no need to have a 64 bit player or codecs)

lost all my settings in the reformat, but here are ones that seem to work well enough for the current system:

Shark's







FFDShow Video



FFDShow Audio



AC3 Filter


Friday, April 29, 2011

Friday, April 15, 2011

XBMC: TV Guide Feature

Certain skins like Neon, Night, Simplicity, etc, support TV Guide feature.
To get this to work, you need to install the "TV Show Next Aired" add on found under "Video Addons".

XBMC Advancedsettings.xml

<advancedsettings>
    <videolibrary>
        <cleanonupdate>true</cleanonupdate>  <!-- default set to false to prevent xbmc from removing items from the database while updating -->
        <hideemptyseries>true</hideemptyseries>  <!-- hide empty series in the video library -->
        <exportautothumbs>true</exportautothumbs>  <!-- export auto-generated thumbs. Defaults to false -->
    </videolibrary>
    <network>
        <cachemembuffersize>0</cachemembuffersize>
    </network>
    <fullscreen>true</fullscreen>
</advancedsettings>

XBMC / Zoomplayer key file

My remote is mapped to send keys as outlined in this post

To map the same keys in Zoomplayer, I use a custom key file:

AddKey(None,37,fnjumpbackward)
AddKey(None,39,fnjumpforward)
AddKey(Ctrl+Shift,66,fnskipbackward)
AddKey(Ctrl+Shift,70,fnskipforward)
AddKey(Ctrl+Shift,80,fnplay)
AddKey(Ctrl+Shift,83,fnexit)
AddKey(Ctrl,80,fnplay)
AddKey(Ctrl+Shift,51,fnarcycle)
AddKey(Ctrl,66,fnslowmotion)
AddKey(None,121,fnvolup)
AddKey(None,120,fnvoldown)
AddKey(Ctrl,70,fnhalfff)
AddKey(Ctrl+Shift,56,fnfastplay)
AddKey(None,119,fnmute)
AddKey(None,38,fnseekforward)
AddKey(None,40,fnseekbackward)
AddKey(None,83,fnexit)
AddKey(Alt+Shift,13,fnfsactmonitor)
nvAddKey(None,13,nvselect)
AddKey(None,33,fnzoomin)
AddKey(None,34,fnzoomout)
AddKey(None,79,fninfonav)
nvAddKey(None,8,nvescape)
AddKey(Ctrl,68,fnbar)
AddKey(None,32,fnplay)

XBMC: External player

I use Zoomplayer as an external player for most of my video viewing.

Zoomplayer provides me with features XBMC is missing:
1. ability to customize decoders/filters to use
2. Fast Play (I watch videos at 1.16x normal speed)
3. audio equalizer (I customize it in zoomplayer, so I don't have to tweak my stereo equalizer)

In order to use external player: XBMC Wiki Reference

<playercorefactory>
 <players>
   <player name="Zoomplayer" type="ExternalPlayer" audio="false" video="true">
     <filename>C:\Program Files (x86)\Zoom Player\ZPlayer.exe</filename>
     <args>"{1}" /F:2 /close /Q "/winname:ZP XBMC" /vol:40 /LockFS</args>
     <hidexbmc>false</hidexbmc>
     <hideconsole>false</hideconsole>
     <warpcursor>none</warpcursor>
     <playcountminimumtime>1500</playcountminimumtime>
   </player>
</players>
<rules action="prepend">
    <rule protocols="rtmp|rtmpe" player="dvdplayer" />
    <rule filetypes="avi|mp4|mpg|mpeg|mkv" player="Zoomplayer" internetstream="false" />
</rules>
</playercorefactory>
 

XBMC: Remote

This is the remote I bought:
Rosewill WMC Remote control/Rcvr RRC-127

To set it up follow instructions on:
XBMC Custom Regis

It's an exellent starting point.
I modded the keyboard.xml to suit my needs afterwards.

Extra tools to help customize remote:
http://xbmcmce.sourceforge.net/ 

Saturday, April 2, 2011

XBMC: deleting a file

Because XBMC wasn't designed with storing media info/images in the local folders in mind, when you delete a video from inside XBMC, it leaves behind the .nfo files + images associated with the video.

To keep my media folders clean, I wrote up a quick and dirty AutoIT script.
I'm sure it can be improved (probably massively), but I can't be bothered... it works for me.

These are also scheduled to run first thing every morning

TV ShowsMy TV shows are structured like:
[Drive]:\TV Shows\[ShowName]\[Season #]\[Episode]

;
; AutoIt Version: 3.0
; Language:       English
; Platform:       Win9x/NT
;
#Include <File.au3>
#Include <Array.au3>
#include <Date.au3>

$tvNormalMoveDir =          "Q:\TV Shows"

;----------------------------------

$FileList= _getdirandsubdirs($tvNormalMoveDir);
If @Error=1 Then
    MsgBox (0,"","No Folders Found.")
    Exit
EndIf

;_ArrayDisplay($FileList,"$FileList")

$rows = UBound($FileList)

;Display $FileList's contents
$output = ""
For $r = 0 to UBound($FileList) - 1
    $cont = $tvNormalMoveDir&"\"&$FileList[$r];

    $files=_FileListToArray($cont,"*",1)

    ;_ArrayDisplay($files,"$FileList")

    Dim $arr[100];
    $fpCount = 0;
    $found = 0
    For $c = 1 to UBound($files) - 1;
        $fname = StringTrimRight($files[$c], 4)

        if (($files[$c] == $fname&".avi") OR ($files[$c] == $fname&".flv") OR ($files[$c] == $fname&".wmv")) then
            $found = 1
        elseif (($files[$c] == $fname&".mpg") OR ($files[$c] == $fname&".mpeg") OR ($files[$c] == $fname&".mp4")) then
            $found = 1
        elseif ( ($files[$c] == $fname&".mkv") OR ($files[$c] == $fname&".flv") OR ($files[$c] == $fname&".wmv")) then
            $found = 1
        endif

        if $found = 1 then
            $arr[$fpCount] = $fname;
            $fpCount = $fpCount + 1;
            $found = 0
        endif
    Next

    ;_ArrayDisplay($arr,"$FileList")

    $fpCount = 0;
    $found = 0;

    ; second pass, eliminate all where name doesn't match
    For $c = 1 to UBound($files) - 1;
        $fname = StringTrimRight($files[$c], 4)

        if ($arr[$fpCount] == $fname) then
            ContinueLoop
        else
            if ($arr[$fpCount + 1] <> $fname) then

                if ( ($files[$c] == $fname&".nfo") OR ($files[$c] == $fname&".tbn") ) then
                    $found = 1
                elseif ( ($files[$c] == $fname&".idx") OR ($files[$c] == $fname&".sub") ) then
                    $found = 1
                elseif ( (($files[$c] == $fname&".srt") OR ($files[$c] == $fname&".log") ) then
                    $found = 1
                endif

                if ($found == 1) then
                    $toDel = $tvNormalMoveDir&"\"&$FileList[$r]&"\"&$files[$c];
                    $found = 0

                    if (FileExists ($toDel)) then
                        FileDelete ($toDel)
                        $output = $output & $toDel & @CRLF;
                    endif

                endif
            else
                $fpCount = $fpCount + 1;
            endif
        endif

    Next

    ;_ArrayDisplay($arr,"$FileList")

Next

;MsgBox (0,"",$output)

IF ($output <> "") THEN

    $file = FileOpen($tvNormalMoveDir&"\cleanerLog.log", 1)
    FileWriteLine ( $file, "---------------------------------------------------------" )

    ; Show current local time
    $tCur = _Date_Time_GetLocalTime()
    FileWriteLine ( $file, "Current date/time .: " & _Date_Time_SystemTimeToDateTimeStr($tCur) )
    FileWriteLine ( $file, "===============================================================" )

    FileWriteLine ( $file, $output )
    FileClose($file)

ENDIF

Func _getdirandsubdirs($dir)
Dim $Array1[1];
$c=1;
$d=0;
$temp="";
$folders=_FileListToArray($dir,"*",2)
While $c < UBound($folders, 1)
    $temp=_FileListToArray($dir&"\"&$folders[$c],"*.",2)
    $d=1;

    While $d < UBound($temp, 1)
        if ($temp[$d] <> ".actors") then
            _ArrayAdd($folders,$folders[$c]&"\"&$temp[$d])
            _ArrayAdd($Array1, $folders[$c]&"\"&$temp[$d])
        endif
        $d=$d+1;
    WEnd
    $c=$c+1;
WEnd
_ArrayDelete($Array1, 0)
return $Array1;
EndFunc


MoviesMy Movies are structured like:
[Drive]:\Movies\[Name (Year)]\[Movie]

; AutoIt Version: 3.0
; Language:       English
; Platform:       Win9x/NT
;
#Include <File.au3>
#Include <Array.au3>
#include <Date.au3>

$movieNormalMoveDir =       "Q:\Movies"

;----------------------------------

$FileList= _getdirandsubdirs($movieNormalMoveDir);
If @Error=1 Then
    MsgBox (0,"","No Folders Found.")
    Exit
EndIf
;_ArrayDisplay($FileList,"$FileList")

$rows = UBound($FileList)

;Display $FileList's contents
$output = ""
For $r = 0 to UBound($FileList) - 1
    $cont = $movieNormalMoveDir&"\"&$FileList[$r];

    ; Shows the filenames of all files in the current directory.
    $search = FileFindFirstFile($cont&"\*.avi")

    ; Check if the search was successful
    If $search = -1 Then
        $search = FileFindFirstFile($cont&"\*.mp4")
        If $search = -1 Then
            $search = FileFindFirstFile($cont&"\*.mkv")
            If $search = -1 Then
                $search = FileFindFirstFile($cont&"\*.mpg")
                If $search = -1 Then
                    $search = FileFindFirstFile($cont&"\*.mpeg")
                    If $search = -1 Then
                        $search = FileFindFirstFile($cont&"\*.wmv")
                        If $search = -1 Then
                            $search = FileFindFirstFile($cont&"\*.flv")
                        EndIf
                    EndIf
                EndIf
            EndIf
        EndIf
    EndIf

    If ($search = -1) Then
        if (FileExists ($cont)) then
            $size = DirGetSize($cont, 1)
            $megs = Round($size[0] / 1024 / 1024)
            if ($megs < 100) then
                $output = $output & $cont & @CRLF & "Size (MB): "& $megs & @CRLF;
                DirRemove($cont, 1)
            endif
        endif
    endif

    ; Close the search handle
    FileClose($search)

Next

IF ($output <> "") THEN

    $file = FileOpen($movieNormalMoveDir&"\cleanerLog.log", 1)
    FileWriteLine ( $file, "---------------------------------------------------------" )

    ; Show current local time
    $tCur = _Date_Time_GetLocalTime()
    FileWriteLine ( $file, "Current date/time .: " & _Date_Time_SystemTimeToDateTimeStr($tCur) )
    FileWriteLine ( $file, "===============================================================" )

    FileWriteLine ( $file, $output )
    FileClose($file)

ENDIF



Func _getdirandsubdirs($dir)
$c=1;
$d=0;
$temp="";
$folders=_FileListToArray($dir,"*",2)

Dim $arrayDel[1]

While $c < UBound($folders, 1)
    $temp=_FileListToArray($dir&"\"&$folders[$c],"*",2)
    $d=1;

    While $d < UBound($temp, 1)
        if ($temp[$d] <> ".actors") then
            _ArrayAdd($folders,$folders[$c]&"\"&$temp[$d])
            _ArrayAdd($arrayDel,$folders[$c])
        endif
        $d=$d+1;
    WEnd
    $c=$c+1;
WEnd

_ArrayDelete($arrayDel, 0)
$aNewArray = _ArrayUnique($arrayDel)
;_ArrayDisplay($aNewArray,"$FileList")

For $x = 1 to UBound($aNewArray) - 1;
    ; lookup existing entry
    $iKeyIndex = _ArraySearch($folders, $aNewArray[$x])
    If Not @error Then
        _ArrayDelete($folders, $iKeyIndex)
    EndIf
Next

_ArrayDelete($folders, 0)
return $folders;
EndFunc

Automate media rename + scrape

Here's the AutoIT script I quickly wrote to automate my media rename + scrape

I've scheduled it to run first thing every morning

; AutoIt Version: 3.0
; Language:       English
; Platform:       Win9x/NT
;

$renamerPath =              "C:\Program Files (x86)\theRenamer\theRenamer.exe"
$mediaCompanionPath =       "D:\Program Files (x86)\Media Companion gen2 3.400\mc_com.exe"
$utorrentPath =             "D:\Program Files (x86)\uTorrent\uTorrent.exe"

$tvDownloadDir =            "E:\Bittorrent\Downloads\tv shows\"
$tvNormalMoveDir =          "Q:\TV Shows"
$tvAlternateMoveDir =       "E:\Cinema\TV Shows"

$movieDownloadDir =         "E:\Bittorrent\Downloads\movies\"
$movieNormalMoveDir =       "Q:\Movies"
$movieAlternateMoveDir =    "E:\Cinema\Movies"

;----------------------------------

; check to see if TV show folder has anything
$tvHasFiles = DirGetSize($tvDownloadDir);

; check to see if movie folder has anything
$movieHasFiles = DirGetSize($movieDownloadDir);

if ($tvHasFiles > 0 OR $movieHasFiles > 0) then

   ; if it does, check to see if utorrent is running
    $uTorrentRunning =  ProcessExists("uTorrent.exe"); Will return the PID or 0 if the process isn't found.

    ; if it is, close it
    if ($uTorrentRunning > 0) Then
        ProcessClose($uTorrentRunning)

        Sleep(5000) ;five seconds
    endif

    if ($movieHasFiles > 0) then
        ; check to see if Q folder exists
        $movieNormalDirExists = FileExists($movieNormalMoveDir)

        ; set archive folder
        if ($movieNormalDirExists) then
            $renamerArchiveFolder = $movieNormalMoveDir
        else
            $renamerArchiveFolder = $movieAlternateMoveDir
        endif

        $movieRenamerPath = $renamerPath & " -fetchmovie -ff=" & $movieDownloadDir & _
                                         " -af=" & $renamerArchiveFolder;
        ; run renamer
        RunWait($movieRenamerPath);

        ;Sleep(5000) ;five seconds

        $movieMediaCompanionPath = $mediaCompanionPath & " -m"

        ; run media companion
        RunWait($movieMediaCompanionPath);
    endif

    if ($tvHasFiles > 0) then
        ; check to see if Q folder exists
        $tvNormalDirExists = FileExists($tvNormalMoveDir)

        ; set archive folder
        if ($tvNormalDirExists) then
            $renamerArchiveFolder = $tvNormalMoveDir
        else
            $renamerArchiveFolder = $tvAlternateMoveDir
        endif


        $tvRenamerPath = $renamerPath & " -fetch -ff=" & $tvDownloadDir & _
                                         " -af=" & $renamerArchiveFolder;
        ; run renamer
        RunWait($tvRenamerPath);

        ;Sleep(5000) ;five seconds

        $tvMediaCompanionPath = $mediaCompanionPath & " -e"

        ; run media companion
        RunWait($tvMediaCompanionPath);
    endif

    ; restart utorrent
    if ($uTorrentRunning > 0) Then
        Run($utorrentPath);
    endif
endif

XBMC Supplementary tools: Media Companion

When XBMC scrapes data for media, it stores it internally in it's own database.
If that database gets corrupted for whatever reason, you have to go through the pain of rescraping everything.

Enter Media Companion
This software scrapes data and stores it locally within the media folder.
So rebuilding the XBMC db is painless.

It's buggy as hell, but does the job well as long as you figure out the quirks and how to get around them.

My settings:
1. TV SHOWS


2. MOVIES

XBMC supplementary tools: TheRenamer

XBMC needs Movies and TV Shows folders to be structured a certain way to properly scrape data:

http://wiki.xbmc.org/index.php?title=TV_Shows_(Video_Library)#TV_show_file_naming_conventions

My TV shows are structured like:
[Drive]:\TV Shows\[ShowName]\[Season #]\[Episode]

My Movies are structured like:
[Drive]:\Movies\[Name (Year)]\[Movie]

In order to achieve this as painlessly as possible, I use TheRenamer

Here are my settings:

1. TV SHOWS




2. MOVIES