This is how Android supports video formats:
Android can decode JPG files.
Video encoding and decoding in H.263 format,
Only videos in h264 format can be decoded.
Is the life cycle of the mediarecorder class
A common case of using mediarecorder to record audio works as follows:
Mediarecorder recorder = new mediarecorder (); <br/> recorder. setaudiosource (mediarecorder. audiosource. MIC); <br/> recorder. setoutputformat (mediarecorder. outputformat. three_gpp); <br/> recorder. setaudioencoder (mediarecorder. audioencoder. amr_nb); <br/> recorder. setoutputfile (path_name); <br/> recorder. prepare (); <br/> recorder. start (); // recording is now started <br/>... <br/> recorder. stop (); <br/> recorder. reset (); // You can reuse the object by going back to setaudiosource () Step <br/> recorder. release (); // now the object cannot be reused
We suspect that the H.263 video format generated by Android is special.
When the data is saved to the server (PC), the generated 3GP file cannot be opened.
You can save the recorded video on your mobile phone but play it normally.
Although the mediarecorder class is very convenient to use, it has a single method and few interfaces, mainlyCodeAll are the underlying encapsulation. Poor scalability.
It is a headache.