-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timelapse Compilation - GPU and queue? #184
Comments
Here's the parameterline compatible script which uses the raspberry pi gpu to render videos. keep in mind that you have to change:
Known Problems with this setup: |
That could be a cool plugin/improvement if we can detect GPU. |
a note up front: the script will only work on systems where gstreamer with the omx package is installed. I'm not sure if this is possible for other linux systems, especially the embedded ones.. so detecting the gpu doesn't really help if you can't get hold on gstreamer and omxh264enc. Due to the fact that the avconv.txt script is now parameter compatible to the avconv call from octoprint:
To circumvent errors one can simply check for the System by running: |
@AcidBurns thanks for putting together the avconv.txt wrapper script. I've tested it on my pi2 and it works a treat - much faster encodes and video that looks waaaaaaay better. I opened a tiny pull request that lets octoprint see and manage the mp4 files that get created by the wrapper script. Hope we can get it merged to a release eventually. Would you mind if I included your wrapper script too in the pull request? |
sure you can include it. To my mind the stuff here is GPL V3 CC-by-sa if I read it correctly, so my script would also be; that's why I included my name and email in it. Oh and there's also some changes made to the timelapse stuff after I wrote the wrapper. I think octoprint introduced some kind of "queue processing" which enables to print another print while still rendering the old timelapse without overwriting the "old", still in render process, jpgs. I will have to take a look at this also. |
This seems to choke if the images aren't the same size as set in the video/x-h264 parameters. Removing the width and height constraints seems to fix it and render out at the input image size, at least for me anyway. Trying it out on a raspberry pi 3. |
Hi
PS: I did not use the scripts folder. Thanks! |
Thanks for this! |
Please don't spam. There is no guide. |
Happy new year at first ;)
I got two enhancements for octopi:
The comparison for a ~2h print between the ocotpi standard cpu mpg encoding and the gpu enabled h264/mp4 encoding on a raspberry 2 with 4 threads:
CPU: real 43m42.090s, user 71m38.760s, sys 0m43.810s
GPU: real 02m12.324s, user 01m50.230s, sys 0m5.230s
To render the movies, everything is already installed on octopi, just run this command:
gst-launch-1.0 multifilesrc location=/home/pi/.octoprint/timelapse/tmp/tmp_%05d.jpg index=0 caps="image/jpeg,framerate=(fraction)24/1" ! jpegdec ! queue ! omxh264enc target-bitrate=15000000 control-rate=variable ! video/x-h264,width=1280,height=720,framerate=24/1,profile=high ! h264parse ! mp4mux faststart=true ! filesink location=/home/pi/.octoprint/timelapse/NAME.mp4
The zip also has different containers (avi, mp4, mkv), where mp4 is recommended. avi doesn't display a thumbnail in windows and mkv has 3 seconds blank at the beginng:
scripts.zip
The text was updated successfully, but these errors were encountered: