AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
Bob Cox
April 07, 2009 05:27PM
The MPEG-1 standard does not allow an arbitrary frame rate, and the program that AFNI uses (mpeg_encode) does not allow the user to set an arbitrary frame rate. AFNI uses the slowest MPEG-1 standard rate of 24 frames per second.

To slow down an MPEG generated from an image viewer window, the interactive AFNI program allows you to insert duplicate frames. If you set the duplication factor to 12, for example, then you'll get 2 frames per second.

The duplication factor is set from the 'Anim_Dup' control on the Button-3 popup menu attached to the intensity (grayscale) bar just to the right of the image sub-window.
A screen snapshot of these menus is at

[afni.nimh.nih.gov]
[afni.nimh.nih.gov]

Duplicating images would normally make the output file much larger. To avoid this problem, you can set a Unix environment variable to control the MPEG-1 'frame generation pattern'. I won't try to explain the different kind of MPEG-1 frames (I, B, and P) too much, but I frames take the most space, and the other 2 take less since they are partially predicted from the I frames. So for a factor of 12 duplication, I would set the pattern as below, so that each I frame is followed by 5 P frames (since the frames are duplicates, they will be well predicted):

setenv AFNI_MPEG_PATTERN IPPPPP

The pattern's length is 6, which divides the 12 duplicates nicely. (I could have used IPPPPPPPPPPP, but at the moment I tried this, I was lazy and didn't want to count out 11 Ps.)

You have to set this environment variable outside of AFNI before starting it -- there is no way to control it inside the AFNI GUI at this moment. One of these days I may set the pattern automatically based on the duplication factor, but that day is not today.

By combining frame duplication with a well-chosen frame pattern, you can get slowed down movies at little extra disk cost.

[Posted while making movies for my ISMRM presentations]

Subject Author Posted

Tip: slowing down MPEG in AFNI

Bob Cox April 07, 2009 05:27PM

Re: Tip: slowing down MPEG in AFNI

bob cox April 07, 2009 07:43PM