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 Encoder GUIs

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th February 2008, 14:39   #681  |  Link
buzzqw
HDConvertToX author
 
Join Date: Nov 2003
Location: Cesena,Italy
Posts: 6,552
latest build of x264 have added AQ automatically if not set "--aq-strenght 0" (the same on automkv, but fixed in next version)

the avinaptic problem is due to "--nal-hrd -aud" parameter used for compatibility with ps3/bluray

BHH
__________________
HDConvertToX: your tool for BD backup
MultiX264: The quick gui for x264
AutoMen: The Mencoder GUI
AutoWebM: supporting WebM/VP8
buzzqw is offline   Reply With Quote
Old 10th February 2008, 15:29   #682  |  Link
survivant001
Registered User
 
Join Date: Nov 2007
Posts: 449
Quote:
Originally Posted by Atak_Snajpera View Post
No I can not because I have never had that error with my settings. Your settings are extremely weired! --Keint 13 (!!!) and so on. So no wonder if you get unexpected results.
ah ah ah

I'm not using keyint 13 for fun.. it's a test.

With the default command line from ripbot264 and automkv I still got the buffer underflowns.. and it's not for all the movies.. just one.

Still trying to figure what cause the problem. I think it's a bug in x264.

for now, I'm trying settings like Sagitaire suggested. (--qcomp 0.50) I did a test with keyint 24 and --qcomp 0.50, vbv-max 26000.. still got the error..

now keyint 24, vbv 30000 --qcomp 0.45 will know in 3.5 hours

Last edited by survivant001; 10th February 2008 at 15:34.
survivant001 is offline   Reply With Quote
Old 10th February 2008, 19:04   #683  |  Link
weaver4
Registered User
 
Join Date: Jun 2005
Posts: 925
Quote:
Originally Posted by buzzqw View Post
latest build of x264 have added AQ automatically if not set "--aq-strenght 0" (the same on automkv, but fixed in next version)

the avinaptic problem is due to "--nalhrd --aud" parameter used for compatibility with ps3/bluray

BHH
So I guess there is no way to do reasonable file size with single pass in this version. What version do I need to go back to.

Can we have a second "more conventional" Level 4.1 profile for computers, xbox, popcornhour and such. I don't like the fact I can not open it in avinaptic. PS3 is such a strange animal.
weaver4 is offline   Reply With Quote
Old 10th February 2008, 20:02   #684  |  Link
buzzqw
HDConvertToX author
 
Join Date: Nov 2003
Location: Cesena,Italy
Posts: 6,552
stay with cef's 709

BHH
__________________
HDConvertToX: your tool for BD backup
MultiX264: The quick gui for x264
AutoMen: The Mencoder GUI
AutoWebM: supporting WebM/VP8
buzzqw is offline   Reply With Quote
Old 10th February 2008, 21:27   #685  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,806
Quote:
So I guess there is no way to do reasonable file size with single pass in this version. What version do I need to go back to.
uncheck AQ quant. in profile

Quote:
Can we have a second "more conventional" Level 4.1 profile for computers, xbox, popcornhour and such. I don't like the fact I can not open it in avinaptic. PS3 is such a strange animal.
uncheck AVCHD compatibility in profile
Atak_Snajpera is offline   Reply With Quote
Old 10th February 2008, 21:45   #686  |  Link
Bigmango
Registered User
 
Join Date: Nov 2006
Posts: 415
Quote:
Originally Posted by Atak_Snajpera View Post
Here is sample code:
if form2.m2ts.Checked=true then duration:=duration*1.065 else duration:=duration*1.0005; // manual adjustments to avoid oversize. However It doesn't work for M2TS
if (copyaudiostream=0) and (duration<>0) then tempcalc:=(size*1048576/duration*8-audiobitrate)/1000;
if (copyaudiostream=1) and (duration<>0) then tempcalc:=(size*1048576-AudioFileSize)/duration*8/1000;


Duration represents movie length in seconds
AudioFileSize is in bytes
I have done some tests with a couple files.

Using your variation of the standard bitrate formula doesn't work with the files I have tested (you are not applying the overhead to the audio). To me it seems that adding a 5,2% compensation to the duration for the overhead (m2ts + avchd structure) does the trick using the standard bitrate formula.

BUT the audio bitrate must be used within the calculation, substracting the audio file size will not work (I don't know why, maybe because the audio is not the same duration as the movie, I'm not sure) (yes, I am using audio stream copy).

Btw: you forgot to apply the overhead to the audiofilesize (audiofilesize*1.065), but as I said above, even with applying the overhead (I use 1.052) to the audio filesize the video bitrate comes out to high. So, the only way I was able to make it work was by using the audio bitrate.

