mirror of
https://github.com/hanzoai/Hanzo-VideoHelper.git
synced 2026-10-30 18:50:51 +00:00
There were still intermittent errors and console spam from a transcoded advanced preview being interrupted before it could finish.Connection errors are also caught now. ffmpeg does not appear to handle transparency as expected for gif creation. Transparent areas will show the previous frame, or a portion of it. A deep dive into trying to find configuration options to fix this did not result in solutions that functioned on my machine, but did introduce me to the ffmpeg split filter. Split allows for a single ffmpeg execution to generate a palette and utilize the palette for creating the output gif without requiring a temp file. However, the video data must be buffered in memory by ffmpeg. Quick testing seems to show that ffmpeg uses 4 bytes per pixel of buffered frame data. The ramifications for memory usage are nuanced, but wind up preferable. The increased memory per pixel of ffmpeg's buffering only results in (approximated) 3% memory increase over the whole workflow, but remove the need for a tempfile, a second subprocess call, and allow for imperfect Meta Batch support which can only extend the total frame count by 5-6x. It's a reduction in moving parts for underwhelming memory characteristics in both the best and worst case. Additionally, it likely actually addresses the issue the original requester saw in #160 The actual code for allowing pre-passes is left in for now and will likely be re-evaluated for other uses or pruned at a later time. Actually bump version.
9 lines
366 B
JSON
9 lines
366 B
JSON
{
|
|
"main_pass":
|
|
[
|
|
"-n",
|
|
"-filter_complex", ["dither", ["bayer", "heckbert", "floyd_steinberg", "sierra2", "sierra2_4a", "sierra3", "burkes", "atkinson", "none"], {"default": "sierra2_4a"}, "[0:v] split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse=dither=$val"]
|
|
],
|
|
"extension": "gif"
|
|
}
|