0
点赞
收藏
分享

微信扫一扫

音视频转码合成


1、android上录音AAC/MP3格式,未成功
​​​https://github.com/turkeyzhu/AACEncoder_Android ​​​2、通过mp4parser将AAC、h264、mp4格式合成MP4
https://code.google.com/p/mp4parser/(mp4parser源码)
https://github.com/sannies/mp4parser(使用mp4parser合成、转码MP4例子,该代码添加了其他东西,需要添加很多依赖库(主要是aspectjrt.jar),可以删减。
该isoviewer-1.0-RC-35.jar包将mp4parser和aspectjrt.jar合并在一起,很好用。

xxxxxxxxxx

 

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30


3、通过FFMPEG PCM、WAV转mp4。看代码是通过ffmpeg命令转码,ffmpeg支持转码,应该都可以实现,可先用命令试试资源。

File source = new File("D:/audio.wav");  
File target = new File("D:/result.mp4");
AudioAttributes audio = new AudioAttributes();
audio.setCodec(null);
EncodingAttributes attrs = new EncodingAttributes();
attrs.setFormat("mp4");
attrs.setAudioAttributes(audio);
Encoder encoder = new Encoder();
try {
encoder.encode(source, target, attrs);
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (InputFormatException e) {
e.printStackTrace();
} catch (EncoderException e) {
e.printStackTrace();
}

WAV转AAC命令==ffmpeg -i aec_out.wav -strict -2 -b:a 32k -y abc.aac(代码实现可以参考ffmpeg支持windows和linux库源码)

4、录音MP3格式

通过lame实现,没有库源码,有android源码

举报

相关推荐

0 条评论