Archive

Archive for the ‘Code’ Category

How to fix the sound on new MKV files with PS3 Media Server

August 16th, 2010 GrooV No comments

I recently discovered that mkvmerge‘s 4.1.0 update broke the sound on the video streaming application PS3 Media Server. It all worked fine, but no sound! Appearantly the guys @ mkvtoolnix decided that its time to start using compressed audio headers to save a few kb’s on a 7GB file (700kb). This is their response:

The Matroska specifications know a feature called “header removal compression”. This allows a muxer to keep a certain number of bytes that are identical for each frame in the track headers removing them from the individual frames. This reduces the size of the tracks significantly without altering the content as a demuxer can add the bytes found in the track headers to each frame during demuxing.

Starting with v4.1.0 mkvmerge uses header removal compression for a couple of track types by default. These include AC3, DTS and MP3 audio tracks as well as Dirac and MPEG-4 part 2 (aka. XviD/DivX) video tracks. The user muxing a file may disable it by explicitely selecting ‘none’ as the compression scheme for such a track.

If your player has difficulties playing such files then it is a bug in that player or in the demuxer but not in mkvmerge. This feature has been part of the Matroska specification since more than six years, and there’s no excuse for refusing to add support for it.

The proper solution is to ask the vendor of your player to support this feature. A temporary solution is to re-mux such files turning off extra compression for all tracks.

Thanks to our friends @ the PS3 Media Server forum there is a way to fix this by getting the latest mencoder/mplayer files!

First change:
Replaced only mencoder.exe & mplayer.exe in the “ps3 media server\win32\” directory with the mencoder.exe & mplayer.exe from here: http://sourceforge.net/projects/mplayer-win32/files/MPlayer%20and%20MEncoder/revision%2031878. (MPlayer-p4-svn-31878.7z)

Result:
Transcoding with mencoder and “Enhanced multicore support for H264 HD” selected still lacks audio.
Transcoding with mencoder and “Enhanced multicore support for H264 HD” unselected works (not verified with subtitles though). One core used of course then.
Streaming with tsMuxer now also works !?! when “Switch to tsMuxer…” option is enabled under mencoder settings. (No mistake, the PS3 now can do the decoding fine (5.1 sound & h264) which I find strange.)

Second change:
Replaced mencoder_mt.exe in the “ps3 media server\win32\” directory with mencoder.exe (yes, renamed file to _mt.exe) from here: http://sourceforge.net/projects/mplayer-win32/files/MPlayer%20MT/revision%2031878. (MPlayer-p4-svn-31878-mt.7z) <– NOTICE this is a different link and file than the previous… “MT”

Result:
Transcoding with mencoder and “Enhanced multicore support for H264 HD” selected works! Both my cores are running at 100%, video and (5.1) audio works!
Transcoding with mencoder and “Enhanced multicore support for H264 HD” unselected works (not verified with subtitles though). One core used of course then.
Streaming with tsMuxer now also works !?! when “Switch to tsMuxer…” option is enabled under mencoder settings. (No mistake, the PS3 now can do the decoding fine (5.1 sound & h264) which I find strange.)

A little update on OpenStreetMap

April 16th, 2010 GrooV No comments

As I wrote before, I’ve been working on an OpenStreetMap application in .NET that renders directly to the screen instead of using pre-rendered tiles. I’ve been working on this for a few hours a week for the last 4 weeks and I’ve made big progress in the load times. It loads the ways & nodes in 20-30secs and renders the map on a 1650×1050 resolution in 0.6-0.8 seconds :) It still not real time but I am using the .NET GDI+ library which does not support any hardware acceleration, I have been thinking of moving to a different method of painting like WPF, OpenGL or D3D since those methods do have HW acceleration

As a side project I’ve been working on a little path finding as wel but that is still in a pre-alpha status :)

Thats it for today

Categories: Code Tags:

OpenStreetMap.Net

June 15th, 2009 GrooV No comments

After I finished some of my projects recently, I found a new project! It doesnt have any use yet but its going to be an OpenStreetMap parser for .Net. Ofcourse there are already OpenStreetMap applications written in .Net but I want to try out some for myself.

First of all, OpenStreetMap files are .osm files with XML markup. As we all know, XML can be pretty big and slow. At first, I thought it would be a nice idea to put all this info in a SQLite database. But after running some test I found out that it was even slower then XML. I searched abit on the internet and decided I could use binary files aswel. I wrote a small binary reader/writer and the 1.5GB XML of The Netherlands is now only 250MB. And its loaded in ~3seconds, depending on the amount of tags.

Read more…

Automatic clipboard to imageshack uploader

June 6th, 2009 GrooV No comments

ClipBoard2ImageShack

Small tool to upload an image in your clipboard to imageshack! It automatically makes a history.txt with all your uploaded image url’s. The ImageShack URL is copied to the clipboard when the upload is finished

Read more…

Categories: Code Tags: , , ,

Why crypto laws suck

August 12th, 2008 GrooV No comments

I have wasted 6hours to find out why my Java blowfish encryption script gave an illegal keysize exception, and it was because this pathetic law;

The export of cryptography refers to the transfer from one country to another of devices and technology related to cryptography. Since World War II, Western governments, including the U.S. and its NATO allies, have regulated the export of cryptography for national security considerations, and, for a time, defined cryptography to be a munition.

In order to fix this problem, just download the JCE (Java Cryptography Extension) libs from the official Sun site

Categories: Code Tags: , ,

Java MySQL Connection pool with anti-idle and Log4j

December 24th, 2007 GrooV No comments

I recently needed a MySQL Connection pool for a multithreaded Java application. I searched on Google and found this site but it didnt support some kind of anti-idle and logging. With the original application the connection stays in the available connection list even if its closed by the MySQL for being idle.

I changed the code and added a query every minute and Log4j
Read more…

Categories: Code, Computers Tags: , , ,

Powerdesigner BUG!

October 16th, 2007 GrooV 1 comment

w00t, I found a bug! :D

I need to use Powerdesigner for College. So I installed the latest version, 12.5 on my laptop. It all ran fine, no clouds on the horizon ;)

So I decided to make some workshop’s. The workshop document was a word file, so I launched Word 2007. I readed the workshop and started with Powerdesigner. After 5 minutes, I came back to Word and tried to select a piece of text. Ack! No focus in the edit field! I restarted Word and it all seemed fine but when I minimized the window and reopend it, the problem came back.

I tried everything (not knowing it was caused by Powerdesigner) repairing & reinstalling Word. Didnt help at all.

Today, I was browsing through the Word settings and I came across a COM Application tab. I opend it and I saw that there was a Powerdesigner COM Component installed. I didnt want that since I did not use that part of Powerdesigner. After I removed the component & restarted Word, it all seemed to work again. I rebooted my laptop to be sure, but the problem was gone!

After I looked closely to the Powerdesigner installation, I found out that it is not possible to skip the COM part in the installer

To bad program’s like ArgoUML don’t work that great… yet

Groupware

October 16th, 2007 GrooV No comments

In our project group @ college, we like to share our code/documents with each other. Email would be an option for this, but we rather have a central place to store our information. A few months ago, I setup an ActiveCollab install on this server. ActiveCollab is an online collaboration tool made for company’s and other groups. It works pretty easy and its based on PHP & MySQL.

But the problem is, the webbased interface is kinda… overkill. And it does not support any kind of merge or branch. It does support multiple revisions but its just a different file under the same name, no advanced svn functions.

So we we’re kinda stuck with chosing what we should use. SVN is nice but it does not have a fancy interface where you can add messages and tasks easily. Actually it does not have any GUI.

We made the disscion to go back to SVN. And it really works well, but the problem is, Powerdesigner‘s files are not really SVN friendly. We need to make our domain models, class diagrams and sequence diagrams in Powerdesigner 12.5. And everytime you add an object (Class, actor) it renames all the other objects. This means we cant merge the files and work together on one big file… :(

It’s time that someone starts working on the ultimate -free- groupware application

Categories: Code, College, Computers Tags: , , ,