Changing Bitrate at a IContainer

98 views
Skip to first unread message

Wesley Santos

unread,
Mar 24, 2012, 1:09:17 PM3/24/12
to xuggle...@googlegroups.com
Hi,

I am new at using Xuggler, and I want to do the following: I need to get a video file and split it in several parts.
I can actually do this, but I also want to create different versions of these video parts, with different quality and different bitrate.

In my code I create an IContainer an then I change its StreamCoder to set a new bitrate.
Before setting the new bitrate I set its flag FLAG_QSCALE to false, but it doesn't change que video bitrate. All the versions of the video parts are the same size.

How can I do this??

sumo

unread,
Mar 25, 2012, 4:13:06 PM3/25/12
to xuggle...@googlegroups.com

In my code I create an IContainer an then I change its StreamCoder to set a new bitrate.
Before setting the new bitrate I set its flag FLAG_QSCALE to false, but it doesn't change que video bitrate. All the versions of the video parts are the same size.

How can I do this??

Are you using Theora by any chance? I do something similar and it works for h264, wmv2 but not libtheora.

- Sumit

Wesley Santos

unread,
Mar 25, 2012, 8:21:28 PM3/25/12
to xuggle...@googlegroups.com
I'm not using any Theora library, just the Xuggler library.

Would you mind to show how you are doing this? 
Also I can put my code here to you see what i'm doing wrong.

sumo

unread,
Mar 26, 2012, 7:09:03 AM3/26/12
to xuggle...@googlegroups.com

On Monday, 26 March 2012 01:21:28 UTC+1, Wesley Santos wrote:
I'm not using any Theora library, just the Xuggler library.

Sure but is video stream you are adding Theora? The codec is called libtheora.
 
Would you mind to show how you are doing this? 
Also I can put my code here to you see what i'm doing wrong.

Here is the edited code:

val stream = outputContainer.addNewStream(codec)
.
.
.
val coder = stream.getStreamCoder()
coder.setFlag(IStreamCoder.Flags.FLAG_QSCALE, false)
coder.setBitRate(bitRate)
coder.setBitRateTolerance(bitRate)
codec.delete()

Be aware though if you are using the media tool classes the MediaWriter sets the IStreamCoder.Flags.FLAG_QSCALE to true when a stream is added. If so have you looked at http://wiki.xuggle.com/Performance_Tuning#How_Can_I_Effect_BitRate_and_Other_Options?
 
Reply all
Reply to author
Forward
0 new messages