将照片保存在系统默认的DCIM文件夹下:
File testFile = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM), "TestCamera");//在DCIM文件夹里新建一个文件夹TestCamera
testFile.mkdir();
视频基础知识:
- Few Basics : When we say a video file, ex : avi, it is combination of both audio and video
- Video file = Video + Audio
- Video = Codec + Muxer + Demuxer
- codec = encoder + Decoder
- => Video = encoder + decoder + Muxer + Demuxer(Mpeg4 + Mpeg4 + avi +avi - Example for avi container)
- Audio = Codec + Muxer + Demuxer
- codec = encoder + Decoder
- => Audio = encoder + decoder + Muxer + Demuxer(mp2 + mp2 + avi + avi - Example for avi container)
Codec(name is deriverd from a combination of en*co*der/*dec*oder) is just a part of format which defines the algorithms used to encode/decode a frame.
AVI is not a codec, it is a container which uses Video codec of Mpeg4 and Audio codec of mp2.
Muxer/demuxer is used to combine/separate the frames from a file used while encoding/decoding.So if you want to use avi format, you need to enable Video components + Audio components.Ex, for avi, you need to enable the following. mpeg4 Encoder, mpeg4 decoder, mp2 encoder, mp2 decoder, avi muxer, avi demuxer.
MediaCodec:
Codecs operate on three kinds of data: compressed data, raw audio data and raw video data.
目前安卓视频有关的App
美拍:FFMEG
引用:
1.
2.Developer.Android.com:Camera