How to overlay text on video from camera (using Mediarecorder)

by 小械褉谐械泄 袦邪褑邪泻 » Fri, 23 Apr 2010 08:02:10 GMT


Sponsored Links
 How to overlay text or any other object(image or draw something)
during recording video from camera using Mediarecorder ?
For example I need to record video with date and time over.
Is it any way to overlay or draw something ?

--



Other Threads

1. Savin a class to SD

Hi, I'm trying to save a serializable class that I've created (Model)
but I don't know what I'm doing wrong because IOEXception is thrown,
can you help me please? here's the code:

                File f = new File("/sdcard/");
                File[] files = f.listFiles();
                String fitx = null;


                if(files!=null){
                    for(int i=0;i<files.length;i++){

                        File fitxer = files[i];
                        fitx =  fitxer.getName();

                        if((ID + ".obj").equalsIgnoreCase(fitx)){
                            entrada = new ObjectInputStream(new
FileInputStream("/sdcard/" + ID + ".obj"));
                            Model regAct = null;
                            Object aux = entrada.readObject();
                            while (aux!=null){
                                if (aux instanceof Model){
                                    regAct = (Model)aux;
                                    regAct.putCoef(coeficients);
                                }

                                ObjectOutputStream sortida = new
ObjectOutputStream(new FileOutputStream("/sdcard/" + ID + ".obj"));
                                sortida.writeObject(regAct);
                                sortida.close();
                                detect=1;
                            }
                        }else{

                            Model mod= new Model (coeficients, ID,
sourceImage);
                            ObjectOutputStream sortida = new
ObjectOutputStream(new FileOutputStream("/sdcard/" + ID + ".obj"));
                            sortida.writeObject(mod);
                            sortida.close();
                            detect=1;
                        }
                    }
                }
            } catch (StreamCorruptedException e) {
                e.printStackTrace();
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            }




And here's the class I've created:



import java.io.Serializable;

import android.graphics.Bitmap;

import java.util.Vector;

public class Model implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID =
-1948073164554864537L;
    private String nom;
    private int ID, n_models, ncoef=100;
    private Vector<double[]> models = new Vector<double[]>();
    private Bitmap foto;

    public Model(double[] x, int n) {
        models.add(x);
        this.ID = n;
        n_models=1;
    }
    public Model() {
        n_models=0;
    }
    public Model(double[] x, int n, Bitmap img) {
        models.add(x);
        this.ID = n;
        n_models=1;
        this.foto=img;
    }
    public Model(double[] x, String n, Bitmap img) {
        models.add(x);
        this.nom = n;
        n_models=1;
        this.foto=img;
    }

    public Bitmap getImg(){
        return foto;
    }
    public double getDist(double[]a){
        double x = 999999999;
        double y = 999999999;
        for (int i=0;i<n_models;i++){
            double[] b = models.get(i);
            x= euclidea(a,b);
            if (x < y){
                y=x;
            }
        }

        return y;
    }

    public String getNom(){
        return nom;
    }

    public int getID(){
        return ID;
    }

    public void putCoef(double[] x){
        models.add(x);
        n_models++;
    }
    public void putImg(Bitmap x){
        foto=x;
    }

    public void putNom(String n){
        this.nom=n;
    }

    public void putID(int x){
        this.ID=x;
    }

    public double manhattan(double [] a, double [] b){
        double dist = 0;
        for(int i=1; i<ncoef; i++){
            dist += Math.abs(a[i]-b[i]);
        }
        return dist;
    }
    public double euclidea(double [] a, double [] b){
        double dist = 0;
        for(int i=1; i<ncoef; i++){
            dist += Math.pow((double)(a[i]-b[i]),2.0);
        }
        return (double)Math.sqrt(dist);
    }

}


Thanks

-- 

2. OpenGL and Live Wallpapers

What is the status of OpenGL and live wallpapers? Are there currently
any good way of using OpenGL to draw the wallpaper? I have seen the
post on Robert Greens website, but it seems that the code had some
issues and hasn't been updated for some time. So I was wondering if
anyone has had any other successes or if there are any other methods
of using OpenGL for live wallpapers out there.

Thanks,
Justin

-- 

3. GPS worknig on emulator but not on atcual phone

4. Alarm interrupt waking up the phone after it is turned off.

5. How to popup menu on touch event.

6. perbedaan HH di charger dalam keadaan mati dan hidu

7. perbedaan HH di charger dalam keadaan mati dan hidu