Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Not matching file size when encoding in XVID
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
R!tman
Veteran
Veteran


Joined: 18 Dec 2003
Posts: 1303
Location: Zurich, Switzerland

PostPosted: Thu Nov 25, 2004 11:59 am    Post subject: Not matching file size when encoding in XVID Reply with quote

Hi all,

when I rip a DVD and encode it in xvid I have some problems.

Lets say I want a normal movie (1.5-2h) to be on 1 CD, no problem. The movie is almost exactly 700MB.

But when I want it on 2CDs or bigger, the movie is not 1400MB.
The last movie I did was about 1h45mins and I wanted it to be 2GB (~1/2 DVD). I have 2 ogg sound streams with 160kBit/s each. But altogether the movie is only 1.1GB.

Why? How can I change that?

Everything works normal with divx, but I would rather use xvid.

I use dvd::rip and have the movie on max quality (quel, max movement...).


Last edited by R!tman on Sun Nov 28, 2004 12:53 pm; edited 2 times in total
Back to top
View user's profile Send private message
R!tman
Veteran
Veteran


Joined: 18 Dec 2003
Posts: 1303
Location: Zurich, Switzerland

PostPosted: Thu Nov 25, 2004 11:15 pm    Post subject: Reply with quote

I made a small test with 1000 frames.

Bitrate in kbit/s - filesize im MB
350 - 3.3
500 - 4.0
750 - 5.2
1000 - 6.4
1250 - 6.5
1500 - 6.5
2000 - 6.5

Seems like the size is not influenced by the bitrate since a certain quality is achieved. I think divx shows the same behavior but I have not fully tested it yet.

But it still looks quite odd...
Back to top
View user's profile Send private message
SZwarts
l33t
l33t


Joined: 13 Oct 2003
Posts: 629
Location: Sydney, NSW, Australia

PostPosted: Thu Nov 25, 2004 11:27 pm    Post subject: Reply with quote

If you really want to match a file size you have to do a two pass I think. After that you should be able to target a certain match pretty acurately.
If your doing only a one pass, this is very hard because the bitrate is variable and the bitrate you give is only some sort of indication, the codec is variating it all the time depending on how complex the scenes are.
_________________
only when it is dark enough, can you see the stars
Back to top
View user's profile Send private message
R!tman
Veteran
Veteran


Joined: 18 Dec 2003
Posts: 1303
Location: Zurich, Switzerland

PostPosted: Fri Nov 26, 2004 12:32 am    Post subject: Reply with quote

SZwarts wrote:
If you really want to match a file size you have to do a two pass I think


I AM doing two passes. Sorry, I forgot to mention that.
Back to top
View user's profile Send private message
SZwarts
l33t
l33t


Joined: 13 Oct 2003
Posts: 629
Location: Sydney, NSW, Australia

PostPosted: Fri Nov 26, 2004 5:16 am    Post subject: Reply with quote

Well in that case I suppose it is your program, because in mplayer it works fine. I don't have a DVD here so I tested it on a smalle file, which I converted to xvid

Code:
mencoder -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=X:vpass=1 -oac copy input.avi -o output.avi;mencoder -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=X:vpass=2 -oac copy input.avi -o output.avi


(according to the mplayer site vodec mpeg4 is xvid compatiable)

and the results are:
Code:

 8237116   350.avi
 8784984   500.avi
10678072   750.avi
13570764  1000.avi
16478868  1250.avi
19423708  1500.avi
25163734  2000.avi

And I still have an increase in filesize after 1250
_________________
only when it is dark enough, can you see the stars
Back to top
View user's profile Send private message
R!tman
Veteran
Veteran


Joined: 18 Dec 2003
Posts: 1303
Location: Zurich, Switzerland

PostPosted: Fri Nov 26, 2004 2:54 pm    Post subject: Reply with quote

Ok, strange things happen...

I can reproduce your stuff. But this is NOT xvid. ie, lavc doesn't give me qpel.

But the strange things are these:
Code:
mencoder -o /scratch/test/test.avi -nosound -ovc xvid -xvidencopts bitrate=10000 /scratch/test/test.vob

This works. Changing the bitrate works and gives larger or smaller files. After doing what is in the code line, the file is considerably big, lets say xMB. No wonder with bitrate 10000.

But when I do the following directly after
Code:
mencoder -o /scratch/test/test.avi -nosound -ovc xvid -xvidencopts bitrate=100:pass=1 /scratch/test/test.vob

and also pass=2, the file is still about size xMB.

So, although the bitrate is 100x smaller, it get the same filesize; and quality.

I have to do another encode without the "pass=n" argument to set another bitrate, which then is again used for 2pass encodings.

What the hell is wrong?

PS: This happens with mencoder and transcode. I already tried to remerge xvid.
Back to top
View user's profile Send private message
R!tman
Veteran
Veteran


Joined: 18 Dec 2003
Posts: 1303
Location: Zurich, Switzerland

PostPosted: Fri Nov 26, 2004 4:17 pm    Post subject: Reply with quote

Found this: http://www.xvid.org/modules.php?op=modload&name=phpBB2&file=viewtopic&t=1951&highlight=pass

It seems to "fix" it.
Back to top
View user's profile Send private message
R!tman
Veteran
Veteran


Joined: 18 Dec 2003
Posts: 1303
Location: Zurich, Switzerland

PostPosted: Sun Nov 28, 2004 12:55 pm    Post subject: Reply with quote

Well, it _seemed_ to have fixed it....

xvid-twopass.stats looks fine without chattr'ing it.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum