Dem2vid - script to capture & encode nexuiz demos

Simple script to encode a .dem to an aac/avc video.
To produce a high quality mp4 simply specify the demo to encode in addition to your desired width & file size. If no file size is specified a VBR encode will be done.The demo file must be within your ~/.nexuiz/data/demos/ directory, I recommend renaming it to something simple beforehand.
#!/bin/bash
#Script to capture demo, calculate bitrate, scale & encode to aac/avc
#uses ffmpeg presets within ~/.ffmpeg (-vpre fast/-vpre vhq)
#examples: http://svn.mplayerhq.hu/ffmpeg/trunk/ffpresets
#depends: mplayer, faac, ffmpeg & x264 (>20081002 recommended)
#use: ./dem2vid yourDemo.dem requiredWidth requiredSizeInMB
DEM="$1"
WID="$2"
MB="$3"
captureDemo() {
LOC=`locate nexuiz-linux-glx.sh`
${LOC} -demo +cl_capturevideo 1 +cl_capturevideo_fps 24 +playdemo demos/${DEM}
info() {
VID=`find ~/.nexuiz/data/video/ -iname "dpvideo*.avi" -print | tail -1`
mplayer -identify -frames 0 ${VID} 2>/dev/null > /tmp/$$
RESX=`grep ID_VIDEO_WIDTH /tmp/$$ | cut -d"=" -f2`
RESY=`grep ID_VIDEO_HEIGHT /tmp/$$ | cut -d"=" -f2`
LENGTH=`grep ID_LENGTH /tmp/$$ | cut -d"=" -f2`
rm /tmp/$$ && echo ${RESX} ${RESY} ${LENGTH} ${VID}
height() {
ASPECT=$(echo "scale=3; ${RESX} / ${RESY}" | bc)
HEIGHT=$(echo "${WID} / ${ASPECT}" | bc)
MOD16=$(( ${HEIGHT} / 16 * 16 ))
echo ${MOD16}
bitrate() {
RATE=$(echo "(( "$MB" * 1024 ) / ${LENGTH}) - 16" | bc)
R8=$(echo "(( ${RATE} * 8 ) * 1.02)" | bc)
KBPS=`echo "tmp=${R8}; tmp /= 1; tmp" | bc`
echo ${KBPS}
encode() {
ffmpeg -i ${VID} -an -pass 1 -s ${WID}x${MOD16} -vcodec libx264 -vpre fast \
-b ${KBPS}k -threads 0 -rc_eq 'blurCplx^(1-qComp)' -level 41 "$DEM.mp4"
ffmpeg -i ${VID} -acodec libfaac -ac 2 -ab 128k -async 2 -pass 2 \
-s ${WID}x${MOD16} -vcodec libx264 -vpre vhq -b ${KBPS}k -threads 0 \
-rc_eq 'blurCplx^(1-qComp)' -level 41 -y "$DEM.mp4"
vbr() {
ffmpeg -i ${VID} -acodec libfaac -ac 2 -aq 100 -async 2 \
-s ${WID}x${MOD16} -vcodec libx264 -vpre vhq -crf 20 -threads 0 \
-rc_eq 'blurCplx^(1-qComp)' -level 41 "$DEM.mp4"
captureDemo;
info;
height;
if [ -n "$3" ];
then
bitrate;
encode;
rm *2pass*.log
else
vbr;
fi
rm ${VID} && echo Finished!
If you wish to try my specific ffmpeg presets, they can be found here: http://bbs.archlinux.org/viewtopic.php? … 71#p441071
An example of the VBR encode: http://www.mediafire.com/?d1dd2xczz9z
I hope it's of some use.

Updated to retain quality when used with Nexuiz 2.5.1 & removed mplayer dependency.
#!/bin/sh
#Script to capture demo, calculate bitrate, scale & encode to mp4
#uses ffmpeg presets within ~/.ffmpeg (-vpre fast/-vpre vhq)
#examples: http://svn.mplayerhq.hu/ffmpeg/trunk/ffpresets
#depends: faac, ffmpeg & x264 (>20081002 recommended)
#use: ./dem2vid yourDemo.dem requiredWidth requiredSizeInMB
DEM="$1"
WID="$2"
MB="$3"
DEST="${1%.*}.mp4"
capture() {
LOC=`locate nexuiz-linux-sdl.sh | tail -1`
${LOC} -demo +cl_capturevideo 1 +cl_capturevideo_ogg 0 \
+cl_capturevideo_fps 24 +playdemo demos/${DEM}
VID=`find ~/.nexuiz/data/video/ -iname "dpvideo*.avi" -print | tail -1`
echo "Demo captured to ${VID}"
info() {
ffmpeg -i ${VID} 2> /tmp/$$
TH=`grep Duration /tmp/$$ | cut -d":" -f2 | cut -c 2-3`
TM=`grep Duration /tmp/$$ | cut -d":" -f3`
TS=`grep Duration /tmp/$$ | cut -d":" -f4 | cut -c 1-5`
SEC=$(echo "( ${TH} * 3600 ) + ( ${TM} * 60 ) + ${TS}" | bc)
RESX=`grep Video: /tmp/$$ | grep -o ....x | tr -d 'x '`
RESY=`grep Video: /tmp/$$ | grep -o x.... | tr -d 'x,'`
rm /tmp/$$ && echo ${RESX} ${RESY} ${SEC}
height() {
ASPECT=$(echo "scale=3; ${RESX} / ${RESY}" | bc)
HEIGHT=$(echo "${WID} / ${ASPECT}" | bc)
MOD16=$(( ${HEIGHT} / 16 * 16 ))
echo ${MOD16}
bitrate() {
RATE=$(echo "(( "$MB" * 1024 ) / ${SEC}) - 16" | bc)
R8=$(echo "(( ${RATE} * 8 ) * 1.02)" | bc)
KBPS=`echo "tmp=${R8}; tmp /= 1; tmp" | bc`
echo ${KBPS}
encode() {
ffmpeg -i ${VID} -pass 1 -s ${WID}x${MOD16} -vcodec libx264 -vpre fast \
-b ${KBPS}k -threads 0 -rc_eq 'blurCplx^(1-qComp)' -level 41 -an "$DEST"
ffmpeg -i ${VID} -acodec libfaac -ac 2 -ab 128k -async 2 -pass 2 \
-s ${WID}x${MOD16} -vcodec libx264 -vpre vhq -b ${KBPS}k -threads 0 \
-rc_eq 'blurCplx^(1-qComp)' -level 41 -psnr -y "$DEST"
vbr() {
ffmpeg -i ${VID} -acodec libfaac -ac 2 -aq 100 -async 2 \
-s ${WID}x${MOD16} -vcodec libx264 -vpre vhq -crf 20 -threads 0 \
-rc_eq 'blurCplx^(1-qComp)' -level 41 -psnr "$DEST"
capture;
info;
height;
if [ -n "$3" ];
then
bitrate;
encode;
rm *2pass*.log
else
vbr;
fi
rm ${VID} && echo "Finished! Saved as ${DEST}"
Last edited by ahaslam (2009-06-01 18:19:45)

Similar Messages

  • A script that captures the coordinates of the mouse clicks and saves them into a file

    Hello,
    I'm trying to create a cartoon taking a movie (I've chosen blade runner) as base. I've got the real movie and I've exported all the pictures using VirtualDUB. Now I have a lot of images to modify. I would like to modify the actors faces with the faces generated by Facegen modeller. I'm thinking how to make the whole process automatic because I have a lot of images to manage. I've chosen to use Automate BPA,because it seems the best for this matter. I'm a newbie,so this is my first attempt using Adobe Photoshop and Automate BPA. I wrote a little script. It takes a face generated with Facegen modeller and tries to put it above the original actors faces. But it doesn't work very good and I'm not really satisfied,because the process is not fully automated. To save some time I need to write a script that captures the coordinates of the mouse when I click over the faces and that saves them into a file,so that Automate BPA can read these coordinates from that file and can put the face generated with Facegen Modeller above the original face. I think that Automate BPA is not good for this matter. I think that two coordinates are enough,X and Y. They can be the coordinates of the nose,because it is always in the middle of every face. It is relevant to knows how big should be the layer of the new face,too. This is the Automate BPA code that I wrote :
    <AMVARIABLE NAME="nome_foto" TYPE="TEXT"></AMVARIABLE>
    <AMVARIABLE NAME="estensione_foto" TYPE="TEXT"></AMVARIABLE>
    <AMSET VARIABLENAME="nome_foto">br</AMSET>
    <AMSET VARIABLENAME="estensione_foto">.jpeg</AMSET>
    <AMVARIABLE NAME="numero_foto" TYPE="NUMBER"></AMVARIABLE>
    <AMVARIABLE NAME="coord_x" TYPE="NUMBER"></AMVARIABLE>
    <AMVARIABLE NAME="coord_y" TYPE="NUMBER"></AMVARIABLE>
    <AMWINDOWMINIMIZE WINDOWTITLE="Aggiungere_layer - AutoMate BPA Agent
    Task Builder" />
    <AMWINDOWMINIMIZE WINDOWTITLE="AutoMate BPA Server Management Console
    - localhost (Administrator)" AM_ONERROR="CONTINUE" />
    <AMENDPROCESS PROCESS="E:\Programmi_\Adobe Photoshop
    CS5\Photoshop.exe" AM_ONERROR="CONTINUE" />
    <AMRUN FILE="%&quot;E:\Programmi_\Adobe Photoshop CS5\Photoshop.exe&quot;%" />
    <AMPAUSE ACTION="waitfor" SCALAR="15" />
    <AMSENDKEY>{CTRL}o</AMSENDKEY>
    <AMPAUSE ACTION="waitfor" SCALAR="1" />
    <AMINPUTBOX RESULTVARIABLE="numero_foto">Inserire numero FOTO di
    partenza -1</AMINPUTBOX>
    <AMINCREMENTVARIABLE RESULTVARIABLE="numero_foto" />
    <AMPAUSE ACTION="waitfor" SCALAR="1" />
    <AMMOUSEMOVEOBJECT WINDOWTITLE="Apri" OBJECTNAME="%nome_foto &amp;
    numero_foto &amp; estensione_foto%" OBJECTCLASS="SysListView32"
    OBJECTTYPE="ListItem" CHECKOBJECTNAME="YES" CHECKOBJECTCLASS="YES"
    CHECKOBJECTTYPE="YES" />
    <AMMOUSECLICK CLICK="double" />
    <AMPAUSE ACTION="waitfor" SCALAR="10" />
    <AMSENDKEY>{CTRL}+</AMSENDKEY>
    <AMPAUSE ACTION="waitfor" SCALAR="20" />
    <AMSENDKEY>l</AMSENDKEY>
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSEMOVE MOVEX="429" MOVEY="281" RELATIVETO="screen" />
    <AMMOUSECLICK />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSEMOVE MOVEX="659" MOVEY="281" RELATIVETO="screen" />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSECLICK />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSEMOVE MOVEX="659" MOVEY="546" RELATIVETO="screen" />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSECLICK />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSEMOVE MOVEX="429" MOVEY="546" RELATIVETO="screen" />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSECLICK />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSEMOVE MOVEX="429" MOVEY="281" RELATIVETO="screen" />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSECLICK />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMSENDKEY>v</AMSENDKEY>
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSECLICK CLICK="hold_down" />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSEMOVE MOVEX="131" MOVEY="99" RELATIVETO="screen" />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSEMOVE MOVEX="99" MOVEY="162" RELATIVETO="screen" />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSECLICK CLICK="release" />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMINPUTBOX RESULTVARIABLE="coord_x">Inserire coordinata X</AMINPUTBOX>
    <AMINPUTBOX RESULTVARIABLE="coord_y">Inserire coordinata Y</AMINPUTBOX>
    <AMMOUSEMOVE MOVEX="200" MOVEY="200" RELATIVETO="screen" />
    <AMMOUSECLICK CLICK="hold_down" />
    <AMMOUSEMOVE MOVEX="%coord_x%" MOVEY="%coord_y%" RELATIVETO="position" />
    <AMMOUSECLICK />
    and this is a short video to explain better what I want to do :
    http://www.flickr.com/photos/26687972@N03/5331705934/
    In the last scene of the video you will see the script asking to input the X and the Y coordinates of the nose. This request is time consuming. For this reason I want to write a script that captures automatically the coordinates of the mouse clicks. The only thing to do should be click over the nose and the script should make the rest. As "c.pfaffenbichler" suggested here : http://forums.adobe.com/thread/775219, I could explore 3 ways :
    1) use the Color Sampler Tool’s input with a conventional Photoshop Script.
    2) use After Effects would provide a better solution.
    3) Photoshop’s Animation Panel might also offer some easier way as it might be possible to load two movies (or one movie and one image) and animate the one with the rendered head in relation to the other.
    Since I'm a totally newbie in graphic and animation,could you help me to explore these ways ? Thanks for your cooperation.

    These are the coordinates of the contours of the face that you see on the picture. Can you explain to me how they are calculated ? The coordinates of the first colums are intuitive,but I'm not able to understand how are calculated the coordinates of the second one.
    Thanks.
    1 COL     2 COL (how are calculated these values ?)
    307.5000 182.0000 m
    312.5000 192.0000 l
    321.5000 194.0000 l
    330.5000 193.0000 l
    335.0000 187.0000 l
    337.0000 180.5000 l
    340.0000 174.0000 l
    338.5000 165.5000 l
    336.0000 159.0000 l
    331.5000 153.0000 l
    324.5000 150.0000 l
    317.0000 154.0000 l
    312.5000 161.0000 l
    309.0000 173.0000 l
    307.5000 182.0000 l
    Message was edited by: LaoMar

  • DiskSpace Script not capturing all local disks - Help Please

    Hello,
    I am using a script to capture disk size for all local disks, however it is reporting incorrect disk sizes (example C drive reported as 30GB however it is actually50GB). It is also not reporting all local disks. Any help with below?
    $erroractionpreference = “SilentlyContinue”
    $a = New-Object -comobject Excel.Application
    $a.visible = $True
    $b = $a.Workbooks.Add()
    $c = $b.Worksheets.Item(1)
    $c.Cells.Item(1,1) = “Machine Name”
    $c.Cells.Item(1,2) = “Drive”
    $c.Cells.Item(1,3) = “Total size (GB)”
    $c.Cells.Item(1,4) = “Free Space (GB)”
    $c.Cells.Item(1,5) = “Free Space (%)”
    $c.cells.item(1,6) = "Name "
    $d = $c.UsedRange
    $d.Interior.ColorIndex = 19
    $d.Font.ColorIndex = 11
    $d.Font.Bold = $True
    $d.EntireColumn.AutoFit()
    $intRow = 2
    $colComputers = get-content "C:\Servers.txt"
    foreach ($strComputer in $colComputers)
    $colDisks = get-wmiobject Win32_LogicalDisk -computername $strComputer -Filter “DriveType = 3"
    foreach ($objdisk in $colDisks)
    $c.Cells.Item($intRow, 1) = $strComputer.ToUpper()
    $c.Cells.Item($intRow, 2) = $objDisk.DeviceID
    $c.Cells.Item($intRow, 3) = “{0:N0}” -f ($objDisk.Size/1GB)
    $c.Cells.Item($intRow, 4) = “{0:N0}” -f ($objDisk.FreeSpace/1GB)
    $c.Cells.Item($intRow, 5) = “{0:P0}” -f ([double]$objDisk.FreeSpace/[double]$objDisk.Size)
    $c.cells.item($introw, 6) = $objdisk.volumename
    $intRow = $intRow + 1
    $d.EntireColumn.AutoFit()
    cls

    I've just tested your script as is, and it worked perfectly.
    Are you sure those drives are regular?
    Have you tried just printing the results in the console instead of Excel? there might be some setting there that changes what you see.
    Also, have you considered the conversion between bytes and GB are misleading?

  • Questions on capture & encoding

    I have a project to capture & encode and not sure how to treat this. 6 of the clips are on DVD in what appears to be 4:3 letterbox(small bars) and the last clip is on Mini DV and also looks like 4:3 leterbox(small bars). The clip on Mini DV was captured in Final Cut at a regular DV setting and the DVD's straight to QT. Info setting on theApple DVD plyayer said all these DVD's were 4:3 aspect ratio. When I encode all thes clipsincluding Mini DV) will I encode for 4:3 or 16:9?
    Thanks (Drew)
    Jeff
    G4 DP 1 GIG G4 laptop 1.25, MBP 2.0 1 GIG   Mac OS X (10.4.6)  

    LOL Jeff
    I assume the bars are top and bottom? (Is this the other project?)
    One the clips on the DVD, are they encoded VOBs or DVs?
    Pop open some of the videos to see if the bars are in Quicktime.
    But before that, just a quick broad stroke overview.
    Cameras are going to shoot either 16:9 or 4:3
    There are ways of making transferring between the two, but usually items which are shot in 16:9 need to look good in 4:3
    To keep the director's vision, 16:9 is usually letterboxed on 4:3 DVDs. Some people drop bars on the top and bottom in an NLE, better way is just flag it as 16:9 Letterbox in DVD SP - on 16:9 it will look full 16:9 and on 4:3 letterboxed
    That being said if you pop things in QT and there are black bars in the QT file, it is faux letterbox so it is really 4:3 (the bars are not that subtle if added, so not sure what you are seeing.). Letterbox will have the bars on top and bottom
    Sounds like it may be 4:3? But you can also shoot 16:9 on mini DV. Let me know what the files on the DVD are and/or if you have any details on how the footage was shot. If you have the FCP file that was used, the answer should be there also (well it is there, but easy to see)

  • Dtrace script to capture time spent executing shell commands

    Hi all,
    My 1st dtrace script to capture time spent by oracle executing various commands, is this correct? It seems to work...
    #!/usr/bin/sh
    /usr/sbin/dtrace -n '
    #pragma D option quiet
    #pragma D option switchrate=10
    syscall::exec:entry, syscall::exece:entry
    /uid == 900/
    self->t = timestamp;
    syscall::exec:return, syscall::exece:return
    /uid == 900/
    printf("%-20d %s\n", (timestamp - self->t), curpsinfo->pr_psargs);
    thanks for any feedback.
    Regards
    Stuart

    Hi Stuart -
    Just to be clear, you wanted to know the time Oracle takes to exec() a command, or to actually run a short-lived process from start to finish? The script accomplishes the former, but I'm curious why you'd want that particular value.
    Michael

  • Quotation by Mail - Script not Capturing

    Dear All
    I am trying to send quotation through mail by the output type MAIL which is standard and am able to send mail to the people outside
    mail confirmation is also coming that it has been received, but what is happening is when we receive a mail and open the pdf we can see only empty pdf it is not capturing the script of quotation
    have tried with Basis for the ADS ( Adobe Document services ) installation and is working fine and tried with abaper also by attaching a form and it is still not working
    can any body help me on this issue, pls note i am using standard output MAIL funtionality
    Thanks & Regards
    Naveen

    Thanks for the reply jelena i have solved the issue
    instead of using MAIL output i have customized ZN00 and more over MAIL is used to just send a message in pdf by entering in NACE and enter some text in mail title and texts folder
    Thanks & Regards
    Naveen

  • Scripting the capture process in Vivado 2015.1 ILA using the tcl

    Hello,
    I'm wondering how can I use the TCL script in order to automate the capturing process. 
    The way that it works so far is that I have to change the condition manually through the GUI, start trigrring, waiting for it to upload the waveform (I really would like to bypass this step!) and then downloading the captured data in .csv file. I've tried the attached script to automate two captures, it didn't work though :( I got same results for test0.csv and test1.csv
    any ideas?!
    set_property TRIGGER_COMPARE_VALUE eq5'u1 [get_hw_probes state_reg__0 -of_objects [get_hw_ilas hw_ila_1]]
    wait_on_hw_ila hw_ila_1
    run_hw_ila hw_ila_1
    wait_on_hw_ila hw_ila_1
    write_hw_ila_data -csv_file d:/pss/test0.csv [current_hw_ila_data]
    set_property TRIGGER_COMPARE_VALUE eq5'u10 [get_hw_probes state_reg__0 -of_objects [get_hw_ilas hw_ila_1]]
    wait_on_hw_ila hw_ila_1
    run_hw_ila hw_ila_1
    wait_on_hw_ila -timeout 0 hw_ila_1
    write_hw_ila_data -csv_file d:/pss/test1.csv [current_hw_ila_data]
     

    Hello Pratham,
    I have tried that before. it works perfectly saving one shot of the ILA. However if you just copy and past, it will fail for the 2nd captured data. (it will save the same thing).
    What I'm particularly looking is saving more than one sample, let's say I would like to automate for 1000 captures.
    The problem that I've encountered follows as this:
    When you try to capture more than one sample, it doesn't stop the trigger and when it does it will save the same thing. in order to stop it it needs to upload the waveform (which is really time consuming and I don't need the tool to upload it in order to captuer the .csv data!) so it will slow down the capturing process.
    In ChipScope it was very easy to do that! there was an option called repetitive trigger on. and it was easily capturing down repeatedly with log1, log2, ... and so forth. I'm looking for that!

  • Applescript/shells script for capture one

    Hey,
    Wanting a script that will take the last item copied to the clipboard (which will be a folder name), search for it in finder, in "this mac", and then open the folder in Capture One.  It would be great if it were ready to run, so I could launch it each time with a keystroke.  Any one willing to help me on this.  Thanks so much!!
    I know a little applescript, but this one is kind of out of my league, I think, at least.

    Hi,
    You can use this script in an Automator Service (you can assign a keystroke combination to this service).
    If the script find one folder whose name equal the contents of the clipboard, "Capture One" will open this folder.
    if the script finds multiple folders whose name equal the contents of the clipboard, it will do nothing, because I don't know what you want in this case.
    To create a service, you start by selecting New from Automator's File menu.
    You should select the Service option, which is accompanied by a gear icon, clic "Choose" button.
    In your new service, you will see a bar at the top of the Automator flow pane. It has combo boxes that allow you to set filters that establish the conditions in which your service should be made accessible. You want to make a service that receives selected "No Input" and will operate in any application or select an application.
    Add the "Run Shell Script" action
    Copy/paste this script in the action:
    folder=$(mdfind "kMDItemFSName = \"$(pbpaste -Prefer txt)\" && kMDItemContentType = \"public.folder\"")
    if [ -z $folder ];then exit 0;fi ## no match
    tot=$(wc -l <<< "$folder")
    if [ $tot -eq 1 ]; then open -b 'com.phaseone.captureone7' "$folder"; fi
    Replace the bundle identifier in this script --> 'com.phaseone.captureone7'
    To know the bundle identifier of your "Capture One" application, run this AppleScript, copy the result to change the  bundle identifier in the shell script
    tell application "Finder" to get id of (application "Capture One")
    Save the service, quit Automator
    The final step is to assign a keystroke combination to the newly created service.
    Open the System Preferences application and navigate to the Keyboard preference pane, and select the Shortcuts tab.
    From the list on the left of the preference pane, select the Services category.
    A list of the installed services will be displayed to the right.
    Scroll to the last category titled General, and locate the service you just created.
    Double-click to the far right of the service name to activate the keystroke input field and then type the key combination you wish to assign to the service.
    Close the System Preferences application.

  • Nice set of perl scripts for h264 encoding stuff

    I have found a nice set of perl script written for flexible h264 related encoding. They were originally developed for gentoo but they also run fine under Debian. I guess running them under arch will work as well.
    Here is the original thread over at the Gentoo Forum:
    http://forums.gentoo.org/viewtopic-t-74 … 444a855600
    Here is the webpage from the author plus a newly build install bash script which will download and install the encoding suite:
    http://blog.fangornsrealm.eu/
    May be someone likes to build a package ?
    I am not using arch this much the last few month. So I am kind of the wrong guy for building such a package
    -D$

    I have found a nice set of perl script written for flexible h264 related encoding. They were originally developed for gentoo but they also run fine under Debian. I guess running them under arch will work as well.
    Here is the original thread over at the Gentoo Forum:
    http://forums.gentoo.org/viewtopic-t-74 … 444a855600
    Here is the webpage from the author plus a newly build install bash script which will download and install the encoding suite:
    http://blog.fangornsrealm.eu/
    May be someone likes to build a package ?
    I am not using arch this much the last few month. So I am kind of the wrong guy for building such a package
    -D$

  • Shell script that captures key input? (keylogger)

    I want to record all my keystrokes, just to see the frequency of some keys. There is a bunch of keyloggers on google that captures keystrokes, but none that is good and is in the AUR. Isn't it possible to do just with a little shell script? I don't mind if i have to keep the terminal open, and there is no need for any daemon/advanced stuff. Could you record a /dev/something or similar?

    Haha, check this out: (cursor=move, z=fire, q=quit)
    #! /usr/bin/python
    from curses import *
    import threading
    class ckeylog( threading.Thread ):
    def run(self):
    file=open("/dev/input/event1","rb")
    keymap={
    '\x2c': 'z',
    '\x2d': 'x',
    '\x2e': 'c',
    '\xc8': 'UP',
    '\xd0': 'DOWN',
    '\xcb': 'LEFT',
    '\xcd': 'RIGHT',
    '\x10': 'q',
    '\x11': 'w',
    '\x12': 'e',
    '\x01': 'ESC',
    '\x2a': 'LSHIFT',
    '\x1c': 'ENTER',
    self.loop=True
    while self.loop:
    event=file.read(48)
    if event[28] == '\x01':
    state=True
    elif event[28] == '\x00':
    state=False
    else:
    continue
    if event[12] in keymap:
    self.map[keymap[event[12]]]=state
    file.close()
    def quit(self):
    self.loop=False
    keylog=ckeylog()
    keylog.map={}
    keylog.start()
    def main(s):
    curs_set(0)
    ship=[
    "| /\ |",
    "+/!!\+",
    shipx=0
    shipy=0
    bullet="* *"
    bulletx=0
    bullety=0
    fire=False
    while True:
    (my,mx)=s.getmaxyx()
    if 'q' in keylog.map:
    if keylog.map['q']: keylog.quit(); return
    if 'UP' in keylog.map:
    if keylog.map['UP']: shipy=shipy-1
    if 'DOWN' in keylog.map:
    if keylog.map['DOWN']: shipy=shipy+1
    if 'RIGHT' in keylog.map:
    if keylog.map['RIGHT']: shipx=shipx+1
    if 'LEFT' in keylog.map:
    if keylog.map['LEFT']: shipx=shipx-1
    if 'z' in keylog.map:
    if keylog.map['z']: (fire,bullety,bulletx)=(True,shipy,shipx)
    if shipy<0: shipy=0
    if shipy>my-len(ship): shipy=my-len(ship)
    if shipx<0: shipx=0
    if shipx>mx-len(ship[0]): shipx=mx-len(ship[0])
    if fire and bullety == 0: fire=False
    if fire: bullety=bullety-1
    s.erase()
    s.addstr(shipy,shipx,ship[0])
    s.addstr(shipy+1,shipx,ship[1])
    try:
    s.addstr(shipy+2,shipx,ship[2])
    except error: pass
    if fire: s.addstr(bullety,bulletx,bullet)
    s.refresh()
    napms(10)
    wrapper(main)

  • PL/SQL scripts to capture real time performance usage

    Looking for a PL/SQL script to gather real time accurate information on memory, CPU, I/O stats for users accessing tables in Oracle 10g database on Red Hat Linux.

    Google Search - DBA Scripts
    1) http://www.oracle-base.com/dba/DBACategories.php
    2) http://www.dbazine.com/oracle/or-articles/liu2
    3) http://www.pro-dba.com/oracle_scripts.html

  • XI 2.0 installation script for creating XI Sandbox Demo System

    Does any have a Windows2000 XI 2.0 installation script designed to create minimal XI Sandbox?  Brief installing instructions.

    Hi Dan
    There is no Installation Script for XI-2.0. The document you have to check is the XI 2.0 installation guide.
    Regards
    Prasad
    SAP Netwaver RIG-XI
    SAP Labs LLC, USA

  • Ssis script component capture column LinageID in try catch

    I have created a SSIS Script Component which has two outputs. Named output0 and ErrorOutput.
    I have rapped the code in a TRY/CATCH block and output the exception message in the ErrorOutputBuffer.
    The exception message lists the error, but does not identify which column the error occurred on.
    Is this possible to do?
    Mr Shaw

    Hi Mr Shaw,
    AFAIK, no -- there is not way to propagate the column information in a script to an error handling.
    But what may help is the faulty value, this would perhaps indicate what column could have triggered the exception.
    Arthur My Blog

  • How to capture the SSAS server response to an XMLA command issued in VB Script

    Hi all,
    I have an SSIS package that contains a VB script task that sends XMLA commands to my SSAS server.  (I am using a script task and not the DDL task because there is lengthy logic required to build the XMLA command and send it to the appropriate
    server.)
    The problem I have is that while I have been able execute the XMLA command against the SSAS server, I am not able to capture the full response from the server.  Warnings are not being captured and other data is missing.  My code currently is as
    follows:
    Dim cn As New AdomdClient.AdomdConnection
    Dim cmd As New AdomdClient.AdomdCommand
    Dim returnValue As Object
    cn.ConnectionString = "Data Source=MyServer;Initial Catalog=MyDB;Provider=MSOLAP.5;Integrated Security=SSPI;"
    cn.Open()
    cmd.Connection = cn
    cmd.CommandText = fileReader
    On Error Resume Next
    returnValue = cmd.Execute()
    MsgBox(Err.Description)
    cn.Close()
    Note that "fileReader" is the string containing the XMLA command.
    If the xmla processes a dimension, and there are duplicate keys (for which it is set to error and stop), Management Studio give the response shown below, which includes the warning indicating there are duplicate keys:
    <return xmlns="urn:schemas-microsoft-com:xml-analysis">
    <results xmlns="http://schemas.microsoft.com/analysisservices/2003/xmla-multipleresults">
    <root xmlns="urn:schemas-microsoft-com:xml-analysis:empty">
    <Exception xmlns="urn:schemas-microsoft-com:xml-analysis:exception" />
    <Messages xmlns="urn:schemas-microsoft-com:xml-analysis:exception">
    <Warning WarningCode="1092550658" Description="Errors in the OLAP storage engine: A duplicate attribute key has been found when processing: Table: 'MyDim', Column: 'MyCol', Value: 'XYZ'. The attribute is 'MyAttr'." Source="Microsoft SQL Server 2012 Analysis Services" HelpFile="" />
    <Error ErrorCode="3238002695" Description="Internal error: The operation terminated unsuccessfully." Source="Microsoft SQL Server 2012 Analysis Services" HelpFile="" />
    However, in the VB script it captured in Err.description just some of the error: "Errors in the OLAP storage engine: An error occurred while the "MyAttr" attribute of the "MyDim" was being processed".
    Is there anyway to capture in the VB Script the full XML error as it appears in Management Studio?
    Help would be much appreciated!
    Thanks
    Guy

    Another method for executing XMLA is using Microsoft.AnalysisServices.Xmla;
    C# code will look like below:
    using Microsoft.AnalysisServices.Xmla;
      XmlaClient clnt = new XmlaClient();
                      string strOut = "", strMsg="";
                      string strXmla = File.ReadAllText(strXmlaFileName);
      clnt.Connect(strServer);
                      clnt.Execute(strXmla, "", out strOut, false, true);
                      clnt.Disconnect();
                      //check status
                      //Create the XmlDocument.
                      XmlDocument doc = new XmlDocument();
                      doc.LoadXml(strOut);
                      //display Error
                      XmlNodeList elemList = doc.GetElementsByTagName("Error");
                      for (int i = 0; i < elemList.Count; i++)
                          Console.WriteLine(elemList[i].Attributes["Description"].Value);
                          strMsg += elemList[i].Attributes["Description"].Value + "\r\n" ;
                          ++intExitCode;
                      //display warnings
                      elemList = doc.GetElementsByTagName("Warning");
                      for (int i = 0; i < elemList.Count; i++)
                          Console.WriteLine("Warning:" + elemList[i].Attributes["Description"].Value);
                          strMsg += elemList[i].Attributes["Description"].Value + "\r\n" ;
    Hope this helps.
    Arun

  • Capturing log files from multiple .ps1 scripts called from within a .bat file

    I am trying to invoke multiple instances of a powershell script and capture individual log files from each of them. I can start the multiple instances by calling 'start powershell' several times, but am unable to capture logging. If I use 'call powershell'
    I can capture the log files, but the batch file won't continue until that current 'call powershell' has completed.
    ie.  within Test.bat
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > a.log 2>&1
    timeout /t 60
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > b.log 2>&1
    timeout /t 60
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > c.log 2>&1
    timeout /t 60
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > d.log 2>&1
    timeout /t 60
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > e.log 2>&1
    timeout /t 60
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > f.log 2>&1
    the log files get created but are empty.  If I invoke 'call' instead of start I get the log data, but I need them to run in parallel, not sequentially.
    call powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > a.log 2>&1
    timeout /t 60
    call powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > b.log 2>&1
    timeout /t 60
    call powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > c.log 2>&1
    timeout /t 60
    call powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > d.log 2>&1
    timeout /t 60call powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > e.log 2>&1
    Any suggestions of how to get this to work?

    Batch files are sequential by design (batch up a bunch of statements and execute them). Call doesn't run in a different process, so when you use it the batch file waits for it to exit. From CALL:
    Calls one batch program from another without stopping the parent batch program
    I was hoping for the documentation to say the batch file waits for CALL to return, but this is as close as it gets.
    Start(.exe), "Starts a separate window to run a specified program or command". The reason it runs in parallel is once it starts the target application start.exe ends and the batch file continues. It has no idea about the powershell.exe process
    that you kicked off. Because of this reason, you can't pipe the output.
    Update: I was wrong, you can totally redirect the output of what you run with start.exe.
    How about instead of running a batch file you run a PowerShell script? You can run script blocks or call individual scripts in parallel with the
    Start-Job cmdlet.
    You can monitor the jobs and when they complete, pipe them to
    Receive-Job to see their output. 
    For example:
    $sb = {
    Write-Output "Hello"
    Sleep -seconds 10
    Write-Output "Goodbye"
    Start-Job -Scriptblock $sb
    Start-Job -Scriptblock $sb
    Here's a script that runs the scriptblock $sb. The script block outputs the text "Hello", waits for 10 seconds, and then outputs the text "Goodbye"
    Then it starts two jobs (in this case I'm running the same script block)
    When you run this you receive this for output:
    PS> $sb = {
    >> Write-Output "Hello"
    >> Sleep -Seconds 10
    >> Write-Output "Goodbye"
    >> }
    >>
    PS> Start-Job -Scriptblock $sb
    Id Name State HasMoreData Location Command
    1 Job1 Running True localhost ...
    PS> Start-Job -Scriptblock $sb
    Id Name State HasMoreData Location Command
    3 Job3 Running True localhost ...
    PS>
    When you run Start-Job it will execute your script or scriptblock in a new process and continue to the next line in the script.
    You can see the jobs with
    Get-Job:
    PS> Get-Job
    Id Name State HasMoreData Location Command
    1 Job1 Running True localhost ...
    3 Job3 Running True localhost ...
    OK, that's great. But we need to know when the job's done. The Job's Status property will tell us this (we're looking for a status of "Completed"), we can build a loop and check:
    $Completed = $false
    while (!$Completed) {
    # get all the jobs that haven't yet completed
    $jobs = Get-Job | where {$_.State.ToString() -ne "Completed"} # if Get-Job doesn't return any jobs (i.e. they are all completed)
    if ($jobs -eq $null) {
    $Completed=$true
    } # otherwise update the screen
    else {
    Write-Output "Waiting for $($jobs.Count) jobs"
    sleep -s 1
    This will output something like this:
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    When it's done, we can see the jobs have completed:
    PS> Get-Job
    Id Name State HasMoreData Location Command
    1 Job1 Completed True localhost ...
    3 Job3 Completed True localhost ...
    PS>
    Now at this point we could pipe the jobs to Receive-Job:
    PS> Get-Job | Receive-Job
    Hello
    Goodbye
    Hello
    Goodbye
    PS>
    But as you can see it's not obvious which script is which. In your real scripts you could include some identifiers to distinguish them.
    Another way would be to grab the output of each job one at a time:
    foreach ($job in $jobs) {
    $job | Receive-Job
    If you store the output in a variable or save to a log file with Out-File. The trick is matching up the jobs to the output. Something like this may work:
    $a_sb = {
    Write-Output "Hello A"
    Sleep -Seconds 10
    Write-Output "Goodbye A"
    $b_sb = {
    Write-Output "Hello B"
    Sleep -Seconds 5
    Write-Output "Goodbye B"
    $job = Start-Job -Scriptblock $a_sb
    $a_log = $job.Name
    $job = Start-Job -Scriptblock $b_sb
    $b_log = $job.Name
    $Completed = $false
    while (!$Completed) {
    $jobs = Get-Job | where {$_.State.ToString() -ne "Completed"}
    if ($jobs -eq $null) {
    $Completed=$true
    else {
    Write-Output "Waiting for $($jobs.Count) jobs"
    sleep -s 1
    Get-Job | where {$_.Name -eq $a_log} | Receive-Job | Out-File .\a.log
    Get-Job | where {$_.Name -eq $b_log} | Receive-Job | Out-File .\b.log
    If you check out the folder you'll see the log files, and they contain the script contents:
    PS> dir *.log
    Directory: C:\Users\jwarren
    Mode LastWriteTime Length Name
    -a--- 1/15/2014 7:53 PM 42 a.log
    -a--- 1/15/2014 7:53 PM 42 b.log
    PS> Get-Content .\a.log
    Hello A
    Goodbye A
    PS> Get-Content .\b.log
    Hello B
    Goodbye B
    PS>
    The trouble though is you won't get a log file until the job has completed. If you use your log files to monitor progress this may not be suitable.
    Jason Warren
    @jaspnwarren
    jasonwarren.ca
    habaneroconsulting.com/Insights

Maybe you are looking for

  • Exception currencies TCURX table, R3 - BW loading issue

    Hello Friends, I am facing issue in report values for amount in local currency key field. Its value not matching with R3 values. Decimal places are shifted in report. We are on BI7 (RSDS data source). There is data coming from R3 into one DSO from di

  • How to access classes in jar files

    hi I have added a jar file to my project in eclipse.How to access the classes in that jar file?

  • F110 - several bank accounts for the vendor,which one is retrieved by SAP?

    Hi gurus, When using data medium exchange in transaction F110 for a customer (or a vendor) that has several bank accounts in the customer (vendor) master record, which one amongst those accounts will be retrieved by the system ? Ronan Edited by: Rona

  • Pixels?

    Up in the upper right hand corner of my ipod screen there is a little pixel that never changes colors. It always looks kind of pinkish. You cant really tell if the background is white but if the screen is dark, like when I'm watching a movie, it real

  • Apply Random Color to Group of Objects

    Hello all, thanks for taking the time to help. Here's my issue... lets say I have 600 different objects in illustrator (just little circles with a fill color, no stroke) and 6 different colors that these circles should be. That means, I'd like about