I struggled with getting the mpeg2 movies from my JVC Everio HD camera into a smaller file and up onto a video sharing site with high quality.

My first attempt was with Handbrake. That converted the MOV to an MP4 very nicely. However, I wasn’t able to upload those to Blip.tv and have them convert successfully every time to an flv. Blip was timing out on the longer videos and poorly converting the smaller ones.

I then decided to try the command line ffmpeg. There weren’t any gui tools around it that I found in the repo’s, so I just tried the standard

ffmpeg -i inputfilename.mov outputfilename.flv

but that did not work. Apparently JVC doesn’t put all the right properties into the mpg2 for ffmpeg to automatically pick up the properties because I kept getting a Floating point exception.

I assumed I needed to just manually set the full command with all the different video and audio settings, but I didn’t know what those should be.

After a bit more googling I found winff. From that app I copied the command line arguments over, tweaked them a bit, and came out with this:

ffmpeg -i INPUTFILENAME.mov -vcodec libx264 -deinterlace -vpre hq -crf 22 -r 29.97 -s 960×540 -aspect 16:9 -bf 2 -b 2000kb -ac 1 -ar 22050 -ab 96k OUTPUTFILENAME.flv

The trick is to use the libx264 codec instead of the flv one. After uploading these converted movies to Blip.tv I was pleased with the results.

This is in the babble category tagged as , , , , , , ,

Add a comment »

We have well over 50 million rows in our obs table. Using the simple “update obs set uuid = uuid() where uuid is null” would bomb out with a “The total number of locks exceeds the lock table size” error.

I ran this for a few hours to get through all rows. (Note that it overwrites any uuids that are currently there)

Copy this into a sql script and run it with “source” in mysql at command line.

drop procedure update_uuids;
delimiter //
create procedure update_uuids() begin
set @max = (select max(obs_id) from obs);
set @x = 1;
repeat
set @y = @x + 100000;
update obs set uuid = uuid() where obs_id >=@x and obs_id <@y;
set @x = @y;
until @x > @max
end repeat;
end
//
delimiter ;
call update_uuids();

This is in the openmrs category tagged as , , ,

2 comments »

A programmer here at AMPATH (Gilbert Tuwei) had some issues installing mysql. The error message was very unhelpful and the solution was equally puzzling, so I want to put here to for the mighty google to find.

Tuwei was running v5.0.17 of MySQL. Upgrading to version 5.1.31 made the problem disappear.

WARN – InitializationFilter$InitializationCompletion$1.run(823) |2009-10-02 15:24:21,000| Error while trying to update to the latest database version
org.openmrs.util.DatabaseUpdateException: There was an error while updating the database to the latest. file: liquibase-update-to-latest.xml. Error: Migration failed for change set liquibase-update-to-latest.xml::2::upul:
Reason:
java.sql.SQLException: Can’t create/write to file ‘C:\WINDOWS\TEMP\#sql_fe4_0.MYI’ (Errcode: 17):
Caused By: Precondition Error
at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:145)
at org.openmrs.web.filter.initialization.InitializationFilter$InitializationCompletion$1.run(InitializationFilter.java:817)
at java.lang.Thread.run(Unknown Source)
Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set liquibase-update-to-latest.xml::2::upul:
Reason:
java.sql.SQLException: Can’t create/write to file ‘C:\WINDOWS\TEMP\#sql_fe4_0.MYI’ (Errcode: 17):
Caused By: Precondition Error
at liquibase.ChangeSet.execute(ChangeSet.java:204)
at liquibase.parser.visitor.UpdateVisitor.visit(UpdateVisitor.java:26)
at org.openmrs.util.DatabaseUpdater$1OpenmrsUpdateVisitor.visit(DatabaseUpdater.java:177)
at liquibase.parser.ChangeLogIterator.run(ChangeLogIterator.java:41)
at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:201)
at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:142)
… 2 more
Caused by: liquibase.exception.PreconditionErrorException: Precondition Error
at liquibase.preconditions.ForeignKeyExistsPrecondition.check(ForeignKeyExistsPrecondition.java:36)
at liquibase.preconditions.NotPrecondition.check(NotPrecondition.java:18)
at liquibase.preconditions.AndPrecondition.check(AndPrecondition.java:21)
at liquibase.ChangeSet.execute(ChangeSet.java:169)
… 7 more

This is in the babble category tagged as , , ,

Add a comment »

Our method for merging branches back to trunk:

  • branch> svn merge from trunk [rev_last_merged_from_trunk]:[HEAD]
  • branch> (resolve conflicts, deploy, test)
  • branch> commit
    (at this point, the branch should be exactly what trunk has plus all changes done in the branch)

  • trunk> svn merge from branch [rev_first_branched_from_trunk]:[HEAD]

For some reason svn still sees a ton of conflicts when doing that last step. In the past I would have to manually go through each file and just copy what was in the branch on top of trunk and then “mark resolved”. However, now there is a faster way: Using at least SVN v1.5 at command line:

svn resolve -R –accept theirs-full *

Thats it! Its a life saver. Or at least a time saver.

(This can be dangerous. Make sure you have resolved all true conflicts in the branch before doing the “resolve all”)

This is in the babble category tagged as

1 comment »

Finally, a solution to the internal microphone not working in Skype on Ubuntu! Ever since upgrading to Jaunty I haven’t been able to use my IBM Thinkpad’s built-in mic for skype calls. Very inconvenient to say the least.

I stumbled across the sound edit controls today:

  1. Left click on the sou
    nd applet in the system tray and click “Volume Control”.

  2. Unmute the “Microphone”

I never knew this existed! Its not in my admin menu anywhere.

(I apologize to Pulse Audio for the many curse words erroneously thrown in its direction over this)

This is in the babble category tagged as , , ,

Add a comment »

« Previous Entries Next Entries »