Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
b2218f18
Commit
b2218f18
authored
20 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
added option to use mencoder (to create mpeg4)
parent
70c4320a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
demos/anim.script
+26
-15
26 additions, 15 deletions
demos/anim.script
with
26 additions
and
15 deletions
demos/anim.script
+
26
−
15
View file @
b2218f18
...
...
@@ -4,14 +4,23 @@ oldw = General.GraphicsWidth;
oldh = General.GraphicsHeight;
all = GetValue("Animate one view at a time, or all views together (0=one, 1=all)?", 1) ;
General.GraphicsWidth = GetValue("Width of animation?", 320);
General.GraphicsHeight = GetValue("Height of animation?", 240) ;
format = GetValue("Animation format? (0=mpeg, 1=gif)?", 0) ;
MPEG = 0;
GIF = 1;
General.GraphicsWidth = GetValue("Width of animation?", 640);
General.GraphicsHeight = GetValue("Height of animation?", 640) ;
method = GetValue("Animation method? (0=mpeg_encode, 1=mencoder, 2=whirlgif)?", 0) ;
MPEG_ENCODE = 0;
MENCODER = 1;
WHIRLGIF = 2;
Print.JpegQuality = 100;
// Clean-up temp files from previous run
If(method == WHIRLGIF)
System "rm -f /tmp/tmp*.gif" ;
EndIf
If(method == MPEG_ENCODE || method == MENCODER)
System "rm -f /tmp/tmp*.jpg /tmp/tmp.par" ;
EndIf
If(all)
For i In {1:PostProcessing.NbViews}
View[i-1].TimeStep = 0;
...
...
@@ -20,10 +29,10 @@ If(all)
frame = View[0].NbTimeStep;
For index In {1:View[0].NbTimeStep}
Draw;
If(
format ==
GIF)
If(
method == WHIRL
GIF)
Print Sprintf("/tmp/tmp%03g.gif", index);
EndIf
If(
format
== MPEG)
If(
method
== MPEG
_ENCODE || method == MENCODER
)
Print Sprintf("/tmp/tmp%03g.jpg", index);
EndIf
For i In {1:PostProcessing.NbViews}
...
...
@@ -46,10 +55,10 @@ If(!all)
For j In {1:View[i-1].NbTimeStep}
index++;
Draw;
If(
format ==
GIF)
If(
method == WHIRL
GIF)
Print Sprintf("/tmp/tmp%03g.gif", index);
EndIf
If(
format
== MPEG)
If(
method
== MPEG
_ENCODE || method == MENCODER
)
Print Sprintf("/tmp/tmp%03g.jpg", index);
EndIf
View[i-1].TimeStep++;
...
...
@@ -58,14 +67,18 @@ If(!all)
EndFor
EndIf
If(
format ==
GIF)
If(
method == WHIRL
GIF)
// Call whirlgif
System "whirlgif -minimize -loop -o /tmp/animation.gif /tmp/tmp*.gif" ;
// Clean-up
System "rm -f /tmp/tmp*.gif" ;
EndIf
If(format == MPEG)
If(method == MENCODER)
// Call mencoder
System "mencoder 'mf:///tmp/tmp*.jpg' -mf fps=5 -o /tmp/animation.mpg -ovc lavc -lavcopts vcodec=mpeg4:vhq";
// System "mencoder 'mf:///tmp/tmp*.jpg' -mf fps=5 -o /tmp/animation.mpg -ovc lavc -lavcopts vcodec=mpeg1video:vhq";
EndIf
If(method == MPEG_ENCODE)
// create the parameter file for mpeg_encode
System 'echo "PATTERN I" > /tmp/tmp.par' ;
System 'echo "BASE_FILE_FORMAT JPEG" >> /tmp/tmp.par' ;
...
...
@@ -87,8 +100,6 @@ If(format == MPEG)
System 'echo "END_INPUT" >> /tmp/tmp.par' ;
// Call mpeg_encode
System "mpeg_encode /tmp/tmp.par" ;
// Clean-up
System "rm -f /tmp/tmp*.jpg /tmp/tmp.par" ;
EndIf
General.GraphicsWidth = oldw;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment