Bird
0
0

You want to save an animation with 30 frames per second (fps) as an MP4 file. Which code snippet correctly sets the fps parameter?

hard📝 Application Q9 of 15
Matplotlib - Animations
You want to save an animation with 30 frames per second (fps) as an MP4 file. Which code snippet correctly sets the fps parameter?
Aanim.save('fast.mp4', writer='pillow', fps=30)
Banim.save('fast.mp4', writer='ffmpeg', frame_rate=30)
Canim.save('fast.mp4', fps=30)
Danim.save('fast.mp4', writer='ffmpeg', fps=30)
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct writer for MP4

    ffmpeg is the correct writer for MP4 files.
  2. Step 2: Use fps parameter to set frames per second

    fps is the correct argument name to control frame rate.
  3. Final Answer:

    anim.save('fast.mp4', writer='ffmpeg', fps=30) -> Option D
  4. Quick Check:

    Use fps with ffmpeg writer for MP4 speed control [OK]
Quick Trick: Use fps parameter with ffmpeg writer for MP4 [OK]
Common Mistakes:
  • Using pillow writer for MP4
  • Using wrong parameter name like frame_rate

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Matplotlib Quizzes