Has anyone had experience optimizing for webm? I really want to support this codec, but it's insanely slow in my experience. I'm finding that it's generally around 4x slower than mp4, but I've also had cases where it's taken up to a minute to encode a file where h264 take under 10 seconds.
My use case is to have the best performance/quality ratio for a 30 second video under 3mb.
Encoding WebM videos seems really slow. What are you doing about that?
Today, encoding VP8 in “best quality” mode is the slowest configuration. Using “good quality” mode with the speed parameter set between 0 and 5 will provide a range of speeds.
Regarding speed, I've had experience with very large batch WebP conversions, and I know firsthand that encoding speed has improved dramatically over time. Perhaps the same may happen with WebM.
I don't know the details, but how is the quality on both? I can image that webm takes longer, but if it creates a file that has a higher visual quality for the same filesize that is great. I think nearly all streaming providers would take an increase in processing time for a decrease in bandwith, while quality stays the same..
I'm pretty sure h264 is the superior codec in all regards except for that pesky license issue. It encodes faster and creates smaller files that look better. From (lead x264 developer and HN user) DarkShikari[1]:
"Overall, VP8 appears to be significantly weaker than H.264 compression-wise. The primary weaknesses mentioned above are the lack of proper adaptive quantization, lack of B-frames, lack of an 8×8 transform, and non-adaptive loop filter. With this in mind, I expect VP8 to be more comparable to VC-1 or H.264 Baseline Profile than with H.264. Of course, this is still significantly better than Theora, and in my tests it beats Dirac quite handily as well.
...
Finally, the problem of patents appears to be rearing its ugly head again. VP8 is simply way too similar to H.264: a pithy, if slightly inaccurate, description of VP8 would be “H.264 Baseline Profile with a better entropy coder..."
I won't pretend to know what all of those terms mean off the top of my head, but if the lead x264 developer sees absolutely no technical advantage in WebM vs. h264, that sounds pretty damning to me.
As for why x264 encodes h264 so much faster than ffmpeg or whatever encodes WebM, the simplest explanation would be that there is much greater demand for an optimized h264 encoder. WebM has some admittedly large users (Wikimedia Foundation, Youtube for browsers with no h264 support and no flash player, and now 4chan), but they're still vanishingly small in comparison to the users of h264 ("the entire video industry").
I think you are underplaying the support of H.264. Almost every single camera (video or photo), console, handheld device, browser, editing tool, effects tool, phone, tablet, OS, digital video player, website available today supports H.264.
People complain about it being closed but actually it is far more open on the hardware side since each of the big manufacturers are part of the H.264 process.
h.264 has several profiles. Support for particular profiles in hardware varies. If you want to do low latency encoding with a hardware "h.264 encoder" for video conferencing you may find that you're out of luck. Since there is only one VP8 profile, hardware VP8 means hardware VP8.
H.264 defines a number of profiles and levels that define the acceptable tools from the overall suite that a conforming decoder implementation can rely on. "Baseline" uses very few of these tools, relative to the more sophisticated profiles.
While some systems do have H.264 encoders,
bstar77 is using x264 which runs only on the CPU and produces much higher quality output than any hardware encoder[1].
My use case is to have the best performance/quality ratio for a 30 second video under 3mb.
These are my ffmpeg flags:
h264: "-vcodec libx264 -crf 28"
webm: "-c:v libvpx -qmin 0 -qmax 50 -crf 5 -b:v 1M -c:a libvorbis -aq 4"
The video I tested with these setting last night took 5 seconds on h264 and 35 seconds for webm, both outputting to a 2.6mb file.
System Specs: - Intel Core i7 4770 Quad-Core 3.4GHz - 16gb 1866mhz memory - ssd drive - 64bit ubuntu 12.04 lts
What further frustrates this is that I can use OpenCL to improve encoding times even more, but only with h264 in ffmpeg (as far as I know).