9 ms·
Dav1d, fast AV1 decoder, version 1.0
- kfarr 5y agoCongratulations on a major milestone! So cool to see the continued evolution of AV1
- WithinReason 5y agoHow good is the performance? Is 4K60 on a phone possible? 1080p60? Hard to find numbers on this
- iso1631 5y agoTrying to imagine how close you would have to be to the screen to tell the difference between 1080 and 4k...
- true_religion 5y agoSurely, sitting in front of a laptop or iMac would make it easy to tell.
- iso1631 5y ago"on a phone" SMPTE suggest that 4k for viewing is only worthwhile for people with 20/20 vision once the viewing angle increases beyond 30 degrees. I'm currently looking at a 40cm wide screen, I'm 80cm away from it, which is about 30 degrees. For my phone to fill that amount of space it would have to be about 10cm in front of my eyes due to binocular vision (if I just use one eye it's a bit further When I watch something on my phone it's typically 50cm away, about 15-20 degrees viewing. 720p is more than enough at that size, 1080p if you have particularly good eyesight.
- WithinReason 5y agoIt's hard to tell for uncompressed, but easy for compressed YouTube videos
- LeFantome 5y agoCompressed by what? Are you just talking about videos you record on your phone? I do not know what phone you have but an iPhone 12 ( as an example ) is under 1300 pixels on the short dimension. So you are not getting much more than 1080 pixels no matter what. It seems any experiential difference would have more to do with compression quality than with resolution. Speaking for myself, I do not think I could tell the difference between 4K and 1080p on a phone ( on a decent AV1 clip ).
- wyldfire 5y agoBut doesn't YouTube negotiate a "channel sized" rate? It seems like it switches between bitrates based on what you can tolerate. All of this is to say that it seems like a tough-to-nail-down metric to evaluate.
- iso1631 5y agoSo you're saying that a given 4k source compressed to Xmbit will look better if it's not downscaled to 1080p before compression, but instead downscaled by the display (I don't believe there are any phones with a 2160 line display)?
- WithinReason 5y ago4K YouTube videos have a higher bitrate than 1080p videos
- tedunangst 5y agoWhat they're saying is that a 1080p source upscaled to 4K and then uploaded to youtube and then downscaled by the client to a 1080p screen will look better than a 1080p upload because it has more bits.
- iso1631 5y agoThat's nothing to do with the codec or the resolution
- 5y ago
- throw0101a 5y agoI think that for most of these libraries software-only performance is a moot point: the library is there for other software to use to be able to parse the files, and the library/decoder will simply offload the heavy compute to the (hopefully eventually-available) decoding hardware instructions. To a certain extent it's just a place holder so folks can start writing software against it so that when the CPU vendors ship everyone can hit the ground running.
- WithinReason 5y agoWouldn't that only be true of the reference encoder libaom? This is the description the dav1d page gives: dav1d is the fastest AV1 decoder on all platforms :) Targeted to be small, portable and very fast. Since they use the word fast twice I was wondering how fast.
- ZeroGravitas 5y agoI'll try to dig up the slide where they demonstrated it, but basically faster at equal quality than any software decoder of any codec. Which is cool, but if you have hardware decode then you may not care, though software decode gets used in all sorts of weird places that you might not expect.
- WithinReason 5y agoOf any codec? Are you sure?
- ZeroGravitas 5y agoYeah, the key is that newer generations of codecs use more time to encode, but often the decode time goes up less than the encode time. Combine that with greater design for parallelism and you find yourself in the slightly counterintuitive situation where decoding the same quality of video is faster in the newest codecs (at the one time cost of longer encodes). I dont think it was one single slide I was thinking of but you can for example find comparisons of vp8, vp9, h264 by the same videolan/ffmpeg devs that demonstrate this general principle, the decode fps is surprisingly flat between software decodes of different codec families and generations. The earlier generations often hit bottlenecks though, I think ffmpeg VP9 decode (built by the same people as dav1d) was the leader for a while but hits a wall at 4 cores due to format limitations. HEVC and especially dav1d have some gains when you can throw a modern amount of cores at it, and even phones often have 8.
- daneel_w 5y agoIt's bad. As a reference, I tried decoding a measly 2 mbit/s test clip on an older Core 2 Duo MacBook Pro (which has no issues playing back the same in H.264 purely with software decoding), and it stuttered a lot. I don't see this thing taking off until there's decent GPU acceleration in place. "Fast decoder" is highly relative.
- clouddrover 5y agoI tried decoding a measly 2 mbit/s AV1 test clip on a 2014 MacBook Pro with a 2.2 GHz Quad-Core Intel Core i7 and it was buttery smooth.
- daneel_w 5y agoSo is an H.264/H.265 video clip at 5 or even 10 mbit/s on my 4 years old iPhone, at about 2 watts of power consumption instead of 35 watts. Can you see the advantage? I like open and free standards, and I dislike royalties, but the political aspect is best foregone when one of the alternatives really is objectively so much better for everyone.
- clouddrover 5y agoOne of the alternatives is clearly not objectively so much better for everyone. If they were so much better then VP9 and AV1 wouldn't exist. Here's what video streamers say: https://youtube-eng.googleblog.com/2015/04/vp9-faster-better-buffer-free-youtube.html https://youtube-eng.googleblog.com/2015/04/vp9-faster-better... https://engineering.fb.com/2018/04/10/video-engineering/av1-beats-x264-and-libvpx-vp9-in-practical-use-case/ https://engineering.fb.com/2018/04/10/video-engineering/av1-... https://netflixtechblog.com/netflix-now-streaming-av1-on-android-d5264a515202 https://netflixtechblog.com/netflix-now-streaming-av1-on-and... https://medium.com/netflix-techblog/bringing-av1-streaming-to-netflix-members-tvs-b7fc88e42320 https://medium.com/netflix-techblog/bringing-av1-streaming-t... https://bitmovin.com/bitmovin-improves-av1-video-encoding/ https://bitmovin.com/bitmovin-improves-av1-video-encoding/ https://blog.webex.com/video-conferencing/cisco-leap-frogs-h-264-video-collaboration-with-real-time-av1-codec/ https://blog.webex.com/video-conferencing/cisco-leap-frogs-h... https://blog.webex.com/engineering/the-av1-video-codec-comes-to-webex/ https://blog.webex.com/engineering/the-av1-video-codec-comes... Your problem is fundamentally an emotional one. Now that you suspect Device X will perform poorly at Task Y you feel buyer's remorse. Try not to worry about it so much. Computer hardware will continue to be made obsolete by more demanding software for quite some time yet.
- ksec 5y ago>Is 4K60 on a phone possible? Depends on SoC. A15? or low end UniSoC SoC? But generally speaking a modern Smartphone should be able to play 1080P 25fps 1mbps AV1 video on their phone without dropping frames. You will just be burning away your battery life.
- powersnail 5y agoWhat's the state of the art AV1 encoder right now? Is it practical to encode hours-long videos on regular personal computers now?
- ksec 5y agoIf you want quality your choice is still limited to the reference encoder libaom.
- coldpie 5y agosvtav1 is the best I've found, personally. Unlike libaom, it's parallelized, which obviously helps massively. I use it at quality profile 20 (as given to ffmpeg params), but I'm not an expert here.
- goombacloud 5y agoThere is also https://github.com/xiph/rav1e https://github.com/xiph/rav1e
- rie_t 5y agoSVT-AV1 has massively improved encoding speed. I was getting ~4x encode speed with some heavy compression (barely any noticeable quality drop) on 1080p/24fps footage on my Ryzen 7 3700X just yesterday.
- deleted 5y ago[deleted]
- powersnail 5y ago4x means that you can encode with 1/4 the time of the video, right? That sounds nice, a lot more practical than when I tried before.
- webmobdev 5y agoTo get a rough idea - is it faster or slower than HEVC encoding on a CPU (without any hardware encoder)?
- ksec 5y agoUsing the Netflix 1080P AV1 2Mbps Test clip, my old Macbook 2015 with a Intel Core i5-5287U ( Broadwell Dual Core 3.3Ghz ) just manage to play that at about 70% of the total CPU.
- bertman 5y agoFor those that want to test decoding, here are the Netflix test clips: http://download.opencontent.netflix.com/?prefix=AV1/Chimera/ http://download.opencontent.netflix.com/?prefix=AV1/Chimera/
- clouddrover 5y agoOr you can use YouTube with a browser which uses Dav1d like Firefox. An AV1 example at 1080p50: https://www.youtube.com/watch?v=YhXtJWi2PjI https://www.youtube.com/watch?v=YhXtJWi2PjI You can verify if YouTube videos are playing back in AV1 by right clicking on the video and choosing Stats for Nerds. The codec is av01 for AV1 video.
- CharlesW 5y ago> Or you can use YouTube with a browser which uses Dav1d like Firefox. I'm using Chrome on macOS, which seemingly supports this as well: Codecs av01.0.08M.08 (398) / opus (251) What decoder is Chrome using?
- minedwiz 5y agodav1d on macOS; you can actually find this out by going to `chrome://media-internals`, and looking at the field `kVideoDecoderName`
- dlp211 5y agoMy completely unscientific anecdote. i7 6600k, opened the link, Chrome CPU went from < 1%->14% which is similar to VP9 decoding. I know so little about this space so not sure how helpful the comparison is, but it is like magic what we are able to do with math.
- rie_t 5y agoI'm praying that Apple starts supporting AV1 soon...
- mimsee 5y agoApple is not really friend of royalty-free video formats. They hold some patents on h264/hvec and might see av1 as a competition.
- galad87 5y agoApple is a "Founding Member" of Alliance for Open Media (which doesn't really mean they are actually a founding member). I think Apple main issues with VP9 was that it was a Google codec by all means. Apple already supports FLAC and Opus in macOS and iOS, and VP9 in Safari. It could be that they are waiting to see if AV1 will actually get a marketshare outside Youtube or not.
- Veliladon 5y agoVP9 is an open format but can still be encumbered by patents. $20 says Google gave Apple an indemnity agreement for VP9 support for YouTube only which is why VP9 is locked down so hard in iOS. So if Apple enables VP9 and gets sued for patent infringement for their VP9 implementation Google will have to pay for some or all of the legal costs and/or judgements resulting from them.
- kouteiheika 5y ago> Apple already supports [..] Opus ...to bad that they (in the usual Apple fashion) don't support it in a standard container which everyone else supports and require you to package it in their special snowflake .caf container, so even though in theory everyone supports Opus you still need to use MP3 if you don't want to deal with having to support multiple formats/codecs at the same time.
- galad87 5y agoI thought it supported .opus too, I guess I was too optimistic.
- sergiotapia 5y agoI'm thinking about buying the latest Roku Ultra because it says it support AV1 media format. Does it have a hardware decoder or how does it manage to do it when even my nvidia Shield Pro doesn't direct play av1 content? https://www.roku.com/products/roku-ultra https://www.roku.com/products/roku-ultra
- thegoleffect 5y agoThe Ultra 2020 edition and onwards use the Realtek RTD1319 for av1 decoding. (disclaimer: I used to work there)
- at_a_remove 5y agoI am so curious about the Roku and what is under the hood. They really do have a lot of value for the cost. Quirky at times, though.
- sergiotapia 5y agoThank you just ordered the device.
- ac29 5y ago> my nvidia Shield Pro doesn't direct play av1 Even the newest Shield Pro is based on a 2015 SoC (Tegra-X1) with an integrated 2014 Nvidia GPU (Maxwell). Not surprising it doesnt support av1.
- pantalaimon 5y agoAre there even any CPUs left with AVX-512?
- mimsee 5y agoAlder lake has it and Apparently Zen 4 will have AVX-512 too https://en.wikipedia.org/wiki/AVX-512#CPUs_with_AVX-512 https://en.wikipedia.org/wiki/AVX-512#CPUs_with_AVX-512
- zucker42 5y agoAlder lake's AVX-512 comes with a significant asterisk. It's only in the P-cores (so can only be turned on if you disable the E-cores), isn't officially supported, and can't be turned on in some motherboards IIRC. We should be seeing better AVX-512 support with CPUs in the coming years though.
- einpoklum 5y agoAccording to that link, Zen 4 will only have a very limited kind of AVX-512 instructions, for working with half-precision floats. It won't even have the base AVX-512 instructions (the F set).
- th3typh00n 5y agoThat Wikipedia article is incomplete, Zen 4 will be able to run all AVX-512 code that Ice Lake can run.
- pantalaimon 5y agohad It’s physically disabled in new CPUs https://www.tomshardware.com/news/intel-nukes-alder-lake-avx-512-now-fuses-it-off-in-silicon https://www.tomshardware.com/news/intel-nukes-alder-lake-avx...
- The_rationalist 5y agoAlder lake Xeons have AVX 512 though.
- jbk 5y ago(President of VideoLAN here) What you should really look at on dav1d is the fact that the code has now around 186 kLoC of hand-written assembly in .S and .asm files… I think this is quite a feat (this is more asm than the whole FFmpeg) and this is very rare those days to write so much asm.
- eikenberry 5y agoReading this it sounds like you are discouraging using it due to the implementation being big and hard to maintain. Did you mean it this way?
- jbk 5y agoI really can't see how you read anything else that "it's very optimized" in my message, tbh.
- eikenberry 5y ago"[..] code has now around 186 kLoC of hand-written assembly in .S and .asm files…" This reads to me as it being a PITA to maintain. Cross platform code is usually a pain, cross platform with assembly optimizations is more of a pain. Optimization nearly always makes things harder to maintain, and this sounds like it was optimized to hell and back...
- jbk 5y ago> This reads to me as it being a PITA to maintain. Not more than any other language: when it's well done, it's manageable. When it's spaghetti code, it's not manageable.
- coldpie 5y agoI have a suspicion that the president of VideoLAN has a better idea of the complexity & maintainability of this code than you do.
- sethigh 5y ago
- FrostKiwi 5y agolibdav1d when it was included in MPV was such an incredible experience. Prior to, my QX9300 Thinkpad didn't manage double digit fps with anything AV1 regardless of bitrate. The love and attention put into supporting older Vector extensions is insane and suddenly it managed playback of 8bit content without framedrops. Though I'm sure anything high-bitrate will smother that QX9300.
- sylware 5y agoAV1 is for h265 and now h266 is "ready", I guess AV2 should see the light soon, shouldn't it? In the future, once mainstream CPUs cannot software decode in realtime compressed video/audio and only a specialized hardware block will be fast enough, will it be a "patent encumbered" format with tons of royalties?
- edflsafoiewq 5y agoThis endless churn of video formats isn't sustainable if every one needs to have specialized hardware.
- sylware 5y agoI was refering to the future: when the silicium will have hit its "best" (in a mass production context) and the video/audio compressed format of this future would not be able to be "software decoded" in real time by such "best silicium" CPUs: only a specialized hardware block would be able to decode such video/audio compressed format in real time. The danger is this block only implementing the decoding of a non-royalty free/patent encumbered format à la mpeg, presuming the "intellectual property" was not globally fixed and still toxic like nowdays.
- lta 5y agoKudo to jbk, videolab and all the great people involved. Thanks folks ! Also the licensing approach is great <3
- jonesnc 5y agoUnrelated, but I'm curious if console emulators could gain performance by hand-writing certain parts of it in assembly (the JIT recompiler, for example).
- tracker1 5y agoAs far as I know, a lot of console emulators have optimized assembly in places. Eventually computing overcomes the need for optimized assembly and understandable code become more desired.
- syntheweave 5y agoAs the number of code paths go up, the percentage of run-once code does too. Most findings agree that optimization increasingly tends towards a small number of hot loops which could benefit from hand optimization. In modern codebases his has the effect of micro-optimization of the "rewrite in assembly" sort mattering a great deal in heavy lifting library code like codecs, CPU emulation, rasterizers, VMs etc, and not at all in other areas. Emulation is a decent candidate in this regard but it also massively benefits from higher level simplifying assumptions(e.g. not polling for I/O changes at the true device frequency). It can be hard to notice differences in emulation quality where high level techniques are applied well. On old 8-bit architectures it was rather the opposite: you couldn't be high level about anything because you had to design towards micro-efficiency. Therefore most of your problems were solved with very simple data structures and algorithms that heavily favored either space(by recomputing the intermediate results) or time (by precomputing all answers in a LUT), and then given a very tight cycle-shaving, code-golfing implementation.