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

frameReaderTime giving wrong timestamps #17

Closed
noughtmare opened this issue Dec 20, 2015 · 4 comments
Closed

frameReaderTime giving wrong timestamps #17

noughtmare opened this issue Dec 20, 2015 · 4 comments

Comments

@noughtmare
Copy link

frameReaderTime is giving the wrong timestamps for some H.264 videos. I think this is the case because it is getting the time_base from the AVCodecContext. The time_base of the AVStream seems to give me the correct values. Is there a way to fix this?

@acowley
Copy link
Owner

acowley commented Dec 20, 2015

Probably! I'm not at a computer right now, but if you can see where to pull it out of the stream, I'd be happy to accept a fix!

@noughtmare
Copy link
Author

I would export the AVStream in the findVideoStream function.
The type of the function findVideoStream would then become:

findVideoStream :: (MonadIO m, MonadError String m) => AVFormat -> m (CInt, AVCodecContext, AVCodec, AVStream)

Then the AVStream can be used instead of the AVCodecContext to find the numerator and denominator of the inverse framerate. like this:

AVRational num den <- liftIO $ getTimeBase vidStream

@acowley
Copy link
Owner

acowley commented Dec 23, 2015

@noughtmare Can you check that the StreamTime branch addresses the issue you encountered?

@noughtmare
Copy link
Author

Yes, that solves the issue.

waldheinz pushed a commit to waldheinz/ffmpeg-light that referenced this issue Mar 10, 2016
Previously, frame time was obtained from the AVCodecContext, but this
was incorrect for some videos.

Fixes acowley#17
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

2 participants