POV-Ray : Newsgroups : povray.general : Trying to be lazy in Windows Server Time
23 Nov 2024 18:23:21 EST (-0500)
  Trying to be lazy in Windows (Message 1 to 9 of 9)  
From: Josh English
Subject: Trying to be lazy in Windows
Date: 15 Jul 2023 13:43:56
Message: <64b2dadc$1@news.povray.org>
I am getting really tired of re-learning how to use ffmpeg every time I 
want to make an animation.

Since I'm using Windows, I can't use a Post_Scene_Command, so I thought 
I could use Python.

I wrote a simple script that uses Python's subprocess.run() function to 
render the animation, then I want to use it again to run ffmpeg and 
finally a third time for ffplay.

Unfortunately POV-Ray pops up, renders, and doesn't quit. I can't seem 
to find a command line option to close POV-Ray once the rendering is 
finished. Only after I close POV-Ray does the script continue.

Is this possible on Windows or am I wasting my time?


Post a reply to this message

From: m@b
Subject: Re: Trying to be lazy in Windows
Date: 16 Jul 2023 12:31:11
Message: <64b41b4f$1@news.povray.org>
On 15/07/2023 6:43 PM, Josh English wrote:
> 
> Since I'm using Windows, I can't use a Post_Scene_Command, so I thought 
> I could use Python.

It doesn't answer your question but you can do Post_Scene_Command using 
a windows batch file, here is my setup:

In the ini file:

Output_File_Name=D:\Files\POV-Ray\ANI0\PovRay0.png
Post_Scene_Command=D:\Files\POV-Ray\Bats\PostScene2.bat

PostScene2.bat:
-----------------------------------------------------------------------
@echo off

D:

cd D:\Files\POV-Ray\ffmpeg-20200612-38737b3-win64-static\bin

echo Running ffmpeg.  Press [q] to stop, [?] for help

ffmpeg -hide_banner -loglevel warning -stats -framerate 24 -i 
D:\Files\POV-Ray\ANI0\PovRay%%04d.png -codec:v libx264 -y -pix_fmt 
yuv420p D:\Files\POV-Ray\Animations\POVout.mp4

echo Running ffplay

ffplay -hide_banner -loglevel warning -loop -1 
D:\Files\POV-Ray\Animations\POVout.mp4

-----------------------------------------------------------------------


Post a reply to this message

From: Samuel B 
Subject: Re: Trying to be lazy in Windows
Date: 16 Jul 2023 18:00:00
Message: <web.64b467ea69eaf73bf8c47d526e741498@news.povray.org>
Josh English <Jos### [at] joshuarenglishcom> wrote:
> I am getting really tired of re-learning how to use ffmpeg every time I
> want to make an animation.

Hi Josh,

I'm also not really answering your question, but: do you know how to use
Blender? I just recently found a way to take a series of images produced by
POV-Ray and make them into an MPEG, or whatever else Blender supports. It's
really easy. I can give more info, or provide a .blend if you're interested in
taking that route.

Sam


Post a reply to this message

From: Josh English
Subject: Re: Trying to be lazy in Windows
Date: 16 Jul 2023 19:07:38
Message: <64b4783a@news.povray.org>
On 7/16/2023 9:31 AM, m@b wrote:
> On 15/07/2023 6:43 PM, Josh English wrote:
>>
>> Since I'm using Windows, I can't use a Post_Scene_Command, so I 
>> thought I could use Python.
> 
> It doesn't answer your question but you can do Post_Scene_Command using 
> a windows batch file, here is my setup:
> 
> In the ini file:
> 
> Output_File_Name=D:\Files\POV-Ray\ANI0\PovRay0.png
> Post_Scene_Command=D:\Files\POV-Ray\Bats\PostScene2.bat
>

I don't think about batch files, but how do you get the 
Post_Scene_Command to trigger? It's disabled on the windows version. At 
least it's never worked for me.


Post a reply to this message

From: Josh English
Subject: Re: Trying to be lazy in Windows
Date: 16 Jul 2023 19:08:38
Message: <64b47876$1@news.povray.org>
On 7/16/2023 2:58 PM, Samuel B. wrote:
> Josh English <Jos### [at] joshuarenglishcom> wrote:
>> I am getting really tired of re-learning how to use ffmpeg every time I
>> want to make an animation.
> 
> Hi Josh,
> 
> I'm also not really answering your question, but: do you know how to use
> Blender? I just recently found a way to take a series of images produced by
> POV-Ray and make them into an MPEG, or whatever else Blender supports. It's
> really easy. I can give more info, or provide a .blend if you're interested in
> taking that route.
> 
> Sam
> 
That would be an interesting option. I have Blender but I find it's a 
little too much for me to manage.

Josh


Post a reply to this message

