bytedeco/javacv
View on GitHubGetTimestamp always return 0 when I set video codec name to h264_cuvid
Open
#1,035 opened on Jul 18, 2018
bughelp wanted
Repository metrics
- Stars
- (6,985 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
I'm using JavaCV 1.4.2
I want to decode video with HWAcceleration. However, I notice that getTimestamp always return 0 when I set video codec name to h264_cuvid.
public static void main(String[] args) {
try {
FFmpegFrameGrabber grabber = new FFmpegFrameGrabber("input.mp4");
grabber.setVideoCodecName("h264_cuvid");
grabber.start();
while (grabber.grabImage() != null) {
System.out.println(grabber.getTimestamp());
}
grabber.stop();
} catch (Exception ex) {
ex.printStackTrace();
}
}
This program print only zero. But frame decoding works fine. When I set video codec something, for example h264 or h264_qsv , you can see increasing timestamp.
On debugging, I found pts value is always -9223372036854775808. I don't know FFmpeg's api, but it looks like bug on FFmpeg. Is this possible to fix in JavaCV?. Thank you.