FFmpegFrameRecorder
来源:互联网 发布:自学广告设计软件 编辑:程序博客网 时间:2024/06/08 05:30
file=new File(sdcard+"ok.mp4"); if (!file.exists()){ try { file.createNewFile(); }catch (IOException e){ } } try{ // File file1=new File(sdcard+"1.mp4"); // file1.createNewFile(); // recorder= new FFmpegFrameRecorder( // sdcard+"ok.mp4", 1080, // 720); recorder=new FFmpegFrameRecorder(file,2100,2100,0); // File file11=new File(sdcard+"11.mp4"); // file11.createNewFile(); // testBitmap.recycle(); } catch (Exception e){ // Toast.makeText(getApplicationContext(), "recorder", Toast.LENGTH_LONG).show(); } recorder.setFormat("mp4"); recorder.setFrameRate(20);// 褰曞儚甯х巼 recorder.setPixelFormat(avutil.AV_PIX_FMT_YUV420P); // recorder.setSampleRate(20);//recorder.setVideoCodec(avcodec.AV_CODEC_ID_H264); // recorder.setVideoQuality(0);// recorder.setVideoOption("preset", "veryfast"); try{ // File file2=new File(sdcard+"12.mp4"); // file2.createNewFile(); recorder.start(); }catch (Exception e){ // Toast.makeText(getApplicationContext(), "start", Toast.LENGTH_LONG).show(); } for (int index=0;index < 5;index++) { try{ // recorder. image = cvLoadImage(arrayList.get(index)); testBitmap = VideoCapture.getImageByPath(arrayList.get(index)); image.alphaChannel(100); for (int i=0;i<50;i++){ recorder.setImageWidth(100*(index+1)); recorder.setImageHeight(100*(index+1)); // recorder recorder.record(image); } image.release(); }catch (Exception e){ // Toast.makeText(getApplicationContext(), "record", Toast.LENGTH_LONG).show(); }testBitmap.recycle(); index++; } try{ recorder.stop(); } catch (Exception e){ // Toast.makeText(getApplicationContext(), "stop", Toast.LENGTH_LONG).show(); }}
阅读全文
0 0
- FFmpegFrameRecorder
- FFmpegFrameRecorder保存视频or rtmp发布
- PPTP+L2TP+SSTP+OPENVPN绝对穿透的动态IP 拨号
- Android,安卓,toolbar,menu显示位置
- HDU 6136 Death Podracing(优先队列+循环链表)
- hdu6134 Battlestation Operational【2017多校第八场】
- java数据结构与算法-堆
- FFmpegFrameRecorder
- 编写一个程序,打印输入中各个字符出现频度的直方图
- html 布局小技巧
- 816
- ADF中解析 EL 表达式
- 大文件分块上传第三弹(分块并发上传)
- STM32延时注意事项
- ListView与ScrollView冲突解决三种方法
- DROOL 5分钟上手Case