[XviD-devel] Fw: libxvidcore compiling

Dark Sylinc dark_sylinc at yahoo.com.ar
Tue Apr 8 00:17:44 CEST 2008


Stephan Assmus is indeed right if you wrote your own
player. If you're using AVI/ASF, I think the
container's framerate is used (regardless XviD
settings)

If you wrote your own player, it will run as fast as
it can unless you prevent it.
If your PC is too slow (say, can only represent 20fps)
the only way to achieve 30fps is by skipping frames
(or make it run slower at 20fps)

Surely nowadays computer will go at _much_ higher
speed. You'll have to correct timing.

1 sec = 1000 milliseconds.
30 frames/second = 1/30 = 0.03333333

This means you have to wait 0.0333 seconds (also 33ms)
before displaying the next frame.
Or said in other terms, each frame must be on the
monitor for 33ms.

Timing can be achieved using QueryPerformanceCounter
in Windows. Don't use gettickcount to achieve that
because it has a low accuracy (it updates every 55ms)
which means that your playback will be inconsistent.

Hope this helps
Dark Sylinc

--- Stephan Assmus <superstippi at gmx.de> escribió:

> 
> reno reballos wrote:
> > Master Dark Sylinc,
> > 
> > sorry for this question...i cant help myself
> anymore...
> > 
> > just wanna ask,  i have encoded the stream already
> into file using xvid 
> > and when i try to play it backi got play back but
> the problem is so 
> > fast... maybe my encoding settings affects this
> here is my settings for 
> > encoding:
> > 
> > 1. i use single pass plugin control.
> > 2. profile = XVID_PROFILE_AS_L0
> > 3. frame rate @30 fps
> > 4. bit rate = 900kB
> > 5. reaction_delay_factor = 16 
> > 6. averaging_period = 100
> > 7. min_quant = 2
> > 8. max_quant = 31
> > 9. max_key_interval = frame rate*10 (30*10)
> > 10.max_bframes = 2
> > 11.bquant_ratio = 150
> > 12.bquant_offset = 75
> > 13.frame_drop_ratio = 0
> > 14. global flag = XVID_GLOBAL_PACKED
> > 15. bframe_threshold = 255
> > 16.aspect ratio = XVID_PAR_43_PAL
> > 17. vol_flags = XVID_VOL_MPEGQUANT
> > 
> > i hope you can help me work this out, i just
> wanted to have normal play 
> > back coz my playback right now is so fast... and i
> think by having 
> > correct values on the above field will have me
> correct/normal playback...
> 
> From what I recall, you plaback in your own
> application. That should not 
> have anything to do with xvid at all. You use xvid
> for decoding, but then 
> it is the job of your application to display the
> decoded frames at the rate 
> you desire, ie 30fps. If you don't do any
> timing/waiting, then you are 
> obviously displaying at the same rate as your
> computer is able to decode 
> the frames.
> 
> I would approach the problem as follows: Make a
> thread that decodes frames 
> and puts them into a blocking queue that accepts
> only so many buffers (for 
> example 3, but it depends on the latency you want to
> achieve). Make another 
> thread that pulls buffers out of the queue and
> displays them, this thread 
> would be locked to a certain timing (30 fps). This
> setup will result in the 
> decoding thread blocking at the queue, being locked
> to the rate at which 
> the display thread pulls buffers from the queue.
> Should anything result in 
> the overall system needing too much time to decode a
> particular frame, you 
> have a short bridge of three frames to smooth it
> out.
> 
> Best regards,
> -Stephan
> _______________________________________________
> XviD-devel mailing list
> XviD-devel at xvid.org
> http://list.xvid.org/mailman/listinfo/xvid-devel
> 


IMPORTANT:
The information contained in this email may be commercially sensitive and/or legally privileged. It is intended solely for the person(s) to whom it is addressed. If the reader of this message is not the intended recipient, you are on notice of its status and hereby notified that your access is unauthorized, and any review, dissemination, distribution, disclose or copying of this message including any attachments is strictly prohibited. Please notify the sender immediately by reply e-mail and then delete this message from your system.


      Tarjeta de crédito Yahoo! de Banco Supervielle.
Solicitá tu nueva Tarjeta de crédito. De tu PC directo a tu casa. www.tuprimeratarjeta.com.ar 


More information about the XviD-devel mailing list