Skip to content

Cannot encode frames #154

@detsikas

Description

@detsikas

Hi,

thank you for making this great framework available.
I have been using the demuxer easily without any issues, but recently I had trouble using the muxer.
I basically copy the reasoning of the RecordAndEncodeVideo demo.
My flow is complicated but when it comes to muxing frames the "screen" BufferedImage in the code below is fine (I store it in a file and view it to verify it).
In addition to that the picture.isComplete() is true.
However the packet is never complete. Size and position are always 0 and -1 and the muxer write call is never executed. If I force execution I get an exception for writing an incomplete packet.

        if (converter == null)
            converter = MediaPictureConverterFactory.createConverter(screen, picture);
        converter.toPicture(picture, screen, i);

        do {
            encoder.encode(packet, picture);
            if (packet.isComplete())
                muxer.write(packet, false);
        } while (packet.isComplete());

I am not sure how to tackle this. I would most grateful if you could lend a hand.

It is also not clear to me the reasoning of the do-while loop.

Best regards,
Nikos

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions