如何将音频文件与新视频文件合并?是否可以在Android中使用?
16lz
2021-01-22
i successfully got video from sequence of images using javacv in android.now i have problem that is how to merge audio to that newly created video.is it possible in android or javacv integration?
我成功地在android.now中使用javacv从图像序列获取视频我有问题是如何将音频合并到新创建的视频。它可能在android或javacv集成?
Here is my code,
String path ="/mnt/sdcard/Video_images";
File folder = new File(path);
File[] listOfFiles = folder.listFiles();
if(listOfFiles.length>0)
{
iplimage = new opencv_core.IplImage[listOfFiles.length];
for (int j = 0; j < listOfFiles.length; j++) {
String files="";
if (listOfFiles[j].isFile())
{
files = listOfFiles[j].getName();
System.out.println(" j " +j + listOfFiles[j]);
}
String[] tokens = files.split("\\.(?=[^\\.]+$)");
String name=tokens[0];
Toast.makeText(getBaseContext(), "size"+listOfFiles.length, Toast.LENGTH_SHORT).show();
iplimage[j]=cvLoadImage("/mnt/sdcard/Video_images/"+name+".jpg");
}
}
//
FFmpegFrameRecorder recorder = new
FFmpegFrameRecorder("/mnt/sdcard/Video_images
/output"+System.currentTimeMillis()+".mp4",200,150);
try {
recorder.setVideoCodec(a); //CODEC_ID_MPEG4 //CODEC_ID_MPEG1VIDEO
recorder.setFrameRate(24);
recorder.setPixelFormat(PIX_FMT_YUV420P); //PIX_FMT_YUV420P
recorder.start();
for (int i=0;i<iplimage.length;i++)
{
recorder.record(iplimage[i]);
}
recorder.stop();
}
catch (Exception e){
e.printStackTrace();
}
in this code,how to merge my audio file?
在这段代码中,如何合并我的音频文件?
2 个解决方案
#1
0
There is nothing in Android for merging video files. You will need to find some Java JAR that can handle this for you, if you need to do it on the device.
Android中没有用于合并视频文件的内容。如果需要在设备上执行此操作,则需要找到一些可以为您处理此问题的Java JAR。
更多相关文章
- android获取本地视频路径
- 获取Android设备的唯一序列号
- GUVCview-Ubuntu下视频录像更简单
- Mars《Android开发视频教程》全集下载(第一季到第五季)
- android 获取正在运行的应用程序列表
- opencv实时视频帧在android中没有显示sobel输出
- ffmpeg从视频中提取帧时间戳
- Androidx学习笔记(79)--- 视频播放器二(VideoView等)
- 从Wordpress API JSON响应反序列化嵌套的JSON标记和附件