Quantcast Mencoder: Buffer Underflows - digitalFAQ.com Forums [Archives]
  #1  
05-17-2004, 05:14 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
I've been getting some buffer underflows with my DVD encode tests, avg bitrate 2000-3000kbps. Is there any simple way to get rid of them or do I just have to use CCE for those encodes ?
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
05-17-2004, 05:52 AM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
Which build of mencoder you are using??
Are you encoding 1pass or 2pass?
As when choosing avg's of i.E. 2000-3000kbps I never had Buffer underruns again! And my Player plays it back with no Probs.
Did you check that on your DVD player?

Problem is you cant set in Mencoder vrc_minrate=xxx, as then the bitrate is broken. Thats a known mencoder issue, .. but as said above I never had Probs without vminrate setted.

Try to add some noise (first tick is the one suggested by Kwag).
But Phil is "a bit" right as he said IF you do encode a 2.35:1 source that noise will also be added to the leaved black border from 2.35:1 to 1.77:1(1.85:1) but that will also happen when using fitcd without determining the effective "movie area" before

But I did say "a bit right" above as the noise in that amount only gives the encoder information that even at black scenes there does something happen, so the min bitrate at these scenes will be rised and the "noise" will almost be quantized out! .... I did several 2.35 source tests and didnt recognise partial noise on black borders .... but Phil's thought gots its logic, and I should add a "Source 2.35:1 ?" button so other cropping values in such a case would be used so that almost no black borders even at 2.35:1 input will be left.

So try setting a bit noise where beside that the movie gots a tiny bit more natural look.
Id did came off of "plaining" sources that much when I do enjoy big media sizes like you also do have in this example IF encoding using i.E. using an avg bitrate of 2000-3000kbit.



The only factor which would count for me to still use CCE is IF I want to affect DC precision to 9 or 10 ...
Reply With Quote
  #3  
05-17-2004, 06:07 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
I used your latest CVS build (P4 optimized), 2-pass. The first pass doesn't show any underflows, they occur in the second pass.

I solved Phil's problem by cropping, resizing and filtering in the AVS script and then expanding to 704x576 in MEncoder. I've not experimented with the internal filters so I wanted to be rather safe than sorry

I think the next thing I'll try is raising the max bitrate, maybe that would help.
Reply With Quote
  #4  
05-17-2004, 06:16 AM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
Quote:
Originally Posted by Boulder
I solved Phil's problem by cropping, resizing and filtering in the AVS script and then expanding to 704x576 in MEncoder. I've not experimented with the internal filters so I wanted to be rather safe than sorry

I think the next thing I'll try is raising the max bitrate, maybe that would help.
If you want to see "some " filters:
http://www.kvcd.net/forum/viewtopic....10637&start=16

Why do you do your whole postprocessing in avisynth but then expanding in Mencoder?? In that case do the "whole" pprocessing in avisynth and choose "no resize" or ged rid of all image manipulation parameters/commands in your mencoder line.

btw. You did use a Keyinterval of 24! And as you do a high avg bitrate encoding I assume you encode to dvd-r?
Well as I assume you know what u are doing, your SA-Player supports a gop length of 24 in DVD mode?
Reply With Quote
  #5  
05-17-2004, 06:27 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by incredible

If you want to see "some " filters:
http://www.kvcd.net/forum/viewtopic....10637&start=16

Why do you do your whole postprocessing in avisynth but then expanding in Mencoder?? In that case do the "whole" pprocessing in avisynth and choose "no resize" or ged rid of all image manipulation parameters/commands in your mencoder line.
That's because I wanted to make sure that the min bitrate is around 300kbps so my Pioneer doesn't get hiccups. I also didn't want the noise to be put on the borders and I was unsure which Blockbuster line would be sufficient. As the "noise=3th" has been tested thoroughly, I wanted to use it.

