... and watch movies in your cellphone :P
In console, type:
mencoder movie.avi -o movie.mp4 -oac copy -ovc lavc -lavcopts vcodec=mpeg1video -of mpeg
Short post again. I hope it helps somebody.
Thursday, 13 August 2009
How to convert avi to mpeg4 ...
Posted by
Thiago Regal
at
Thursday, August 13, 2009
0
comments
Links to this post
Labels:
english,
it,
movie converter,
mpeg4
Wednesday, 12 August 2009
How to convert rmvb to avi
It was tested in Ubuntu, but should work in any Linux distribution, considering you have installed all dependencies.
In a console, type:
mencoder -oac mp3lame -lameopts cbr:br=64:vol=2 -srate 22050 -ovc xvid -sws 1 -xvidencopts bitrate=500:max_key_interval=120:vhq=4 -ofps 30 -vf scale=640:360 movie.rmvb -o movie.avi
Short post...that's it.
In a console, type:
mencoder -oac mp3lame -lameopts cbr:br=64:vol=2 -srate 22050 -ovc xvid -sws 1 -xvidencopts bitrate=500:max_key_interval=120:vhq=4 -ofps 30 -vf scale=640:360 movie.rmvb -o movie.avi
Short post...that's it.
Posted by
Thiago Regal
at
Wednesday, August 12, 2009
0
comments
Links to this post
Labels:
avi,
linux,
movie converter,
rmvb,
tips
Monday, 10 August 2009
OSGi development
I already knew the basic concepts of OSGi, but I've started working with it and realized how powerful it is. OSGi is a
It means you can build really modular application, manage components lifecycle, versioning and compatibility in a powerful and standadized way. This is a very, very, really short introduction on OSGi bundles (or modules) development.
Bundles are the main component of a OSGi application and they are just standard jar files. The only difference is some tags inside regular MANIFEST.MF file.
Bundles have a defined lifecycle as follows:
I am not going to dive into details here, since this is not a short subject but, instead, I will recomend a very good blog which offers detailed information about OSGi. It is Neil Bartlett's blog.
OSGi frameworks web-pages are a very important source of information, too. I recommend you to take a look at, at least, these three implementations (all of them are very good and open-source): KnopplerFish, Felix (Apache), and Equinox (Eclipse).
See you.
The OSGi framework is a module system for Java that implements a complete and dynamic component model (..). Applications or components (coming in the form of bundles for deployment) can be remotely installed, started, stopped, updated and uninstalled without requiring a reboot (..). See.
It means you can build really modular application, manage components lifecycle, versioning and compatibility in a powerful and standadized way. This is a very, very, really short introduction on OSGi bundles (or modules) development.
Bundles are the main component of a OSGi application and they are just standard jar files. The only difference is some tags inside regular MANIFEST.MF file.
Bundles have a defined lifecycle as follows:
- Installed: bundle was succesfully installed
- Resolved: all dependencies are available and the bundle is ready to be started or stopped
- Starting: the bundle is being started. BundleActivator method is called
- Active: the bundle is running
- Stopping: the bundle is being stopped. BundleActivator method is called
- Uninstalled: the bundle was uninstalled and is currently unavailable
The BundleContext object is the way you have to interact with the OSGi framework. It offers way methods to use framework resources, call services, and so on. After that, you'll generally use a ServiceTracker (provided through BundleContext) to access a service provided by other bundle, OR you can register a service from your bundle to provide to other bundles (through BundleContext again).
1 package net.bistrojava;
2
3 import org.osgi.framework.BundleActivator;
4 import org.osgi.framework.BundleContext;
5
6 public class BJOsgiActivator implements BundleActivator {
7
8 private BundleContext context;
9
10 public void start(BundleContext context) throws Exception {
11 System.out.println("Hello World - starting bundle");
12 this.context = context;
13 }
14
15 public void stop(BundleContext context) throws Exception {
16 System.out.println("Goodbye World - stopping bundle");
17 this.context = null;
18 }
19 }
20
I am not going to dive into details here, since this is not a short subject but, instead, I will recomend a very good blog which offers detailed information about OSGi. It is Neil Bartlett's blog.
OSGi frameworks web-pages are a very important source of information, too. I recommend you to take a look at, at least, these three implementations (all of them are very good and open-source): KnopplerFish, Felix (Apache), and Equinox (Eclipse).
See you.
Posted by
Thiago Regal
at
Monday, August 10, 2009
0
comments
Links to this post
Labels:
english,
it,
java platform,
open source,
osgi
Saturday, 20 December 2008
Interactive Digital TV Applications
During last few months I've been playing around interactive applications for digital TV. I think this is a bit unexplored area and there are lots of possibilities to explore. I intend to post about it more often but, for now, I will give you a first taste.
JavaTV is an API to build interactive applications for Digital TV. It is relatively well documented and, well, it is Java, so it is part of a well known and reliable platform. A software for Digital TV runs on a set top box, which is a hardware with a smaller set of resources than regular desktops, but still powerful. A TV application is a kind of JavaME application, and is called, and is called Xlet. It is, in a very simplistic view, an interface you have to implement to have a JavaTV application.
You can use any IDE you like to develop JavaTV applications, but I don't know anyone which has real support for that (like JavaME support, or web development support). This is not a problem, since you will see it is very simple to work with this API. You will need to download Xletview, that is a tool that emulates a TV. You can include xletview.jar in you application, so you will be able to use some of libraries it comes with.
I am going to show you a very simple xlet that comes from InteractiveTvWeb. I liked it because it is very didactic. As you will see, it does actually....nothing. But it does compile and it shows you how any xlet should looks like. Don't be disappointed, because I will post more sophisticated xlets in the next posts. For now, just believe me this is a nice and powerful API and you will have fun with it.
P.S.: If you wanna more fun now, I sugest you to make this code implement a KeyListener, write a System.out.println() to show you something about the key you pressed, compile it, put it into a jar and open it in Xletview. It works just like any Java application.
JavaTV is an API to build interactive applications for Digital TV. It is relatively well documented and, well, it is Java, so it is part of a well known and reliable platform. A software for Digital TV runs on a set top box, which is a hardware with a smaller set of resources than regular desktops, but still powerful. A TV application is a kind of JavaME application, and is called, and is called Xlet. It is, in a very simplistic view, an interface you have to implement to have a JavaTV application.
You can use any IDE you like to develop JavaTV applications, but I don't know anyone which has real support for that (like JavaME support, or web development support). This is not a problem, since you will see it is very simple to work with this API. You will need to download Xletview, that is a tool that emulates a TV. You can include xletview.jar in you application, so you will be able to use some of libraries it comes with.
I am going to show you a very simple xlet that comes from InteractiveTvWeb. I liked it because it is very didactic. As you will see, it does actually....nothing. But it does compile and it shows you how any xlet should looks like. Don't be disappointed, because I will post more sophisticated xlets in the next posts. For now, just believe me this is a nice and powerful API and you will have fun with it.
P.S.: If you wanna more fun now, I sugest you to make this code implement a KeyListener, write a System.out.println() to show you something about the key you pressed, compile it, put it into a jar and open it in Xletview. It works just like any Java application.
package javatv;
/**
* The simplest Xlet that you will ever write. This Xlet
* does absolutely nothing, not even print a message.
* However, it is a complete skeleton Xlet that will
* compile, even if it does nothing useful once it's been
* compiled.
*
* This Xlet implements the Javax.tv.xlet.Xlet interface,
* in order to be the main class for an Xlet. All methods
* are inherited from javax.tv.xlet.Xlet
*/
public class MyFirstExampleXlet
implements javax.tv.xlet.Xlet {
/**
* Every Xlet should have a default constructor that
* takes no arguments. No other constructor will get
* called.
*/
public MyFirstExampleXlet() {
// The constructor should contain nothing. Any
// initialisation should be done in the initXlet()
// method, or in the startXlet method if it's time-
// or resource-intensive. That way, the MHP
// middleware can control when the initialisation
// happens in a much more predictable way
}
/**
* Initialise the Xlet. The context for this Xlet
* will get passed in to this method, and a reference
* to it should be stored in case it's needed later.
*
* This is the place where any initialisation should
* be done, unless it takes a lot of time or resources.
* If something goes wrong, then an
* XletStateChangeException should get thrown to let
* the runtime system know that the Xlet can't be
* initialised.
*/
public void initXlet(javax.tv.xlet.XletContext context)
throws javax.tv.xlet.XletStateChangeException {
// Do nothing for now
}
/**
* Start the Xlet. At this point the Xlet can display
* itself on the screen and start interacting with the
* user, or do any resource-intensive tasks. These
* kinds of function should be kept in startXlet(),
* and should *not* be done in initXlet().
*
* As with initXlet(), if there is any problem this
* method should throw an XletStateChangeException to
* tell the runtime system that it can't start.
*
* One of the common pitfalls is that the startXlet()
* method must return to its caller. This means that
* the main functions of the Xlet should be done in
* another thread. The startXlet() method should
* really just create that thread and start it, then
* return.
*/
public void startXlet()
throws javax.tv.xlet.XletStateChangeException {
// Do nothing for now
}
/**
* Pause the Xlet. Unfortunately, it's not clear to
* anyone (including the folks who wrote the MHP
* specification) what this means. Generally, it means
* that the Xlet should free any scarce resources that
* it's using, stop any unnecessary threads, and remove
* itself from the screen.
*
* Unlike the other methods, pauseXlet() can't throw an
* exception to indicate a problem with changing state.
* When the Xlet is told to pause itself, it must do so.
*/
public void pauseXlet() {
// Do nothing for now
}
/**
* Stop the Xlet. The boolean parameter tells the method
* whether the Xlet has to obey this request. If the
* value of the parameter is true, the Xlet must
* terminate and the runtime system will assume that
* when the method returns, the Xlet has terminated. If
* the value of the parameter is false, the Xlet can
* request that it not be killed, by throwing an
* XletStateChangeException. If the MHP middleware
* still wants to kill the Xlet, it should call
* destroyXlet() again with the parameter set to true.
*/
public void destroyXlet(boolean unconditional)
throws javax.tv.xlet.XletStateChangeException {
// Do nothing for now
}
}
Posted by
Thiago Regal
at
Saturday, December 20, 2008
2
comments
Links to this post
Labels:
digital tv,
english,
interactive application,
java platform,
javatv,
xlet
Thursday, 13 November 2008
Free software development with Java
This is another presentation, about free software development using Java. These slides were used during a free software event sponsored by TchêLinux.
Download it here (in portuguese).
Cheers
Download it here (in portuguese).
Cheers
Posted by
Thiago Regal
at
Thursday, November 13, 2008
0
comments
Links to this post
Labels:
course,
english,
java platform,
open source
Wednesday, 22 October 2008
Java Introduction Course - slides - part 3
Posted by
Thiago Regal
at
Wednesday, October 22, 2008
0
comments
Links to this post
Labels:
course,
english,
it,
java platform,
pdf,
training
Tuesday, 21 October 2008
Java Introduction Course - slides - part2
JavaSE, JavaME brief overview, my first web application, Netbeans overview.
Download slides here.
Download slides here.
Subscribe to:
Posts (Atom)