Problems recording video while using h264 encoder

All your problems with Audio, Video and Images.

Problems recording video while using h264 encoder

Postby darkbercislaw » Wed Oct 20, 2010 12:32 pm

Hi, I'm quite new to android,
I wrote a simple application that records video. When I was using h.263 encoder everything worked just fine.
Here is part of the code:
Code: Select all
    MediaRecorder recorder = new MediaRecorder();
    recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
    recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
    recorder.setOutputFile(path);
    recorder.setVideoFrameRate(15);
    recorder.setVideoSize(176,144);
    recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263);
    recorder.setPreviewDisplay(holder.getSurface());
    recorder.prepare();
    recorder.start();


When I wanted to use h.264 encoder by just changing H263 with H264 ->
Code: Select all
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
it didn't wanted to work. It just creates empty file, but puts no data into it.
Can anyone help me? What can be wrong?
I'm using Android 2.1 on HTC Legend.

EDIT: I think that I finally know what was the problem. HTC Legend simply doesn't have H.264 encoder. As written here: http://developer.android.com/guide/appe ... rmats.html Android platform doesn't provide this encoder. It can be used only if it was provided by the manufacturer of device. What I know is that this encoder can be found in HTC EVO or Motorola Milestone. Does anyone know other devices that do have it?
darkbercislaw
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Oct 20, 2010 12:15 pm

Top

Re: Problems recording video while using h264 encoder

Postby suriya.prakash » Sun Dec 12, 2010 6:53 am

Android doesn't provide h264 encoder.

http://developer.android.com/guide/appe ... rmats.html
suriya.prakash
Once Poster
Once Poster
 
Posts: 1
Joined: Sun Dec 12, 2010 6:52 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Google [Bot] and 16 guests