Skip to content

Error creating thumbnail of video via ffmpeg #1646

Answered by fleixi
fleixi asked this question in Q&A
Discussion options

You must be logged in to vote

I found the problem with 1.5.5.

The Java2DFrameConverter doesnt like it if i stop the FFmpegFrameGrabber bevor converting the frame to an BufferedImage.

This code is working:

        FFmpegFrameGrabber g = new FFmpegFrameGrabber(path);
        //g.setFormat("mp4");
        g.start();
        g.setFrameNumber(90);
        Frame frame = g.grabImage();
        //g.stop();
        //g.close();
        Java2DFrameConverter converter = new Java2DFrameConverter();
        BufferedImage img =  converter.convert(frame);
        g.stop();
        g.close();
        return img;

Replies: 4 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@fleixi
Comment options

Comment options

You must be logged in to vote
2 replies
@fleixi
Comment options

@saudet
Comment options

Comment options

You must be logged in to vote
1 reply
@saudet
Comment options

Comment options

You must be logged in to vote
1 reply
@saudet
Comment options

Answer selected by saudet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants