AnJoiner / FFmpegCommand

FFmpegCommand适用于Android的FFmpeg命令库,实现了对音视频相关的处理,能够快速的处理音视频,大概功能包括:音视频剪切,音视频转码,音视频解码原始数据,音视频编码,视频转图片或gif,视频添加水印,多画面拼接,音频混音,视频亮度和对比度,音频淡入和淡出效果等
https://juejin.cn/user/1046390797512814/posts
Apache License 2.0
811 stars 153 forks source link

我想将其他格式的音频转成spx格式的,但是日志提示我自动选择编码器失败 #21

Open FFFmark opened 4 years ago

FFFmark commented 4 years ago

Automatic encoder selection failed for output stream #0:0. Default encoder for format spx (codec speex) is probably disabled. Please choose an encoder manually.

FFFmark commented 4 years ago

我改转码去手动选择,或者去添加这个编码器,在这个框架下面

AnJoiner commented 4 years ago

我改转码去手动选择,或者去添加这个编码器,在这个框架下面

确认一下,你使用的是哪一个?第一个全部编码都包含

// 全部编解码-体积较大
implementation 'com.coder.command:ffmpeg:${latestVersion}'
// 部分常用编解码-体积较小,比上面引入减少大约6M
implementation 'com.coder.command:ffmpeg-mini:${latestVersion}'
FFFmark commented 4 years ago

implementation 'com.coder.command:ffmpeg:1.1.5' 应用的是这个包,因为他说这个全部编解码,考虑到spx不一定常见,所以我引用了这个

AnJoiner commented 4 years ago

implementation 'com.coder.command:ffmpeg:1.1.5' 应用的是这个包,因为他说这个全部编解码,考虑到spx不一定常见,所以我引用了这个

把你使用的命令发我一下

FFFmark commented 4 years ago

implementation 'com.coder.command:ffmpeg:1.1.5' 应用的是这个包,因为他说这个全部编解码,考虑到spx不一定常见,所以我引用了这个

把你使用的命令发我一下

val src = obtainSoundFile()?.listFiles()?.get(0)?.absolutePath ?: "" val target = obtainSoundFile()?.absolutePath + "/test.spx"

            FFmpegCommand.runAsync(FFmpegUtils.transformAudio(src,target), object : IFFmpegCallBack {

                override fun onComplete() {

                }

                override fun onCancel() {

                }

                override fun onProgress(progress: Int) = Unit

                override fun onError(t: Throwable?) {
                    t?.printStackTrace()
                }

                override fun onStart() {

                }
            })
AnJoiner commented 4 years ago

implementation 'com.coder.command:ffmpeg:1.1.5' 应用的是这个包,因为他说这个全部编解码,考虑到spx不一定常见,所以我引用了这个

把你使用的命令发我一下

val src = obtainSoundFile()?.listFiles()?.get(0)?.absolutePath ?: "" val target = obtainSoundFile()?.absolutePath + "/test.spx"

            FFmpegCommand.runAsync(FFmpegUtils.transformAudio(src,target), object : IFFmpegCallBack {

                override fun onComplete() {

                }

                override fun onCancel() {

                }

                override fun onProgress(progress: Int) = Unit

                override fun onError(t: Throwable?) {
                    t?.printStackTrace()
                }

                override fun onStart() {

                }
            })

刚刚查询了一下ffmpeg编译源码,spx的音频编解码库没有加入,所以无法找到执行自动转这种格式的编解码

FFFmark commented 4 years ago

implementation 'com.coder.command:ffmpeg:1.1.5' 应用的是这个包,因为他说这个全部编解码,考虑到spx不一定常见,所以我引用了这个

把你使用的命令发我一下

val src = obtainSoundFile()?.listFiles()?.get(0)?.absolutePath ?: "" val target = obtainSoundFile()?.absolutePath + "/test.spx"

            FFmpegCommand.runAsync(FFmpegUtils.transformAudio(src,target), object : IFFmpegCallBack {

                override fun onComplete() {

                }

                override fun onCancel() {

                }

                override fun onProgress(progress: Int) = Unit

                override fun onError(t: Throwable?) {
                    t?.printStackTrace()
                }

                override fun onStart() {

                }
            })

刚刚查询了一下ffmpeg编译源码,spx的音频编解码库没有加入,所以无法找到执行自动转这种格式的编解码

😀,那我要怎么弄呢,或者我要往那个方向研究一下呢,刚刚接触转码这个领域

AnJoiner commented 4 years ago

那我要怎么弄呢,或者我要往那个方向研究一下呢,刚刚接触转码这个领域

可以自己编译一个,如果你只是想使用编码为.spx后缀的文件,建议你只需要编译【speex】,可以参考这篇文章《Android Speex编译及使用》

FFFmark commented 4 years ago

@AnJoiner 你好,我想再次问一下这个框架能支持那些音频转码,就是说 能转成什么格式的音频呢?