The standard bitrate formula is:
((Size - (Audio * Length )) / Length) *8° = Video bitrate

Example with a 2h40 movie:
L = 160 x 60 = 9600s
Duration = 9600 * 1.052 = 10099.2 (5.2% overhead)
S= 4480 x 1024= 4'587'520
A= 640k / 8° = 80KB/s (640k ac3)

V= (((4'587'520 - (10099.2 * 80))/10099.2)*8°) = 2994

I am testing this with some more movies with different durations, but until now it seems to be fine.

Last edited by Bigmango; 10th February 2008 at 22:05.
Bigmango is offline   Reply With Quote
Old 10th February 2008, 22:41   #687  |  Link
Bigmango
Registered User
 
Join Date: Nov 2006
Posts: 415
After some more testing it seems that the best way is to just substract 5.5% overhead from the media size. This will work if you use an audio bitrate and also if you substract the audio file size doing an audio stream copy.

Example (same 2h40 movie as above, 748405 is 730Mb audio size):

V= ((4'587'520*0.945 - (9600 * 80))/9600)*8° = 2973
and
V= ((4'587'520*0.945 - 748405)/9600)*8° = 2989

I think 5.5% is good as it keeps a small margin, 5% is not enough if using audio stream copy.


Edit: fyi, with this 2h40 movie a video bitrate of 2996 will match 4480Mb exactly (using audio stream copy).

Last edited by Bigmango; 10th February 2008 at 22:48.
Bigmango is offline   Reply With Quote
Old 10th February 2008, 22:52   #688  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,806
Quote:
V= (((4'587'520 - (10099.2 * 80))/10099.2)*8°) = 2994
I think 2994 is not correct value because x264 encoder uses this format 1Kbps = 1000 bps (not 1024!)

What do you think about this?
tempcalc:=(size*1048576/duration*8/1.052-audiobitrate*1.052)/1000;

So I get 3032 Kbps instead of 2994
Atak_Snajpera is offline   Reply With Quote
Old 10th February 2008, 22:58   #689  |  Link
Bigmango
Registered User
 
Join Date: Nov 2006
Posts: 415
Quote:
Originally Posted by Atak_Snajpera View Post
I think 2994 is not correct value because x264 encoder uses this format 1Kbps = 1000 bps (not 1024!)

What do you think about this?
tempcalc:=(size*1048576/duration*8/1.052-audiobitrate*1.052)/1000;

So I get 3032 Kbps instead of 2994
Won't do, 3032 is too much. A video bitrate of 2996 matches 4480Mb exactly (check my above edit).

What do you think about just substracting 5.5% from the media size (as per my 2nd post) ?

Edit: in my example 4480Mb = m2ts + avchd structure (final tsremux blu-ray output, ready to burn to DVD)

Last edited by Bigmango; 10th February 2008 at 23:10.
Bigmango is offline   Reply With Quote
Old 10th February 2008, 23:12   #690  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,806
Quote:
Won't do, 3032 is too much.
So we should use 5.5% instead. From experience I'm sure that final result must be divided by 1000. If you divide by 1024 you will never get correct file size in MKV/MP4 (those have very small overheads)

Quote:
What do you think about just substracting 5.5 from the media size (as per my 2nd post) ?
Encode smaller movie ~90 min and 2h:40 and let's see if this work. Use 640 for audio in all tests.

Last edited by Atak_Snajpera; 10th February 2008 at 23:21.
Atak_Snajpera is offline   Reply With Quote
Old 10th February 2008, 23:35   #691  |  Link
Bigmango
Registered User
 
Join Date: Nov 2006
Posts: 415
Quote:
Originally Posted by Atak_Snajpera View Post
Encode smaller movie ~90 min and 2h:40 and let's see if this work. Use 640 for audio in all tests.
I have already done 2h40 (above example), and 1h40.

Now I have 3h07 in the pipe (about 40 minutes more encoding), and after this I am doing a 1h55 movie encode.

I have no 90 minutes movie at hand currently, but will test it as soon as I get the opportunity.
Bigmango is offline   Reply With Quote
Old 10th February 2008, 23:51   #692  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,806
Quote:
Now I have 3h07 in the pipe (about 40 minutes more encoding), and after this I am doing a 1h55 movie encode.

I have no 90 minutes movie at hand currently, but will test it as soon as I get the opportunity.
I will also make some tests with this formula filesize/1.055

Quote:
Now I have 3h07 in the pipe (about 40 minutes more encoding), and after this I am doing a 1h55 movie encode.
What do you have QuadCore@4GHZ

Last edited by Atak_Snajpera; 10th February 2008 at 23:55.
Atak_Snajpera is offline   Reply With Quote
Old 11th February 2008, 00:32   #693  |  Link
Bigmango
Registered User
 
