feat: SG-44605: Optimize the loading and scrubbing of S3/Streaming media in RV - #1380
feat: SG-44605: Optimize the loading and scrubbing of S3/Streaming media in RV#1380deltag0 wants to merge 43 commits into
Conversation
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
| } | ||
| } | ||
|
|
||
| void StreamerPool::workerFunc(Job job) |
There was a problem hiding this comment.
Why is job passed as a copy here? I believe it should be a const reference instead like you did for download and downloadWindow
There was a problem hiding this comment.
We pass job from the schedulerLoop which is local to the function
There was a problem hiding this comment.
The object in the queue is destroyed when we pop it
|
I appreciate that you are trying to clean up some of the dead code in the IPCore directory, but I feel like it is unrelated to the purpose of this PR, since the removals are made on files that you are not touching otherwise. You could create a second PR for that cleanup if you want, and remove it from this one, to help us review only what is actually important for the feature to work. Same thing for |
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
| #include <TwkUtil/File.h> | ||
| #include <TwkUtil/sgcHop.h> | ||
| #include <stream/StreamPreloadPool.h> | ||
| #include <boost/thread/lock_algorithms.hpp> |
There was a problem hiding this comment.
Is this still being used in this file? If not, you should remove it. Also, you should put back <boost/thread/mutex.hpp> with the other boost header files where it was before
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
feat: Optimize the loading and scrubbing of S3/Streaming media in RV
Summarize your change.
shared:protocolDescribe the reason for the change.
Previously, when media hosted on shotgrid was opened in OpenRV, to view a new file, there had to be a request made over the network, which was adding 1-2 seconds of latency every time a user jumped to a new file. This made scrubbing virtually impossible because of the delay. To improve this problem, the idea was to cache the media's raw bytes locally, so that RV can decode the bytes locally instead of having to establish a new HTTP connection for a new file. This would work, but would require us to manually jump to the new file for the caching to start. So, background threads to download every file were spawned.
After testing, on my machine, I found that 4 threads for background fetching provided the best performance.
Soon after, it was found that even if all media was cached before a user streams it on RV, scrubbing would still be painful because there were FFMPEG reader clones which had to establish their own connection, so they still added latency. To fix this, the connections were established at load time, with background threads, when the media is opened (after pre-loading).
The lookahead thread helps with scrubbing when not everything is cached, however it currently still reads ahead if all the media is cached. When testing without it, scrubbing was still laggy for the first half minute until the background threads finished caching everything, but with it enabled, scrubbing worked almost immediately.
Describe what you have tested and on which operating system.
Add a list of changes, and note any that might need special attention during the review.
Notes:
Currently no limit to the size of the raw media cache
Background threads will still run even if all media is cached (although they will just read from disk)
Verified that warming reader clones was still necessary after background threads and lookahead thread, the performance degrades without it
manual latency test:
If possible, provide screenshots.