Search - User list
Full Version: Export Animated gif with Image Magick and FFMPEG TOP nodes
Root » PDG/TOPs » Export Animated gif with Image Magick and FFMPEG TOP nodes
wlvl
Hello from 2020!
in the era of ImageMagick and FFmpeg integrated in Houdini's TOP, generating our beloved gif should be pretty straight forward.

But, there is something I must be missing.
I am not able to export gif correctly neither using FFMpeg Encode Video TOP nor ImageMagick.

Could you please point me in the right direction?
Below some test and results of my research



TEST 1 - IMAGE MAGICK

1A - gif from image sequence (ROP fetch > IM gif)
2A - gif from mp4 ( rop fetch > ffmpeg to mp4 > IM to gif)


1A - gif is created but seems like the frames are overwriting each other rather than appending in sequence
tried with output file tag file/video and file/image
2A - errors: there are no input images






TEST 2 - FFMPEG ENCODE VIDEO

Getting these errors in the log:
Codec AVOption apply_trc (color transfer characteristics to apply to EXR linear input) specified for input file #0 ([i]"path to framelist"[/i]) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some decoder which was not actually used for any stream.

GIF muxer supports only a single video GIF stream.
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 -- 
Conversion failed!









Conversation about animated gif:

https://www.sidefx.com/forum/topic/46690/# [www.sidefx.com]

Mestela's Tokeru on ImageMagick and FFMPEG commands:
http://www.tokeru.com/cgwiki/index.php?title=GeneralUtilties#Gifs [www.tokeru.com]
(I have tried these in the command line of IM / FFMPEG tops, no luck)



https://forums.odforce.net/topic/33138-some-looping-rnd-animations/?do=findComment&comment=191821 [forums.odforce.net]
iFightForTheUser posted this code for FFMPEG:

convert-to-GIF(){
    for ARG in $@; do
        file=$ARG
        file_name=${file%.*}
        palette="/tmp/palette.png"
        ffmpeg -y -i $file -vf fps=10,scale=500:-1:flags=lanczos,palettegen $palette
        ffmpeg    -i $file -i $palette -filter_complex "fps=10,scale=500:-1:flags=lanczos[x];[x][1:v]paletteuse" $file_name.gif
    done
    }

not sure how to implement this correctly in the command line.




I am having trouble sending a hip file atm, will do asap if helpful.
TAGs: export animated gif from houdini using ffmpeg image magick TOP PDG nodes. gif conversion. gif output.
BrookeA
I've attached a .hip file that demonstrates how to configure the FFmpeg node to create a gif from a series of images. You will need a more recent version of Houdini 18.0 as it uses the updated FFmpeg nodes. I will file an RFE to add a preset to the FFmpeg node for creating a gif.

Let me know if you have any other questions.
NagaPavan
BrandonA
I've attached a .hip file that demonstrates how to configure the FFmpeg node to create a gif from a series of images. You will need a more recent version of Houdini 18.0 as it uses the updated FFmpeg nodes. I will file an RFE to add a preset to the FFmpeg node for creating a gif.

Let me know if you have any other questions.
Hi I am trying to export gif from flipbooks using the FFmpeg mp4 output so by wirting extension as .gif, output is giving lower quality and lower size gif with jpeg option while
with png option it is output full quality as filp book but far large size gifs like 60mb for 120 frames,
any suggestions to reduce the size while keeping the quality
benC
Naga Pavan
BrandonA
I've attached a .hip file that demonstrates how to configure the FFmpeg node to create a gif from a series of images. You will need a more recent version of Houdini 18.0 as it uses the updated FFmpeg nodes. I will file an RFE to add a preset to the FFmpeg node for creating a gif.

Let me know if you have any other questions.
Hi I am trying to export gif from flipbooks using the FFmpeg mp4 output so by wirting extension as .gif, output is giving lower quality and lower size gif with jpeg option while
with png option it is output full quality as filp book but far large size gifs like 60mb for 120 frames,
any suggestions to reduce the size while keeping the quality

https://www.tokeru.com/cgwiki/index.php?title=GeneralUtilties#Gifs [www.tokeru.com]
https://engineering.giphy.com/how-to-make-gifs-with-ffmpeg/ [engineering.giphy.com]
These are good guides on reducing the gif sizes
This process involes generating a palatte before the gif so it only keeps minimal number of color in the gif. I haven't try it in TOPS before but it should work with custom commands in two ffmpeg nodes.
mhspadez
BrandonA
I've attached a .hip file that demonstrates how to configure the FFmpeg node to create a gif from a series of images. You will need a more recent version of Houdini 18.0 as it uses the updated FFmpeg nodes. I will file an RFE to add a preset to the FFmpeg node for creating a gif.

Let me know if you have any other questions.


So I have a project where I'm using tops to create image sequences each in their own folders which changes using a wedge node. I'd love to use tops to also create a gif of that image sequence. I'm a little bit confused on the ffmpeg node and how to tell it to do this. I saw your example file, and it does technically create gifs of my images, but I don't know how to attach it properly or maybe how to generate the correct frame file list so that it does what I want. If I just connect it to my tops tree after the rop fetch I'm using to generate the sequences it just creates a gif per frame instead of a gif per sequence. Would anyone be able to help me out?


UPDATE: I was able to get this to kind of work by using a "wait for all" node in between the fetch and the ffmpeg nodes. Not fully working, 30% of my gifs failed, but this is looking promising at least
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB