Saturday, May 23, 2009

The Silver Bullet for PS3 Streaming and transcoding

A while ago I bought a Sony Playstation 3 (PS3) to use it as a gaming and media box. But finding a decent video streaming solution on the linux platform turned to be quite a hassle. After a lot of time searching for the ultimate solution supporting all kinds of codecs and transcoding to the ps3, I landed on Fuppes. It wasn't the perfect solution but it solved most of my media issues.

But then I found the ps3mediaserver-project. The feature list is huge, it supports all kinds of codecs through a ton of libraries. Runs on Java, and therefore platform-independent, Yeay!

Current features (from http://code.google.com/p/ps3mediaserver/)

* Ready to launch and play. No codec packs to install. No folder configuration and pre-parsing or this kind of annoying thing. All your folders are directly browsed by the PS3, there's an automatic refresh also.
* Real-time video transcoding of MKV/FLV/OGM/AVI, etc.
* Direct streaming of DTS / DTS-HD core to the receiver
* Remux H264/MPEG2 video and all audio tracks to AC3/DTS/LPCM in real time with tsMuxer when H264 is PS3/Level4.1 compliant
* Full seeking support when transcoding
* DVD ISOs images / VIDEO_TS Folder transcoder
* OGG/FLAC/MPC/APE audio transcoding
* Thumbnail generation for Videos
* You can choose with a virtual folder system your audio/subtitle language on the PS3!
* Simple streaming of formats PS3 natively supports: MP3/JPG/PNG/GIF/TIFF, all kind of videos (AVI, MP4, TS, M2TS, MPEG)
* Display camera RAWs thumbnails (Canon / Nikon, etc.)
* ZIP/RAR files as browsable folders
* Support for pictures based feeds, such as Flickr and Picasaweb
* Internet TV / Web Radio support with VLC, MEncoder or MPlayer
* Podcasts audio/ Video feeds support
* Basic Xbox360 support
* FLAC 96kHz/24bits/5.1 support
* Windows Only: DVR-MS remuxer and AviSynth alternative transcoder support

Go get it now!

Tuesday, March 3, 2009

Optimize git-svn workflow with bash auto complete and Hack&Ship scripts

I've just started using Git at work. We have a large and old subversion repository at work, so git-svn comes to the rescue. Git-svn provides a connection between a central subversion repository and your local git repository. This enables you to get most of the benefits git provides, while still adhering to company standards and commit code to a subversion repository.

I recommend reading Git SVN Workflow to get started with git-svn.

I had some trouble installing Git properly on my computer running Ubuntu 8.10. When executing git svn rebase I got the following message:

Can't locate SVN/Core.pm

After a lot of debugging I figured i was missing a perl library. Installing libsvn-perl did the trick:

sudo aptitude install libsvn-perl


To get the most out of git-svn I'm using git bash completion and two small Hack && Ship scripts to automate the workflow.

Bash autocompletion

Download and install git-completion.sh

Modify your PS1 variable in ~/.bashrc to show the current branch when inside a directory in a git repository:

PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '


Your prompt will look something like this:

neo@zion:~/dev/emp (trunk)$


Automating the workflow

The recommended git workflow is to create a branch for every new feature you work on. For your branches to be up to date you have to switch to your master branch, rebase with the svn repository, switch back to your branch and then rebase your branch with the master. This is 4 commands that can be automated.

hack.sh

#!/bin/bash
CURRENT=`git branch | grep '\*' | awk '{print $2}'`
status=`git checkout master | awk '{print $1}'`
if [[ ! "${status}" =~ error ]]; then
git svn rebase
git checkout ${CURRENT}
git rebase master
fi


After making sure your branch is up to date you'll want to merge your branch with the master and then push your changes to the central repository (the subversion repository):

ship.sh

#!/bin/bash
CURRENT=`git branch | grep '\*' | awk '{print $2}'`
git rebase -i master
status=`git checkout master | awk '{print $1}'`
if [[ ! "${status}" =~ error ]]; then
git merge ${CURRENT}
git svn dcommit
fi

Thursday, February 26, 2009

CXF - How to set a custom endpoint address

For some reason it is rarely straight forward how to configure a Java Web Service framework to use a custom endpoint address (one that is not in the WSDL). Anyway, here is how you do it in CXF:


URL wsdl = getClass().getResource("myservice.wsdl.xml");
MyService service = new MyService(wsdl).getMyServicePort();
BindingProvider bp = (BindingProvider)service;
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, URL);

Thursday, February 19, 2009

Linux one liner: When did I come to work today?

I'm usually quite tired when I get up in the morning. Beeing a consultant with flexible hours, it is often easy to forget exactly when I got to the office in the morning. So I figured i had to write a script to check when I started my computer. What it does is checking the syslog for the first occurence of todays date. I'm running Ubuntu linux and the syslog file is rotated a while after my computer has started. This is why I'm checking syslog.0.

The magic one liner:

date "+%b %d" | xargs -i grep -m1 -i {} /var/log/syslog.0
|awk '{ print "Today I got to work at " $3 }'

(Syntax plugin didn't handle long lines properly. Remove the and put the entire thing on one line.)