| | |
| | | int height = config != null ? config.height : DEFAULT_HEIGHT; |
| | | int framerate = config != null ? config.framerate : DEFAULT_FRAME_RATE; |
| | | h264Encoder.setEncoderParams(width, height, framerate, DEFAULT_BITRATE); |
| | | |
| | | |
| | | long timeFile = System.currentTimeMillis(); |
| | | SimpleDateFormat bcdFormat = new SimpleDateFormat("yyMMddHHmmss"); |
| | | String str = bcdFormat.format(timeFile); |
| | | Log.i(TAG,"文件名:"+str); |
| | | // 设置输出文件 |
| | | String fileName = "h264_" + System.currentTimeMillis() + ".h264"; |
| | | String fileName = "h264_" + timeFile+ ".h264"; |
| | | File outputFile = new File(outputFileDirectory, fileName); |
| | | h264Encoder.setOutputFile(outputFile.getAbsolutePath()); |
| | | h264Encoder.setEnableFileOutput(true); // 启用文件输出 |