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

Seek is unnecessarily slow #1

Open
zanbri opened this issue Jul 29, 2016 · 4 comments
Open

Seek is unnecessarily slow #1

zanbri opened this issue Jul 29, 2016 · 4 comments

Comments

@zanbri
Copy link

zanbri commented Jul 29, 2016

The seek method is extremely slow when the parameter passed is large. Following an explanation here: https://trac.ffmpeg.org/wiki/Seeking , the seek parameter is now frame-accurate, even when passed as an input.

Is there a way to pass the -ss argument before the file path? It looks like the code change would have to be on line 238 of tthmpeg.c. I would make the change myself, but my knowledge of c is too rusty :/

@soumith
Copy link
Collaborator

soumith commented Jul 29, 2016

if you replace av_seek with ff_seek or ffm_seek, i think it'll get faster.
See the "Referenced by" functions here:
https://www.ffmpeg.org/doxygen/3.0/avformat_8h.html#ab83ca408a574b40c76f681b616096fc8

@zanbri
Copy link
Author

zanbri commented Jul 29, 2016

The ffm_seek code says that it is 'quite approximative'. Although I didn't find an ff_seek function in the link you provided, a similar function named ff_seek_frame_binary doesn't state whether it is approximative. Do you know if that is a better one to use?

@soumith
Copy link
Collaborator

soumith commented Jul 29, 2016

ffm_seek is what you want. It is fast because it is approximative (and there's no way to get precise and approximate looks like it, unless i am missing something)

@MichaelMathieu
Copy link
Owner

I'll look into that in the coming weeks, if you are familiar with ffmpeg and want to do a pull request, please do :)

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

3 participants