小编use*_*841的帖子

使用Jcodec在Android上创建mp4文件

我在使用MediaRecorder和Jcodec在Android上编写mp4文件时遇到了一些麻烦,这是我的代码

public class SequenceEncoder {
    private final static String CLASSTAG = SequenceEncoder.class.getSimpleName();

    private SeekableByteChannel ch;

    private byte[] yuv = null;

    private ArrayList<ByteBuffer> spsList;
    private ArrayList<ByteBuffer> ppsList;

    private CompressedTrack outTrack;

    private int frameNo;
    private MP4Muxer muxer;

    ArrayList<ByteBuffer> spsListTmp = new ArrayList<ByteBuffer>();
    ArrayList<ByteBuffer> ppsListTmp = new ArrayList<ByteBuffer>();

    // Encoder
    private MediaCodec mediaCodec = null;

    public SequenceEncoder(File out) throws IOException {
        this.ch = NIOUtils.writableFileChannel(out);

        // Muxer that will store the encoded frames
        muxer = new MP4Muxer(ch, Brand.MP4);

        // Add video track to muxer …
Run Code Online (Sandbox Code Playgroud)

mp4 android h.264 muxer jcodec

7
推荐指数
1
解决办法
8023
查看次数

标签 统计

android ×1

h.264 ×1

jcodec ×1

mp4 ×1

muxer ×1