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

Speed improvements #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

mcconkeyp
Copy link

I use Yamdi in a TV archive application used by Universities (www.bobnational.com) and recently updated to 1.9 to fix a long-file duration tag problem. While doing this I noticed that Yamdi traverses the original FLV several times so I have refactored to reduce this to a single traversal for the tags and another for the data. On 2 GB FLVs it was taking about 90 seconds and now it takes about 30.

In case you are interested, I have committed my changes here. The main changes are:

  • Quite a lot of formatting changes as I used AStyle to reformat to style I'm used to and then again to try and revert back to your style.
  • Replace tag array with a linked list that is created during the first FLV file traversal.
  • Read audio and video flags during the first traversal so that analysis only needs to read a single video data block.
  • Some functions are refactored to remove goto/continue and multiple exit points as this is a style I am used to.

Happy to discuss,

Paul.

Refactor so that original tags are read to a linked list in a single
pass through the FLV. Audio and video flag bytes are also read during
this pass so that analysis does not require another pass. Speed improved
at least 3x on large files.
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

Successfully merging this pull request may close these issues.

1 participant