From: m@b
Subject: Re: Trying to be lazy in Windows
Date: 17 Jul 2023 05:29:57
Message: <64b50a15@news.povray.org>
On 17/07/2023 12:07 AM, Josh English wrote:
> On 7/16/2023 9:31 AM, m@b wrote:
>> On 15/07/2023 6:43 PM, Josh English wrote:
>>>
>>> Since I'm using Windows, I can't use a Post_Scene_Command, so I 
>>> thought I could use Python.
>>
>> It doesn't answer your question but you can do Post_Scene_Command 
>> using a windows batch file, here is my setup:
>>
>> In the ini file:
>>
>> Output_File_Name=D:\Files\POV-Ray\ANI0\PovRay0.png
>> Post_Scene_Command=D:\Files\POV-Ray\Bats\PostScene2.bat
>>
> 
> I don't think about batch files, but how do you get the 
> Post_Scene_Command to trigger? It's disabled on the windows version. At 
> least it's never worked for me.
> 

Could it be something in the options menu?
"Disable starting other programs"??


Post a reply to this message


Attachments:
Download 'menue1.png' (16 KB)

Preview of image 'menue1.png'
menue1.png


 

From: Josh English
Subject: Re: Trying to be lazy in Windows
Date: 17 Jul 2023 22:42:24
Message: <64b5fc10$1@news.povray.org>
On 7/17/2023 2:29 AM, m@b wrote:
> On 17/07/2023 12:07 AM, Josh English wrote:
>> On 7/16/2023 9:31 AM, m@b wrote:
>>> On 15/07/2023 6:43 PM, Josh English wrote:
>>>>
>>>> Since I'm using Windows, I can't use a Post_Scene_Command, so I 
>>>> thought I could use Python.
>>>
>>> It doesn't answer your question but you can do Post_Scene_Command 
>>> using a windows batch file, here is my setup:
>>>
>>> In the ini file:
>>>
>>> Output_File_Name=D:\Files\POV-Ray\ANI0\PovRay0.png
>>> Post_Scene_Command=D:\Files\POV-Ray\Bats\PostScene2.bat
>>>
>>
>> I don't think about batch files, but how do you get the 
>> Post_Scene_Command to trigger? It's disabled on the windows version. 
>> At least it's never worked for me.
>>
> 
> Could it be something in the options menu?
> "Disable starting other programs"??

That option doesn't seem to have an effect in my 3.7 or 3.8beta apps.


Post a reply to this message

From: Samuel B 
Subject: Re: Trying to be lazy in Windows
Date: 18 Jul 2023 17:00:00
Message: <web.64b6fd0569eaf73bf8c47d526e741498@news.povray.org>
Josh English <Jos### [at] joshuarenglishcom> wrote:
> On 7/16/2023 2:58 PM, Samuel B. wrote:
> > Josh English <Jos### [at] joshuarenglishcom> wrote:
> >> I am getting really tired of re-learning how to use ffmpeg every time I
> >> want to make an animation.
> >
> > Hi Josh,
> >
> > I'm also not really answering your question, but: do you know how to use
> > Blender? I just recently found a way to take a series of images [...]
> >
> That would be an interesting option. I have Blender but I find it's a
> little too much for me to manage.
>
> Josh

Yeah, Blender is like that. If nothing else works out, I can write up a
mini-tutorial that wouldn't require much knowledge of the program. (The process
basically amounts to overriding normal rendering by using the compositor to load
a series of images.)

I can't remember why I stopped trying to use ffmpeg for this, but there was some
impediment. I've used Gimp in the past to stitch frames together and then export
a .gif but the whole process is brutal, especially when the images fall out of
order and you have to manually drag the layers...

Krita is also an option, if you have that. It supports importing images as
layers and exporting animations.

Sam


Post a reply to this message

From: Leroy
Subject: Re: Trying to be lazy in Windows
Date: 19 Jul 2023 14:45:00
Message: <web.64b82e1b69eaf73bb457f86cf712fc00@news.povray.org>
"m@b" <sai### [at] googlemailcom> wrote:
> On 17/07/2023 12:07 AM, Josh English wrote:
> > On 7/16/2023 9:31 AM, m@b wrote:
> >> On 15/07/2023 6:43 PM, Josh English wrote:
> >>>
> >>> Since I'm using Windows, I can't use a Post_Scene_Command, so I
> >>> thought I could use Python.
> >>
> >> It doesn't answer your question but you can do Post_Scene_Command
> >> using a windows batch file, here is my setup:
> >>
> >> In the ini file:
> >>
> >> Output_File_Name=D:\Files\POV-Ray\ANI0\PovRay0.png
> >> Post_Scene_Command=D:\Files\POV-Ray\Bats\PostScene2.bat
> >>
> >
> > I don't think about batch files, but how do you get the
> > Post_Scene_Command to trigger? It's disabled on the windows version. At
> > least it's never worked for me.
> >
>
> Could it be something in the options menu?
> "Disable starting other programs"??

Yes There is!
It's under  Options: Script I/O Restrictions: Disable Starting other Programs

In the example above the 'Post_Scene_Command' could equal any program ya need
not just a bat file.
That program can return an error code, that is caught with with
Post_Scene_Return=s; There are lot of variables that POV can sent to that
program & several things that an error can do. You can find them starting with
3.2.6.1 String Substitution in Shell Commands in widows doc.

 I use Post_Frame_Command a while back to make 3d animations. I wrote a program
that would by pass two images then on the third it would rename it and delete
the other two. The POV code make two images left & right and take those two to
make the third.
 The fun part is getting the program I wrote and POV to work together.
Have Fun!!


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.