I've started playing around with using VP8 video encoding via FFmpeg and libvpx. I wanted to see if it was as good as libx264, but I'm struggling to find how to use it properly.
For libx264 there are a bunch of options and presets available, but I don't know what they are for libvpx.
Are there any "-vpre" things for libvpx?
What should I do to get a good output?
The WebM page gives a bunch of sample commands, but they don't work with FFmpeg (I think because the commands are for ivfenc, whatever that is).
Any ideas?
How can I produce a good quality WebM / VP8 coded video with FFmpeg? (Or just with Ubuntu in general, doesn't have to FFmpeg).
I got most of the parameters from the preset files available in the google patches. However, some of them did not work with the native FFMPEG vp8 encoder as of the latest SVN build.
The deinterlace parameter can be removed if the video is not interlaced.
The aspect parameter forces 16:9, change it to 4:3 if you have standard def video.
The -aq parameter can safely be lowered to 60 or 70, but I am picky about having high quality audio.
The -threads parameter should be lowered to the max available threads that your cpu can handle. I use a core i7 so the max treads are 8.
However, some of them did not work with the native FFMPEG vp8 encoder as of the latest SVN build.
There is no native FFmpeg VP8 encoder yet, but there is a native VP8 decoder though.
Originally Posted by demizer
[*]The -aq parameter can safely be lowered to 60 or 70, but I am picky about having high quality audio.
I believe the -aq range for libvorbis via FFmpeg for stereo is -1 to 10. Anything above 10 probably ends up about the same as what 10 would provide. See Recommended Vorbis Encoder Settings for a nice chart of each quality level.
Last edited by FakeOutdoorsman; July 2nd, 2010 at 09:52 PM.
What do the "-g" and "-level" settings do? Where can I find the presets on the WebM site? Some of the options mentioned look interesting. What about 2-pass encoding? Can I just specify "-pass 1" and put the video to "/dev/null" and then "-pass 2" after that? (Like with x264).
Come to think of it, is there some sort of command I can pass to FFmpeg to have it tell me all of the acceptable arguments for the libvpx encoder? It must list them somewhere, because it obviously knows when you use one it doesn't recognise...
Also, about the Vorbis audio, I knew that it went from -1 to 10, but in some programs, such as SuondKonverter, the levels seem to be multiplied by 10, to go from 0 to 100, and I think it's then possible to specify, say, 85 which I think means 8.5 on the proper scale. Maybe FFmpeg does this?
Also, can I safely use an .mkv container? So far my computer doesn't know what to do with a .webm file (not hard to fix, but still) but it can play the VP8 codec. Is Matroska going to widely support VP8 in the future? Or should I just use the .webm container to avoid confusion?
Also, can I safely use an .mkv container? So far my computer doesn't know what to do with a .webm file (not hard to fix, but still) but it can play the VP8 codec. Is Matroska going to widely support VP8 in the future? Or should I just use the .webm container to avoid confusion?
Bear in mind that a WebM container is actually a pared down Matroska container anyway, some interesting reading here which demonstrates that mkvtoolnix accepts WebM as an input and also output. Courtesy of the work I do packaging mkvtoolnix for another distro I have the latest copy at hand and I can confirm it works beautifully. The attached screenshots shows WebM input being converted to full mkv output which MPlayer plays with no problem... The 3rd screenshot shows the option to create an output file with WebM constraints.
All the best,
Andrew
Last edited by andrew.46; July 3rd, 2010 at 10:16 AM.
I believe the -aq range for libvorbis via FFmpeg for stereo is -1 to 10. Anything above 10 probably ends up about the same as what 10 would provide. See Recommended Vorbis Encoder Settings for a nice chart of each quality level.
I am the co-author of that wiki page. You providing me with valuable information. Let me scrim through the manual and see what I can cook up. I will document how to do it in ffmpeg I think your on the right track though with audio in standalone encoder -q 5 more then likely maps to -aq 50 in ffmpeg!. I just did a quick test with a MPEG-2 TS file from a DVD and ivfenc encodes the file quite nicely. The thing that I don't like about the video encoder is that it does specify how to encode audio via Vorbis with the standalone encoder!? What's that all about !?. Let me do some digging and I will see what I can find. We can at least show folks how to do it with ffmpeg in the meantime. I think maybe --codec switch in ivfenc has something to do specify the audio, but Google did a VERY POOR job documenting it besides the --good and --best quality switches. The i420 is regular MPEG2 stream btw. It's stands for interlaced 420.
Last edited by HotshotGG; July 14th, 2010 at 11:03 PM.
The ffmpeg command didn't seem to work for me. Obviously, I need to do more setup and prep for the libvpx. What do you do to set this up? I just got the following error
Code:
Requested output format 'webm' is not a suitable output format
Bookmarks