Handling unsupported animation files (such as MP4, AVI, WMV) through scripting

Member Posts: 80
10 Comments 5 Likes First Answer First Anniversary
**

Hi Team,
I'm exporting animation files using mechanical scripting as below:

  1. animation_export_format = (Ansys.Mechanical.DataModel.Enums.GraphicsAnimationExportFormat.MP4)
  2. settings_720p = Ansys.Mechanical.Graphics.AnimationExportSettings()
  3. settings_720p.Width = 1280
  4. settings_720p.Height = 720
  5. deformation.ExportAnimation(os.path.join(cwd_1,"deformation.mp4"), animation_export_format, settings_720p)

But when I try to display on web browser, animations files are not supporting expect .gif files, when I use web optimized and encode the video, then it was loading in web browser.

Any suggestions here.?

Welcome!

It looks like you're new here. Sign in or register to get started.

Comments

  • Member, Employee Posts: 385
    25 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭

    What version of Ansys Mechanical are you using? It was not until 25.1 release that .mp4 animations are exported in a web-supported format.

  • Member Posts: 80
    10 Comments 5 Likes First Answer First Anniversary
    **

    @Mike.Thompson Currently I'm using 2024R2 only

  • Member, Employee, GitHub-issue-creator Posts: 353
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭

    Hi Naveen. This issue has been resolved starting at 2025R1. In prior versions, the workaround is to convert the .mp4 to use the H.264 codec. This can be done, e.g., using Ansys EnSight:

    1. import ens_utils as eu
    2. eu.convert_movie("D:/wrongly_coded.mp4","D:/correctly_coded.mp4")
  • Member Posts: 80
    10 Comments 5 Likes First Answer First Anniversary
    **

    @Landon Mitchell Kanner Thanks for your response

Welcome!

It looks like you're new here. Sign in or register to get started.