bytedeco/javacv

OutputStream seeking, video length (duration) determination problems

Open

#839 aberto em 23 de nov. de 2017

Ver no GitHub
 (7 comments) (0 reactions) (0 assignees)Java (1.583 forks)batch import
help wantedquestion

Métricas do repositório

Stars
 (6.985 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

When using

mFrameRecorder.setFormat("matroska");

and File

    public FFmpegFrameRecorder(File file, int imageWidth, int imageHeight) {
        this((File)file, imageWidth, imageHeight, 0);
    }

recording works ok.

When using OutputStream

    public FFmpegFrameRecorder(OutputStream outputStream, int imageWidth, int imageHeight) {
        this(outputStream.toString(), imageWidth, imageHeight);
        this.outputStream = outputStream;
    }

 DocumentFile newFile = mDocumentFileDir.createFile("video/mkv", "test.mkv");
        try {
            pfd = mContext.getContentResolver().openFileDescriptor(newFile.getUri(), "rw");
            mOutputStream = new FileOutputStream(pfd.getFileDescriptor());
            mFrameRecorder = new FFmpegFrameRecorder(mOutputStream, videoWidth, videoHeight);

            //I close `mOutputStream/pfd` after stopping ffmpeg recording

recording also works ok, I can watch recorded video using android MX Player, but it cannot determine the length of the video and because MX Player doesn't know the length, I can't seek though the video

33134840-705864c0-cfa9-11e7-9b12-75f2f6b49103

Is this a known issue?

Guia do colaborador