[英]Using MediaCodec to compress video
I'm trying to use MediaCodec
in Android to compress videos. 我正在尝试在Android中使用
MediaCodec
压缩视频。
It looks like MediaCodec
will give you back the raw stream. 看起来
MediaCodec
会给您返回原始流。 Is there a way to go from A->B (compress video with an output file at the end)? 有没有办法从A-> B(使用最后的输出文件压缩视频)?
Thanks. 谢谢。
You can employ the MediaMuxer
class to store the elementary streams into a file format like MP4
. 您可以使用
MediaMuxer
类将基本流存储为MP4
类的文件格式。 Please refer to this cts
example for a good illustration of transcode + muxing where the encoded data is written into a file through the MediaMuxer
. 请参阅此
cts
示例 ,以获取转码+混合的良好示例,其中通过MediaMuxer
将编码后的数据写入文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.