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.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 ASP

Reply
 
Thread Tools Search this Thread Display Modes
Old 19th January 2017, 01:44   #1  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 493
XviD overshooting target file size

Is there anything, other than user error, that could cause a 2-pass XviD encode to exceed its intended file size? In particular, will it overshoot if the target file size is "too low" for the video's resolution, frame rate, and amount of motion? I just had to set the target amount of video data to 280 mb in order to get the actual amount of data down to ~310 mb (with audio adding another ~40 mb for a total file size of 350 mb).
__________________
If I ask "How do I do X?" or "what happens if I do X?", and X is a very bad thing that no one would ever normally do, assume that I already know this, and that I have Katie reasons for asking anyway.

Last edited by Katie Boundary; 19th January 2017 at 09:27.
Katie Boundary is offline   Reply With Quote
Old 19th January 2017, 10:38   #2  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,161
Dont know, but TmpGenc mpeg used to have a minimum bitrate that it would not go below (and would not tell you that it was going to ignore your settings).
(about 200kb/s I think, for mpeg)
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but are any of them infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 20th January 2017, 20:35   #3  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,308
@Katie Boundary: try setting overflow treatment settings all to 10% instead of the default 5%.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 14th February 2017, 14:16   #4  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 493
Quote:
Originally Posted by Selur View Post
@Katie Boundary: try setting overflow treatment settings all to 10% instead of the default 5%.
That helped somewhat.
__________________
If I ask "How do I do X?" or "what happens if I do X?", and X is a very bad thing that no one would ever normally do, assume that I already know this, and that I have Katie reasons for asking anyway.
Katie Boundary is offline   Reply With Quote
Old 15th February 2017, 07:05   #5  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,311
Any particular reason you're still encoding MPEG-4 ASP in 2017?

Mainly I'm just curious
Blue_MiSfit is offline   Reply With Quote
Old 15th February 2017, 22:08   #6  |  Link
fantasmanegro
Registered User
 
Join Date: Dec 2009
Posts: 214
Quote:
Originally Posted by Blue_MiSfit View Post
Any particular reason you're still encoding MPEG-4 ASP in 2017?

Mainly I'm just curious
Old DVD player compatibility as I do?
fantasmanegro is offline   Reply With Quote
Old 28th February 2017, 19:04   #7  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 3,484
Quote:
Originally Posted by fantasmanegro View Post
Old DVD player compatibility as I do?
Yeah, but don't you knock up a quick copy for DVD player viewing with Xvid single pass encoding, or 2 pass encoding if you're really keen, using the x264 encode you ran for archiving as the source?
hello_hello is offline   Reply With Quote
Old 28th February 2017, 22:24   #8  |  Link
fantasmanegro
Registered User
 
Join Date: Dec 2009
Posts: 214
Quote:
Originally Posted by hello_hello View Post
Yeah, but don't you knock up a quick copy for DVD player viewing with Xvid single pass encoding, or 2 pass encoding if you're really keen, using the x264 encode you ran for archiving as the source?
i guess not... if you have an old 26" crt tv at home
fantasmanegro is offline   Reply With Quote
Old 17th February 2017, 08:03   #9  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 493
Quote:
Originally Posted by Blue_MiSfit View Post
Any particular reason you're still encoding MPEG-4 ASP in 2017?

Mainly I'm just curious
What is ASP?
__________________
If I ask "How do I do X?" or "what happens if I do X?", and X is a very bad thing that no one would ever normally do, assume that I already know this, and that I have Katie reasons for asking anyway.
Katie Boundary is offline   Reply With Quote
Old 17th February 2017, 15:08   #10  |  Link
Midzuki
Unavailable
 
Midzuki's Avatar
 
Join Date: Mar 2009
Location: offline
Posts: 1,409
Quote:
Originally Posted by Katie Boundary View Post
What is ASP?
Advanced Simple Profile, of course.

https://en.wikipedia.org/wiki/MPEG-4...file_.28ASP.29
Midzuki is offline   Reply With Quote
Old 19th February 2017, 22:49   #11  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 493
Quote:
Originally Posted by Midzuki View Post
Advanced Simple Profile, of course.

https://en.wikipedia.org/wiki/MPEG-4...file_.28ASP.29
Oh. No, I don't bother with profiles. I always set the profile to unrestricted.
__________________
If I ask "How do I do X?" or "what happens if I do X?", and X is a very bad thing that no one would ever normally do, assume that I already know this, and that I have Katie reasons for asking anyway.
Katie Boundary is offline   Reply With Quote
Old 19th February 2017, 23:13   #12  |  Link
Groucho2004
 
Join Date: Mar 2006
Posts: 3,540
Quote:
Originally Posted by Katie Boundary View Post
Oh. No, I don't bother with profiles. I always set the profile to unrestricted.
So why are you using such an inefficient encoder?
Groucho2004 is offline   Reply With Quote
Old 18th February 2017, 13:16   #13  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,308
@Katie Boundary: also make sure qmin=1 and qmax = 51
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 18th February 2017, 17:35   #14  |  Link
Midzuki
Unavailable
 
Midzuki's Avatar
 
Join Date: Mar 2009
Location: offline
Posts: 1,409
Quote:
Originally Posted by Selur View Post
@Katie Boundary: also make sure qmin=1 and qmax = 51
I think you meant qmin=2 and qmax=31
Midzuki is offline   Reply With Quote
Old 6th March 2017, 09:24   #15  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,308
Quote:
I think you meant qmin=2 and qmax=31
No, I meant qmin=1 and qmax=31.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 15th April 2017, 03:48   #16  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 493
1.3.4

I'm currently converting season 2 of Modern Family to VCD-compliant Mpeg-1, but once that's done, I'll dust off some of ye olde Andromeda or Birds of Prey scripts and see if changing the minimum quantizer from 1 to 2 has much of an effect.
__________________
If I ask "How do I do X?" or "what happens if I do X?", and X is a very bad thing that no one would ever normally do, assume that I already know this, and that I have Katie reasons for asking anyway.
Katie Boundary is offline   Reply With Quote
Old 15th April 2017, 09:59   #17  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,263
Quote:
...and see if changing the minimum quantizer from 1 to 2 has much of an effect.
It depends on the matrix. See for example the discussion here
http://forum.doom9.org/showthread.ph...775#post787775
Looking forward to seeing your findings.
Sharc is offline   Reply With Quote
Old 16th April 2017, 22:47   #18  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 493
Unfortunately, upping the minimum quantizer did not fix the problem.
__________________
If I ask "How do I do X?" or "what happens if I do X?", and X is a very bad thing that no one would ever normally do, assume that I already know this, and that I have Katie reasons for asking anyway.
Katie Boundary is offline   Reply With Quote
Old 16th April 2017, 23:10   #19  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,263
Same problem with single-pass and target bitrate?
Sharc is offline   Reply With Quote
Old 17th April 2017, 15:09   #20  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 3,484
Katie probably won't read this post, or pretend not to, because I think I'm one of the "other forum members" she refers to in her signature which means I'm on her ignore list so I can't learn from her reading my posts..... or however it works according to her signature...... but...
she probably should try what I did here and run a CQ2.0 single pass encode to see what the resulting bitrate will be, and whether it's in the same ballpark as the bitrate she's using for 2 pass encoding. Or she could at least run a compression test. I'd explain how to run one but I probably haven't got it wrong enough to learn how.... or however it works according to her signature..... but it's just guessing without any further details.

I played around a little more with the sample I'd been using for testing a couple of days ago, and this time Xvid wasn't overshooting the requested bitrate. After hunting through log files to see WTF, it turned out I somehow reset the overflow percentage. I don't remember doing that, but with it increased to 10% again today the target bitrate was almost exact.

Highlights from yesterday's log file:

Quote:
--[Information] [14/04/17 7:09:27 PM] Avisynth input script
--[Information] [14/04/17 7:09:27 PM] resolution: 960x396
--[Information] [14/04/17 7:09:27 PM] frame rate: 24000/1001
--[Information] [14/04/17 7:09:27 PM] aspect ratio: 80:33 (2.424)
--[Information] [14/04/17 7:09:27 PM] custom command line: -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 2359296
--[Information] [14/04/17 7:09:27 PM] Job command line: "C:\Program Files\MeGUI\tools\xvid_encraw\xvid_encraw.exe" -i "D:\Test.avs" -o "D:\h263.m4v" -pass2 "D:\h263.stats" -bitrate 2000 -max_key_interval 240 -max_bframes 1 -bvhq -masking 2 -imin 1 -bmin 1 -pmin 1 -par 1 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 2359296
--[Information] [14/04/17 7:09:49 PM] Final statistics
---[Information] [14/04/17 7:09:49 PM] Video Bitrate Desired: 2000 kbit/s
---[Information] [14/04/17 7:09:49 PM] Video Bitrate Obtained (approximate): 2936 kbit/s
And today's:

Quote:
--[Information] [17/04/17 10:01:35 PM] Avisynth input script
--[Information] [17/04/17 10:01:35 PM] resolution: 960x396
--[Information] [17/04/17 10:01:35 PM] frame rate: 24000/1001
--[Information] [17/04/17 10:01:35 PM] aspect ratio: 80:33 (2.424)
--[Information] [17/04/17 10:01:35 PM] custom command line: -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 2359296
--[Information] [17/04/17 10:01:35 PM] Job command line: "C:\Program Files\MeGUI\tools\xvid_encraw\xvid_encraw.exe" -i "D:\Test.avs" -o "D:\Test megui 2050.m4v" -pass2 "D:\Test megui 2050.stats" -bitrate 2050 -max_key_interval 240 -ostrength 10 -oimprove 10 -odegrade 10 -max_bframes 1 -bvhq -masking 2 -imin 1 -bmin 1 -pmin 1 -par 1 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 2359296
--[Information] [17/04/17 10:01:51 PM] Final statistics
---[Information] [17/04/17 10:01:51 PM] Video Bitrate Desired: 2050 kbit/s
---[Information] [17/04/17 10:01:51 PM] Video Bitrate Obtained (approximate): 2058 kbit/s
That's Xvid 1.3.4.

Out of curiosity, I tried the same encode using AutoGK and Xvid 1.2.1. AutoGK wasn't happy about the bitrate.

Quote:
[17/04/17 10:06:48 PM] Custom resolution settings: fixed width of 960 pixels
[17/04/17 10:06:48 PM] Standalone support enabled: ESS
[17/04/17 10:06:48 PM] Started encoding.
[17/04/17 10:06:48 PM] Source resolution: 960x396
[17/04/17 10:06:48 PM] Source fps: 23.976
[17/04/17 10:06:48 PM] Output will contain 1001 frames
[17/04/17 10:06:48 PM] Using VAQ in XviD
[17/04/17 10:06:48 PM] Overhead: 0 bytes (0.00 Mb)
[17/04/17 10:06:48 PM] Video size: 10,485,760 bytes (10.00 Mb)
[17/04/17 10:06:48 PM] Running compressibility test.
[17/04/17 10:06:48 PM] Writing the following script to D:\agk_tmp\test 2050_agk_comptest.avs
===========================================================
[17/04/17 10:07:10 PM] Duration was: 21 seconds
[17/04/17 10:07:10 PM] Speed was: 46.59 fps.
[17/04/17 10:07:10 PM] Compressibility percentage is: 191.70
[17/04/17 10:07:10 PM] Using sharper matrix
[17/04/17 10:07:10 PM] Switching b-frames off
[17/04/17 10:07:10 PM] Chosen resolution is: 960x400 ( AR: 2.40 )
[17/04/17 10:07:10 PM] Predicted comptest value is: 129.65%
[17/04/17 10:07:10 PM] Running first pass.
[17/04/17 10:07:10 PM] Writing the following script to D:\agk_tmp\test 2050_agk_movie.avs
===========================================================
[17/04/17 10:07:31 PM] Duration was: 20 seconds
[17/04/17 10:07:31 PM] Speed was: 47.70 fps.
[17/04/17 10:07:31 PM] Expected quality of first pass size: 133.54%
[17/04/17 10:07:31 PM] Trying to adjust settings.
[17/04/17 10:07:31 PM] No adjustment is possible
[17/04/17 10:07:31 PM] Warning: final AVI will likely be undersized.
[17/04/17 10:07:31 PM] Running second pass.
[17/04/17 10:07:52 PM] Duration was: 20 seconds
[17/04/17 10:07:52 PM] Speed was: 47.70 fps.
[17/04/17 10:07:52 PM] Job finished. Total time: 1 minute, 3 seconds
It lied about using the sharper (mpeg) matrix, probably because I have the most strict hardware compatibility setting enabled, but the resulting bitrate was 1438kbps, however visually it wasn't that far off the encode I ran at 2050kbps in respect to detail retention. Maybe about 95%, but the bitrate was about 600kbps less.

AutoGK doesn't set the min quantizer to 1. Instead, when the quality is high, it actually does this (for lower quality it might reduce the min and max to 2 and 4 respectively etc.)....
Would the following really force the same quantizer for all frames (assuming B-Frames were still enabled)?


Last edited by hello_hello; 17th April 2017 at 15:11.
hello_hello is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:55.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.