Quote:
btw. You did use a Keyinterval of 24! And as you do a high avg bitrate encoding I assume you encode to dvd-r?
Well as I assume you know what u are doing, your SA-Player supports a gop length of 24 in DVD mode?
Yes, the player has no problems with 24-frame GOPs in DVDs, at least none that I know of
Reply With Quote
  #6  
05-17-2004, 11:30 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Boulder
Yes, the player has no problems with 24-frame GOPs in DVDs, at least none that I know of
Hi Boulder,

I stopped using longer GOPs with mencoder, because I get a "smearing" (trailing objects) when using 24.
This seems to be a peculiarity of mencoder.
Using 15 (PAL) or 18 (NTSC) doesn't show these artifacts, and compression is still very high, when using the notch matrix.
So I suggest standard GOPs with mencoder

-kwag
Reply With Quote
  #7  
05-18-2004, 04:02 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
Well, in that case Mencoder's of no use to me as the main reason was the speed of CCE and ability to use 24-frame GOPs combined

I personally dislike TMPGEnc for DVD encodes since it takes ages to predict and encode. With jonny's QCCE I can encode 2-3 1h TV captures on one day which is not possible with TMPGEnc.
Reply With Quote
  #8  
05-18-2004, 05:43 AM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
Quote:
was the speed of CCE and ability to use 24-frame GOPs combined
Could you explain me then how you get a framecount of 24 within a GOP setted in CCE?
CCE allows only a max framecount of 15 (even in NTSC) within a GOP.
Or ... did I miss something recently??? A Trick or a new release of CCE

According to captures ... as I did promise to DigiDoc ... the next days (if not even I get my resol. claculation engine ready meanwhile) Ill integrate resizing templates which do support the common capture source size inputs:
PAL: 768x576,704x576,352x576,352x288
NTSC: 640x480,352x480,325x240

I already did tests on YUY2 mjpeg input (PicVideo) and for shure mencoder does read them like a charme
captures using YV12 Xvid can also be encoded but I strongly advice to Noobs NOT to use that codec if doing capturing:
http://www.kvcd.net/forum/viewtopic.php?t=9380
(not adressed to you but to capture noobs)


My conclusion ... Mecoder (already in 1pass) does - even if a GOP of still 15/18 is used - give a better output than CCE.
And IF you still want to go beyond the std. GOP count ... in case of mencoder that would be only a special Matrix setting ... means less filtering in the non-intra 8x8 dct block.
Reply With Quote
  #9  
05-18-2004, 06:22 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by incredible
Quote:
was the speed of CCE and ability to use 24-frame GOPs combined
Could you explain me then how you get a framecount of 24 within a GOP setted in CCE?
CCE allows only a max framecount of 15 (even in NTSC) within a GOP.
Or ... did I miss something recently??? A Trick or a new release of CCE
What I meant was that the speed of encoding with Mencoder is similar to CCE and the 24-frame GOP from Mencoder (if it worked ok) would be splendid

I'll have to experiment with Mencoder a bit more before I do any final conclusions. I'll leave that special matrix to Kwag
Reply With Quote
  #10  
05-18-2004, 06:54 AM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
Just to tell that I did a KDVD tonight (2pass needs 10 hours on my PC - encoding at 7/9 fps).

This morning the 2pass was near 30% and I saw 4 underflow messages on the screen. I don't know if there were some during 1st pass and I can't tell how many there will have before the jobs ends.

My question is : do you think I can securely burn the final video ?

FYI : PAL DVD, Res 704*576, Denoise to 2nd tick, Blockbuster to 1st one, no other option use, AVG=2000, max=4500, min=0.
Reply With Quote
  #11  
05-18-2004, 07:50 AM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
I the past using Packshot I had only 2 encodings where "still" an underflow error occured, .... but playback was NO Problem on (my) SAP.
Reply With Quote
  #12  
05-18-2004, 09:34 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Boulder
What I meant was that the speed of encoding with Mencoder is similar to CCE and the 24-frame GOP from Mencoder (if it worked ok) would be splendid
The quality of mencoder is still superior, even with a GOP of 18

-kwag
Reply With Quote
  #13  
05-18-2004, 09:39 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
I'm currently testing encoding with MEncoder again (with the same movie), this time with min quantizer=2 to avoid buffer underflows and lmin=1. Now it seems that the encode will end up undersized even though I raised the max bitrate from 5000 to 8000

Guess I'll have to lower the lmin value to 0.5 and see what happens..
Reply With Quote
  #14  
05-18-2004, 09:42 AM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
The higher you set qmin ... the more quantisized will your movie be in average!
And higher quantization on black parts means even LESS bitrate, so just try maybe vqmin=1:lmin=0.1 (just a test as you work using vey high avg bitrates ... which IMHO you dont even need in mencoder )
Reply With Quote
  #15  
05-18-2004, 09:52 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
That's the problem..quant 1 is generally considered A Bad Thing To Do since the quality increase is pretty much negligible compared to quant 2. The filesize just gets a lot bigger.

This also worries me a bit when using vminq=1 (from the docs) : "ratecontrol will be confused resulting in lower quality".

I'll try running the encode with the values you suggested and see what comes out.
Reply With Quote
  #16  
05-18-2004, 11:27 AM
digitall.doc digitall.doc is offline
Free Member
 
Join Date: Jul 2003
Location: Valencia (España)
Posts: 741
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Boulder
That's the problem..quant 1 is generally considered A Bad Thing To Do since the quality increase is pretty much negligible compared to quant 2. The filesize just gets a lot bigger.

This also worries me a bit when using vminq=1 (from the docs) : "ratecontrol will be confused resulting in lower quality".

I'll try running the encode with the values you suggested and see what comes out.
I wouldn't worry too much about what man_page says on vqmin=1: we're using this setting in lots of encodings, without a problem. I think it may be a problem in constant quantizer encoding (vqscale=1), but in our encodings, you will see in BitrateViewer tha quantizers don't keep constant in 1 but vary usually around 1.5-2, even higher.

About buffer underflows... I also don't like to see those warnings. But later I don't have a single problem when muxing/authoring/viewing.
Where I did have problems was when minrate too low, in SKVCD. But not with underflows. Anyway, it would be nice to know why it happens, and how to solve them...
Reply With Quote
  #17  
05-18-2004, 11:47 AM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
I'm sorry to interfer with your discussion : just want to say that my first 2pass KDVD is finished and for what I can see it's really nice. A lot better than what I did with CCE without any script used (only Denoiser set to 2 in pack-shot and blockbuster to 1).

I'm much more enthousiast that I was with ffvfw since week ago.
Reply With Quote
  #18  
05-18-2004, 12:15 PM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
Phil, no problem

By the way, Bitrate Viewer shows really funny figures..Q is sometimes negative
Reply With Quote
  #19  
05-18-2004, 01:48 PM
Koekies Koekies is offline
Free Member
 
Join Date: May 2004
Location: Amsterdam
Posts: 124
Thanks: 0
Thanked 0 Times in 0 Posts
@kwag is the number of frames in a gop "keyint"? Because I keep getting artifacts So should I change that to 18?

-Koekies
Reply With Quote
  #20  
05-18-2004, 01:50 PM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
I think I read Inc tellign that in a post today : yes GOP length = Keyint. And you should reduce it to 18.
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Mencoder: Buffer underflowing maurus Video Encoding and Conversion 10 06-01-2004 01:46 PM
Buffer underflow con Mencode-me nogod Convertir y Codificar Video (Español) 47 05-31-2004 01:18 PM
Mencoder: Changing/Setting field order in mencoder tuco1979 Video Encoding and Conversion 1 04-17-2004 09:06 AM
KVCD: BBMPEG Underflows when muxing Files? Jellygoose Video Encoding and Conversion 6 11-08-2002 08:02 PM
KVCD: Buffer underflow? marky Video Encoding and Conversion 3 07-17-2002 02:46 PM

Thread Tools



 
All times are GMT -5. The time now is 02:22 AM  —  vBulletin © Jelsoft Enterprises Ltd