Join Date: Nov 2006
Posts: 415
Ok, so the 3h07 movie is done. 5.5% overhead is not enough, it needs a 6% overhead which will give it a 2435 bitrate.

I still don't have the right formula, but this is some info for you (audio is always 640k) based on real ripbot encodes (not calculations):

With a 3h07 movie to match 4480Mb exactly (full avchd structure( m2ts + tsremux blu-ray)) you need a 2440 bitrate.
With a 2h40 movie you need a 2996 bitrate to match 4480Mb.

These are the maximum bitrates the calculation must give for these movie lenghts.

I will test some more with shorter movies.

Last edited by Bigmango; 11th February 2008 at 00:34.
Bigmango is offline   Reply With Quote
Old 11th February 2008, 00:37   #694  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,806
Quote:
Ok, so the 3h07 movie is done. 5.5% overhead is not enough, it needs a 6% overhead which will give it a 2434 bitrate.
overhead is changing if movie is longer (has more frames) . I'm not surprised I'm encoding now 85min movie.It should be ready by tomorrow morning.

Quote:
I still don't have the right formula
Once my encoding is ready I will be able to create formula which will calculate overhead according to number of frames

Last edited by Atak_Snajpera; 11th February 2008 at 00:50.
Atak_Snajpera is offline   Reply With Quote
Old 11th February 2008, 01:10   #695  |  Link
Bigmango
Registered User
 
Join Date: Nov 2006
Posts: 415
Quote:
Originally Posted by Atak_Snajpera View Post
Once my encoding is ready I will be able to create formula which will calculate overhead according to number of frames
Nice !

If it can help you, these are the frame numbers of the above movies:

3h08: 269650 frames (max bitrate to reach 2440)
2h40: 229707 frames (max bitrate to reach 2996)
Bigmango is offline   Reply With Quote
Old 11th February 2008, 01:20   #696  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,806
Quote:
3h08: 269650 frames (max bitrate to reach 2440)
2h40: 229707 frames (max bitrate to reach 2996)
Give me also exact percentage values. I will need them to make a graph in excel.
Atak_Snajpera is offline   Reply With Quote
Old 11th February 2008, 01:38   #697  |  Link
Bigmango
Registered User
 
Join Date: Nov 2006
Posts: 415
Quote:
Originally Posted by Atak_Snajpera View Post
Give me also exact percentage values. I will need them to make a graph in excel.
I didn't reach these exact bitrate numbers using a calculation (my calculations were always a few k/s off, as you can see above).

I found these bitrates by encoding the movies 2 times (and a 3rd encode confirms the bitrate is right). So this is the exact max bitrate.


BTW, I have 1 question: the 3h08 movie quality is very good @ 2440k, but I get some small blockyness sometimes on faces (but everything else is perfect). I am now encoding the movie again to improve this, with ESA, RDO lvl2, and p4x4. I think the PS3 will support this, but is p4x4 AVCHD compliant ? Also, would 4 b, 4 ref frames work ?
Bigmango is offline   Reply With Quote
Old 11th February 2008, 08:05   #698  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,806
Quote:
I am now encoding the movie again to improve this, with ESA, RDO lvl2, and p4x4. I think the PS3 will support this, but is p4x4 AVCHD compliant ? Also, would 4 b, 4 ref frames work ?
p4x4 is not allowed in Level 4.1. 4 ref and 4 b won't solve problem with blocking because 2440k is very low for 1280x544.

85 min = 4482 MB (m2ts + bluray) We are almost at home

Last edited by Atak_Snajpera; 11th February 2008 at 08:10.
Atak_Snajpera is offline   Reply With Quote
Old 11th February 2008, 08:57   #699  |  Link
Bigmango
Registered User
 
Join Date: Nov 2006
Posts: 415
Quote:
Originally Posted by Atak_Snajpera View Post
p4x4 is not allowed in Level 4.1. 4 ref and 4 b won't solve problem with blocking because 2440k is very low for 1280x544.
Ok,

Quote:
Originally Posted by Atak_Snajpera View Post
85 min = 4482 MB (m2ts + bluray) We are almost at home
Nice !
Bigmango is offline   Reply With Quote
Old 11th February 2008, 13:07   #700  |  Link
hfmls
Registered User
 
Join Date: Jan 2008
Posts: 41
how do i define the temp folder?
hfmls is offline   Reply With Quote
Reply

Tags
264, 265, appletv, avchd, bluray, gui, iphone, ipod, ps3, psp, ripbot264, x264 2-pass, x264 gui, x264_64, x265, xbox360

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 23:40.


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