Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot encode frames #154

Open
detsikas opened this issue Aug 17, 2023 · 0 comments
Open

Cannot encode frames #154

detsikas opened this issue Aug 17, 2023 · 0 comments

Comments

@detsikas
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant