Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 4
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 567 times and has 3 replies Next Thread
ilpelle
Newbie



Italy
Joined: Jun 13, 2023
Post Count: 1
Status: Offline
Reply to this Post  Reply with Quote 
Headless Video Rendering

Hi everybody,
And thanks first of all for this excellent software.

I have used it proficiently in the past month to prepare a 3D model of my new home. Just brilliant.

I wanted to produce a high-quality (exceptionally long) video using the nice yafaray renderer, but quickly noticed that it would take forever on my laptop. I honestly didn't want to burn my second fan.

So I decided to attempt a headless video renderer program to run the rendering on one of my 48-core HPC machines. This wasn't as easy as expected, but you can find the source code repository here. I hope it can be of any help to somebody.

In line with the Console Photo Generator approach, the program is taking the camera path from the SH3D file. So, you can prepare a path using the "Video" window, save it, and run it on your server in headless mode. The SH3D file format is just clever for this stuff.

I am not particularly happy with the code quality, but much of the noise is related to the quality of the JMF library (sick), which cannot consistently make a difference between the GUI and the processing part. With some class overriding, running in AWT headless mode was possible.

I didn't test the codebase thoroughly, though: only a couple of samples from the SH3D website and my massive model. Should you find any problem, open an issue on GitHub.
Also, I tested it only on Linux. Due to a lack of time, I couldn't run it on my Windows and Mac OS machines. I may try to check that in the future if there is some interest.

Thanks for this great program, I hope my small contribution may benefit someone.

PS: the next step could be to drop in MPI and support clusters to render high-quality videos, but the code should need some refactoring at the data source level. I am not sure I will ever find the time for that, but if anyone is interested, I may spend a couple of days on this.
[Jun 13, 2023, 11:45:53 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
beji
Newbie




Joined: Mar 12, 2024
Post Count: 2
Status: Offline
Reply to this Post  Reply with Quote 
Re: Headless Video Rendering

Hi Alessandro Pellegrini

I managed to run your program on Linux. I also managed to compile and run this program on Windows.

I used Java 11 (openlogic-openjdk-11.0.22+7-windows-x64.msi) downloaded from https://www.openlogic.com/openjdk-downloads

To compile on windows:

javac -cp .;.\libs\* -d bin ^
.\src\picocli\CommandLine.java ^
.\src\it\alessandropellegrini\sweethome3d\headlessrenderer\ImageDataSource.java ^
.\src\it\alessandropellegrini\sweethome3d\headlessrenderer\CameraRenderer.java ^
.\src\it\alessandropellegrini\sweethome3d\headlessrenderer\HeadlessRenderer.java ^
.\src\it\alessandropellegrini\sweethome3d\headlessrenderer\jmt\HeadlessJMD.java ^
.\src\it\alessandropellegrini\sweethome3d\headlessrenderer\jmt\HeadlessPlaybackEngine.java ^
.\src\it\alessandropellegrini\sweethome3d\headlessrenderer\jmt\HeadlessMediaProcessor.java ^
.\src\it\alessandropellegrini\sweethome3d\headlessrenderer\jmt\HeadlessSourceModule.java ^
.\src\it\alessandropellegrini\sweethome3d\headlessrenderer\QuickTimeEncoder.java ^
.\src\it\alessandropellegrini\sweethome3d\headlessrenderer\CameraPath.java



To run on windows:

java -Dj3d.rend=noop ^
-Djava.awt.headless=true ^
-Djava.library.path=yafaray ^
-classpath bin;libs\jmf.jar;libs\j3dcore.jar;libs\vecmath.jar;libs\j3dutils.jar;libs\gluegen-rt.jar;libs\SweetHome3D.jar;libs\jogl-java3d.jar;libs\sunflow-0.07.3i.jar ^
it.alessandropellegrini.sweethome3d.headlessrenderer.HeadlessRenderer ^
-f 25 -s 1 -w 320 -h 240 -i File.sh3d -o File.mov


Here are the results:


Program W x H Frame FPS Time Time / Frame
------------ ---------- ----- --- ----------- ------------

Create Video 320 x 240 166 25 4 min 10 s 1.5 s

PVR 2.6.2 320 x 240 135 25 6 min 34 s 2.9 s

Headless VR 320 x 240 111 25 2 min 36 s 1.4 s

Headless VR 640 x 480 111 25 12 min 27 s 6.7 s

Headless VR 1280 x 960 111 25 39 min 18 s 21.2 s


Good thing about this program:

1. Create 9:16 video format (e.g --width=450 --height=800). This format not available in Create Video and PVR. Hope Puybaret and Enko Nyito can consider that.

2. Reduce number of frame to render (e.g --speed=8/16/32). Very useful if you need to move the camera quickly for a relatively long distance such as 100 meter.

If you don't mind, I would like to request the following:

1. Add option to choose SunFlow.

2. Add option to create 3D video with Quality 1.


Lastly, a big THANK YOU to Puybaret for developing this excellent program.
[Mar 13, 2024, 4:12:03 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9182
Status: Offline
Reply to this Post  Reply with Quote 
Re: Headless Video Rendering

Thanks for your feedback smile

It's not possible to create a video at the two first quality levels in headless mode under Linux if your computer doesn't run a X11 display.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Mar 13, 2024, 12:04:16 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
beji
Newbie




Joined: Mar 12, 2024
Post Count: 2
Status: Offline
Reply to this Post  Reply with Quote 
Re: Headless Video Rendering

OK. Thanks for the info.

Just wanted to update here that the above results were obtained in Windows 10.
[Mar 13, 2024, 4:41:41 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved