MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal 1 » Community Skins and Plugins » Plugins


Plugins Plugins developed and maintained by users. Want to create your own plugin? Start a thread in here.

Reply
 
Thread Tools Display Modes
Old 2007-10-20, 15:50   #1 (permalink)
Portal Member
 
Join Date: Oct 2007
Location: Siena
Age: 31
Posts: 78
Thanks: 1
Thanked 2 Times in 1 Post

Country:


Default Distributed Video Transcoding

Hi,

Today I'm exploring an idea that want to share with you.

I've recently bought my first TV card (Hauppauge PVR 150) and immediatly started massive TV recordings.
First problem was disk space with each TV recording (dvr-ms) measured in Gbytes.
I've reduced this problem after the discovery of the "MP plugin for Video Transcoding";.

Even with some problems this plugin works pretty well.

The second problem that arose was computing power: my PC with MP produce recordings faster than transcoding them.
I was thinking about buying another TV card (to avoid registration conflicts!) but feared that this problem will get bigger and bigger.

I've some others PC so I've had the idea of doing Distributed Computing to parallelize transcoding.

Here are some experiments:

I know that the video transcoding plugin is simply a wrapper for FFMPEG or MENCODER but without source code I've to discover the correct command line to execute transcoding.

With Process Explorer from SysInternals (now Microsoft) we can see the command line of a process:

Code:
"C:\Program Files\Team MediaPortal\MediaPortal\transcode\ffmpeg\ffmpeg.exe"
-i "F:\tv\TVProgramName_200710182300p103.dvr-ms"
-aspect 4:3 -vcodec xvid -vtag XVID -s 352x288 -b 1024k -r 25 -async 1 -mbd 2 -qmin 2 -bug autodetect -acodec mp3 -ab 128k 
"F:\tv\TVProgramName_200710182300p103.avi"
I want to execute that process on other PC in my home LAN. So I've modified the command line with UNC like this:

Code:
"\\MediaPortalPC\C$\Program Files\Team MediaPortal\MediaPortal\transcode\ffmpeg\ffmpeg.exe"
-i "\\MediaPortalPC\F$\tv\TVProgramName_200710182300p103.dvr-ms"
-aspect 4:3 -vcodec xvid -vtag XVID -s 352x288 -b 1024k -r 25 -async 1 -mbd 2 -qmin 2 -bug autodetect -acodec mp3 -ab 128k
"\\MediaPortalPC\F$\tv\TVProgramName_200710182300p103.avi"
Creating a CMD script with that command I can do the same thing done by video transcoding plugin from any PC in my home LAN (assuming the user launching that script has right access privileges). Obviosly I've to change file names in the script to transcode different files.

I can also start that script on others PC directly from my workstation using PSExec (again from SysInternals) with this command line:

Code:
psexec \\pc1 -u username -p password -c -f -d -belownormal transcode.cmd
Extremely useful is monitoring transcoding process on remote PC to know when is time to start a new transcoding process. We can do this from one workstation with PSList (again from SysInternals!) utility:

Code:
pslist \\pc1 ffmpeg
With these utilities I've managed distributed video transcoding on 4 PC simultaneously (one of them capable of 2 transcoding process with a dual core CPU).

This experiments needed some manual work (monitoring remote processes, writing correct file names, launching scripts) but resulted in a real 5X speed boost.

Maybe we could automate the manual work with some script magic (I've read about powerful things done with Windows Power Shell from Microsoft).

I hope to be helpful

Bye,
Midget

Last edited by Midget; 2007-10-20 at 22:21.
Midget is offline   Reply With Quote
Old 2007-10-22, 18:00   #2 (permalink)
Retired Team Member
 
mzemina's Avatar
 
Join Date: Feb 2005
Location: Ft Smith, AR
Posts: 2,045
Thanks: 36
Thanked 12 Times in 12 Posts

Country:


Default

I believe dukus has C# scripting working.
__________________
mzemina is offline   Reply With Quote
Old 2007-11-12, 22:05   #3 (permalink)
Portal Member
 
Join Date: Apr 2006
Posts: 70
Thanks: 3
Thanked 0 Times in 0 Posts


Default

You could modify something like this simple batch script I use to recusively trancode whole directories

for /R %%i in (*.avi) DO CALL :ENCODE "%%i%"

goto :eof

:ENCODE
echo "%~pnx1"
if NOT %~z1 GEQ 600000000 goto :eof
if exist "c:%~pnx1" goto :eof
if not exist "C:%~p1" md "c:%~p1"
rem "1st Pass started for %~n1 "
Time /T
"C:\program files\Team MediaPortal\MediaPortal\transcode\mencoder\mencode r.exe" -oac mp3lame -lameopts aq=0:cbr:br=96 -ofps 25 -ovc xvid -xvidencopts pass=1:trellis:me_quality=6:vhq=4:autoaspect:chrom a_opt:bitrate=700 -passlogfile "C:\program files\Team MediaPortal\MediaPortal\transcode\logs\%~n1.mlog" "%~f1" -o "C:%~pnx1"
rem "2nd Pass started for %~n1 "
Time /T
"C:\program files\Team MediaPortal\MediaPortal\transcode\mencoder\mencode r.exe" -oac mp3lame -lameopts aq=0:cbr:br=96 -ofps 25 -ovc xvid -xvidencopts pass=2:trellis:me_quality=6:vhq=4:autoaspect:chrom a_opt:bitrate=700 -passlogfile "C:\program files\Team MediaPortal\MediaPortal\transcode\logs\%~n1.mlog" "%~f1" -o "C:%~pnx1"
rem "2nd Pass finished for %~n1 "
Time /T



goto :eof



then I run this to copy back the contents once I'm happy it worked OK



for %%i in (*.avi) DO CALL :ENCODE "%%i%"

goto :eof

:ENCODE
echo "%~pnx1"
if %~z1 LEQ 100000000 goto :eof
rem if exist "c:%~pnx1" goto :eof
if not exist "c:%~p1" md "d:%~p1"
copy "%~1" "d:%~pnx1" /y
del "%~1"
fsutil file createnew "c:%~pnx1" 1024

goto :eof
__________________
Greg Steele
GSteele is offline   Reply With Quote
Reply

Bookmarks

Tags
distributed, transcoding, video

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
MP plugin for Video Transcoding fabriceD06 General Development (no feature request here!) 448 2008-10-27 09:35
Transcoding to Xvid neverwhere Codecs, External Players 8 2007-04-20 20:40
Cutting and transcoding, - please help Dadane General Support 0 2007-01-29 07:34
Transcoding filters etc dman_lfc Tips and Tricks 11 2007-01-25 15:33
Transcoding tthomas Improvement Suggestions 3 2005-06-20 11:28


All times are GMT +1. The time now is 08:32.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress
Advertisement System V2.6 By   Branden