Javacv: avcodec_open2() error -1: Could not open video codec. due to timebase not set

Created on 30 Apr 2020  路  2Comments  路  Source: bytedeco/javacv

I got this error when start() function is running. Don't know how to fix it. Can anyone please give me some points on this?

Exception in thread "main" org.bytedeco.javacv.FrameRecorder$Exception: avcodec_open2() error -1: Could not open video codec.
at org.bytedeco.javacv.FFmpegFrameRecorder.startUnsafe(FFmpegFrameRecorder.java:726)
at org.bytedeco.javacv.FFmpegFrameRecorder.start(FFmpegFrameRecorder.java:384)
at FindKeyFrames.getIndexByHistogram(FindKeyFrames.java:95)
at FindKeyFrames.(FindKeyFrames.java:47)
at GoFindKeyFrame.main(GoFindKeyFrame.java:11)
[huffyuv @ 00000000219487c0] The encoder timebase is not set.
[huffyuv @ 0000000021947a00] ff_frame_thread_encoder_init failed

question

Most helpful comment

How are you setting the frame rate?

I have found the error because I did not set the framerate correctly. Thanks for replying.

All 2 comments

How are you setting the frame rate?

How are you setting the frame rate?

I have found the error because I did not set the framerate correctly. Thanks for replying.

Was this page helpful?
0 / 5 - 0 ratings