bvibber / OGVKit

Ogg and WebM media playback for iOS
MIT License
216 stars 67 forks source link

vp9 codec, video frames slower than the audio #179

Closed sushipan closed 4 years ago

sushipan commented 7 years ago

Thanks for your great work ! opus audio codec works perfect on the demo, but when I play a vp9 codec 1920p or 4k video on the demo the video frames are slower than the audio.

bvibber commented 7 years ago

VP9 at higher resolutions should benefit from multithreading, though at best that will double the decode speed (all current iOS devices are dual-core). Should improve 1080p significantly, but be warned that 4K will likely still be too slow.

Should be able to change the config in vpx codec setup similar to what's done here in ogv.js: https://github.com/brion/ogv.js/blob/master/src/c/ogv-decoder-video-vpx.c#L58

bvibber commented 7 years ago

Ok, 0.5.11 / 0fe1f24ef5d282116483640f8247283d49a664c0 enables multithreading for libvpx decoding. @sushipan can you update and see how much that helps with your 1080 & 4k files?

As long as they use tile columns (which I think is now default in libvpx & ffmpeg) you should get nearly a 2x speedup on the video decode.

sushipan commented 7 years ago

Yes,decoding is faster than before ,vp9 1080p is almost perfect,only slower 3 seconds in a three minutes file,but 4k videos is not much better. Is libvpx can define a decode speed by user , like VLCKit /* Fast forwards through the feed at the rate specified. param rate Rate at which the feed should be fast forwarded. /