bytedeco/javacv

OutputStream seeking, video length (duration) determination problems

Open

#839 opened on Nov 23, 2017

View on GitHub
 (7 comments) (0 reactions) (0 assignees)Java (1,583 forks)batch import
help wantedquestion

Repository metrics

Stars
 (6,985 stars)
PR merge metrics
 (No merged PRs in 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?

Contributor guide