I am trying to automate some simulations with Jupyter. Everything goes well, except the part when I am trying to create the video.
If I upload the simulated data to AB and select from the drop down menu
Main.MyCam.Create_Video, then it works as intended. But when I set the following command in Jupyter:
OperationRun('Main.MyCam.Create_Video'), then the end result is a series of
.png without the video.
I know that the video creation command first saves a
.png for every frame, then puts it together to create a video, and then deletes the images so in the designated folder only the video is left. Now my question is, why is the same command run from Jupyer not giving the same output? Is there something else I should be passing to Jupyter except the command to make a video? I have tried to give the commands line by line as well :
Create_video, ConvertVideo, RemoveImageFiles, but the end result is the same.
Thanks in advance!
So I have found that during the simulations there is the following warning:
Warning: Material::setShininess() of 11520 is above permitted maximum, clamping to 128.
This warning does not appear when I play the video from the AB menu, but it does appear when I run it from Jupyter. Otherwise I have no errors or other warnings.
You can just ignore the
setShininess warning, that has been fixed internally and do not affect the model in any way - it is just annoying.
For the missing video generation, my best guess is that your Jupyter environment do not include ffmpeg.
Try to see if you have ffmpeg on your PATH variable or included in your Jupyter environment.
I have added the ffmpeg to my PATH variable but the result is the same. I also tried using pip install and conda install but nothing changed.
Have you set up a dedicated environment for the notebook?
VideoLookAtCamera class you can enable the debug mode and try to set the
VideoPathFFMPEG to the absolute path to your ffmpeg executable.
Do you see any errors in the log files generated by anypytools?
I have activated the debug mode. The path was already set so I did not change that. In the log files generated by anypytools, I do not have errors, but only the above mentioned warning.
When I run the simulation I have the following error:
I have made the name of the video a design variable in AB, such as: `VideoName = DesignVar("_testing_video"); and I am giving it a different name when runing the simulation. For some reason, the images created are named correctly (the same name I pass in Jupyter) but when the ffmpeg is executed, the name is switched back to the one I have in AB, so I guess it cannot find the .png to convert it.
Is there a way to make the name last for the entire simulation? Or maybe I am doing something wrong. Right now I am using the following sequence:
*EDIT: I just tried to run the simulation without changing the name of the video and it works as intended, but I would still like to be able to change the name of the file from Jupyter if possible.
Okay, that brings us a lot closer to the problem.
My first step would be to try and use a
UpdateValues() class in your macro.
You import it the same way as other macro command classes.
So you insert something like:
Be sure to put it after all your set value operations and before the study operation run.
Thank you so much! That was indeed the problem, I was not updating the values. Now everything works perfectly.
Thank you for your help and have a nice day!
This topic was automatically closed 125 days after the last reply. New replies are no longer allowed.