Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
![]() |
#1 | Link |
None
Join Date: Jul 2007
Location: The Background
Posts: 276
|
When doing 2 pass video encoding with FFmpeg, how to find the optimal bitrate?
When doing 2 pass video encoding with VP8 (libvpx), is there a way to figure out the optimal bitrate,
so I don't have to guess? Something like a small compression test, or some ffmpeg command, that will help me determine the appropriate bitrate? I tried reading the VP8 1st pass stats file in notepad, but it's all garbled. I'm using Windows 7 with the latest FFmpeg build. |
![]() |
![]() |
![]() |
#2 | Link | ||
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,034
|
Sorry, can't really answer that, but I'm curious about:
a. How do you define 'optimal bitrate'? b. How do you get VP8 to archive an average bitrate that you specify? (last time I checked VP8&VP9 both weren't able to at least nearly hit the average bitrate I specified and thus specifying for example 1000kBit/s and ending up with a 200kBits or 3000kBit/s stream kind of killed the use of 2pass for VP8&VP9) So that I didn't just post some questions: In general, you could basically to the same thing all the other compression tests and their users do: 1st do a bunch of encodes and come up with a rule of the thumb about how many bits are needed per pixel so the output will look good for you 2nd do a bunch of encodes and come up with a correlation between the average quantizer used and your pixel goal 3rd encode a portion of your input encode it with a fixed quantizer, this will give you an approximated relation of quantizers and your pixel goal for your current source. Use that approximation and your pixel goal to calculate the average bitrate you want. 4th encode your input with the average bitrate (<- no clue how to do this with vp8 and vp9) you now aim for and assuming your previous approximations and rules are robust enough you archived your goal. (I'm not aware of any one who did all this and implemented it into some tool) Quote:
Quote:
=> I had to use VP8, I would probably stick with constant quantizer encoding or (assuming I managed to find a way to produce clips with and average bitrate I specified) I would probably choose a bitrate which is roughly 1.5 times larger than the bitrate I would use for MPEG-4 ASP. (btw. VP9 would be - a lot - slower encoding wise, normally not get near the bitrate you specified for 2pass encoding, but it would require less bitrate to archive the same quality that VP8 provided, so depending on your goals VP9 might be worth checking it out) Cu Selur |
||
![]() |
![]() |
![]() |
#3 | Link | |||
None
Join Date: Jul 2007
Location: The Background
Posts: 276
|
Quote:
It's a shame that VP8 doesn't show any info on the command line about which quantizer values it's using. For VP8, I'm going to start with low bitrate, and keep increasing it until it looks good to me, and is comparable to the source video. Quote:
When doing two passes, you only specify the bitrate in the second pass by using the -b:v switch. You specify the bitrate in bits, not kilobits. So for example, if you want a bitrate of 700 kBit/s, you specify -b:v 700000. It is very accurate. Quote:
I tested both VP8 and Xvid. VP8 requires about 25% smaller bitrate than XviD to achieve better quality. Here, check it out: XviD (2 pass, default settings, 900 kbit/s) VP8 (2 pass, default settings, 700 kbit/s) I haven't yet tried it, because I'm happy with VP8 quality, but I'm looking forward to try it in the future. Last edited by orion44; 16th September 2015 at 20:41. |
|||
![]() |
![]() |
![]() |
#4 | Link |
ангел смерти
![]() Join Date: Nov 2004
Location: Lost
Posts: 9,555
|
You should probably just run xvid to calculate the bitrate you're looking for. It's almost instantaneous these days, and several old programs even have "compressibility checks" that test a small percentage of video to estimate the total size.
You'd be better off figuring out roughly what crf you're achieving and stick to that, once you've done that a few times. crf is what you really seem to want, given that you "care" about file size but don't have an upper bound aside from xvid's or x264's size, which sounds like not caring about size to me. |
![]() |
![]() |
![]() |
Tags |
ffmpeg, vp8 |
Thread Tools | Search this Thread |
Display Modes | |
|
|