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

duration #22

Closed
ghost opened this issue Sep 1, 2014 · 5 comments
Closed

duration #22

ghost opened this issue Sep 1, 2014 · 5 comments

Comments

@ghost
Copy link

ghost commented Sep 1, 2014

Hi,

please tell me how I can get video duration?

Regards,
Sergey

@phoboslab
Copy link
Owner

Added calculateFrameCount() and calculateDuration() see the updated README.md.

@ghost
Copy link
Author

ghost commented Sep 12, 2014

thanks :)

@talltyler
Copy link

This method seems to be is missing from the new API.
Maybe it is renamed? Or is there a new way to calculate the duration?

@andyearnshaw
Copy link

andyearnshaw commented Mar 1, 2017

Unfortunately, MPEG-TS doesn't have metadata like duration, so the old method will likely need to be re-implimented. This means you can't really know the duration until the entire file has been downloaded, so you can't really rely on it anyway. I don't want to speak for him, but that might be why @phoboslab left it out in the new version, which is heavily stream-oriented.

If HTTP byte-range requests were used as the transport method, it might be feasible to load chunks from the start and end until the first and last timestamps are discovered, finding the duration much quicker at the expense of slowing down the front-loading. This method wouldn't really work for the websocket solutions though and is somewhat hacky.

@talltyler
Copy link

I'm not looking to slow anything down, but the duration even if wrong at first is needed for many situations. The file will be downloaded at some point and the duration would be correct at this point. If there is old code that can be added back in to make this work again I would love a link.

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