-
Notifications
You must be signed in to change notification settings - Fork 3
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
Investigate Data compression #15
Comments
when this video exports / https://d21m91m763fb64.cloudfront.net/videos/8acab1c0-7cb0-11eb-821a-9b4798e5df00-8secondz-video.mp4 the video gets incorrectly resized. It would be nice to be able to bypass the compression to disk. UPDATE - this fixed things for me for now. |
Hi @johndpope |
was happening on the iphone12pro - maybe reproducible on simulator - it was like the video stretched to a 1/4 of the size. top - left quarter. I like this repo - and it was my approach to do prefetching here - TikTok seem to get 6 videos eagerly upon app start - I'm still unsure best way to do this. |
Hmm, here's what I tried to reproduce it:
I'm not aware of the dimensions of the original video file, is this the incorrect dimension? Also regarding TikTok and a few other social media apps, I'm still trying to see how they do that. One approach could be to kick off the prefetching of the videos during the AppDelegate willFinish or didFinish phase. |
I think the results would be comparable to |
If you hit the URL you’ll see it’s a 9:16 format uPDATE this crude approach works I want to use your code to simply pick up / merge from existing download. It seems you are the only one on GitHub who has achieved this. Will take another look at it when I have more bandwidth https://gist.github.com/johndpope/8d4ecbdeb1ecb3188b55afc5282d544e |
Ah yes, I see its in the 9:16 format. I'll spend some time to correct this. |
Hi Chrishon - |
Hi John Sure, I can do that. An option for bypassing the resizing will be provided. |
Hi @johndpope I have released a new version
As for the video you provided that had an aspect ratio of 9:16, I implemented some changes to the example to address this concern. Please take a look at the CHANGELOG for a little more detail, and let me know if you have any issues. |
great - I will test this out. thanks! |
UPDATE |
Hmm, there's have quite a few observers going on. |
Yes. I had to adjust my kvo approach to use this.
I have some proprietary code base but I want to send you a snippet. I have
introduced a state engine from gamekit to shift through the fetching /
playable states.
I also have prototyped using digger library but it is not as good as your
approach as it kind of blocks user from viewing video until it has fully
downloaded. Spent a few weeks on it but still not there. The good thing
with digger is it provides some granular control over stopping and starting
the workers / downloads.
JP
…On Saturday, May 1, 2021, Chrishon Wyllie ***@***.***> wrote:
Hmm, there's have quite a few observers going on.
In the stopObserving() function, they clear the kvoObservers array, but I
figured they would have to individually stop observing each one within the
array, rather than setting to empty.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACGZSTZTMUG3GYCFYECHELTLM52PANCNFSM4KFQMAAA>
.
|
Sure, if you want me to take a look at it, you can email me privately if you prefer. |
So for the granular control that you mentioned, Celestial provide the ability to pause and resume download tasks: func pauseDownload(for sourceURL: URL)
// Usage: Celestial.shared.pauseDownloaf(for: someURL)
func resumeDownload(for sourceURL: URL)
// Usage: Celestial.shared.resumeDownloaf(for: someURL) Those are essentially what the two prefetching APIs are doing under the hood, but this lets you pause/resume individual tasks. As for your code snippets, I'm not seeing any standout reasons why the video needs to wait for a complete download to begin playing. |
Compressing Data requires iOS 13.0, which may be too restricting.
Additionally, it seems that compressing Data results in a larger file so it seems unnecessary given the original file size
The text was updated successfully, but these errors were encountered: