Wednesday, August 03, 2011

Most tud MPEG_4_SP video encodolast a MediaRecorder vagy nem???

Itt azt jelzik, hogy nem. Be is masolom a tablazotat, nehogy utolag mas legyen:

The table below describes the media format support built into the Android platform. Note that any given mobile device may provide support for additional formats or file types not listed in the table.

Note: Media codecs that are not guaranteed to be available on all Android platform versions are accordingly noted in parentheses—for example "(Android 3.0+)".

Table 1. Core media format and codec support.

TypeFormat / CodecEncoderDecoderDetailsSupported File Type(s) / Container Formats
AudioAAC LC/LTPMono/Stereo content in any combination of standard bit rates up to 160 kbps and sampling rates from 8 to 48kHz3GPP (.3gp), and MPEG-4 (.mp4, .m4a). ADTS raw AAC (.aac, decode only, ADIF not supported, Android 3.1+).
HE-AACv1 (AAC+)
HE-AACv2 (enhanced AAC+)
AMR-NB4.75 to 12.2 kbps sampled @ 8kHz3GPP (.3gp)
AMR-WB9 rates from 6.60 kbit/s to 23.85 kbit/s sampled @ 16kHz3GPP (.3gp)
FLAC
(Android 3.1+)
Mono/Stereo (no multichannel). Sample rates up to 48 kHz (but up to 44.1 kHz is recommended on devices with 44.1 kHz output, as the 48 to 44.1 kHz downsampler does not include a low-pass filter). 16-bit recommended; no dither applied for 24-bit.FLAC (.flac) only
MP3 Mono/Stereo 8-320Kbps constant (CBR) or variable bit-rate (VBR)MP3 (.mp3)
MIDI MIDI Type 0 and 1. DLS Version 1 and 2. XMF and Mobile XMF. Support for ringtone formats RTTTL/RTX, OTA, and iMelodyType 0 and 1 (.mid, .xmf, .mxmf). Also RTTTL/RTX (.rtttl, .rtx), OTA (.ota), and iMelody (.imy)
Ogg Vorbis Ogg (.ogg)
PCM/WAVE 8- and 16-bit linear PCM (rates up to limit of hardware)WAVE (.wav)
ImageJPEGBase+progressiveJPEG (.jpg)
GIF GIF (.gif)
PNG PNG (.png)
BMP BMP (.bmp)
VideoH.263 3GPP (.3gp) and MPEG-4 (.mp4)
H.264 AVC
(Android 3.0+)
Baseline Profile (BP)3GPP (.3gp) and MPEG-4 (.mp4). MPEG-TS (.ts, AAC audio only, not seekable, Android 3.0+)
MPEG-4 SP 3GPP (.3gp)
VP8
(Android 2.3.3+)
WebM (.webm)


Ugyanakkor a MediaRecorder.VideoEncoder dokumentaciojaban azt irjak, hogy API Level 3 ota tudja. Ezt is idemasolom:

public static final int DEFAULT

Constant Value: 0 (0x00000000)

public static final int H263

Constant Value: 1 (0x00000001)

public static final int H264

Constant Value: 2 (0x00000002)

public static final int MPEG_4_SP

Constant Value: 3 (0x00000003)

A tapasztalatom pedig az volt, hogy 2.2.1-es Firmware-nel ha ezt allitottam be akkor siman mukodott (valoszinuleg fallback-elt h.263-ra), de 2.3.3-as Firmwaren probalva IOException-t dobott a MediaRecorder.prepare(). A 2.2.1-es egy Samsung Galaxy S GT-I9003-ason volt, a 2.3.3-as pedig egy GT-I9000-esen.