Commit Graph
21 Commits
Author SHA1 Message Date
Austin Mroz 8f8df32db1 Add additional format options for transparency
Updated ProRes to allow transparent output when set to Profile 4. As
part of this change, pix_fmt is no longer explicitly set for ProRes, but
the expected format is automatically applied from for each profile.

Added rgba as an output pix_fmt for the nvenc formats. These have not
been tested and may not function.

Fix incorrect escape in Advanced Preview code.
2024-07-31 02:19:27 -05:00
Austin Mroz b5d907bade WIP preview synchronization 2024-07-10 12:57:06 -05:00
Austin Mroz 659ba661de Fix size scaling, Load Images preview, add 8bitpng
On Load Video, Size scaling had a major rewrite to support different
downscale ratios, but logic was flawed. This has been fixed

Image Sequence previews were broken by adding a framerate arg since the
input is a sequence file and not the images themself. This could be
added later by adding the speed information to the sequence file, but
has been removed for now since there isn't any infrastructure to set the
frame rate on the Load Images node itself

Added an 8bit-png output format. Lots of people seem to prefer
outputting image sequences. When the extra quality isn't required,
having a separate 8bit format allows for a significant speedup and less
disk space used.
2024-06-24 12:13:26 -05:00
Austin Mroz b70a173d5e Reduce console spam, ffmpeg_gif split filter
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.
2024-06-07 00:38:34 -05:00
Austin Mroz 9d48b51a26 Merge branch for ffmpeg-gifs
While I have no repro on the reported issue for this branch, I feel
merging it is the best path forward for getting information and ensuring
the added functionality of the branch doesn't stagnate forever

Minor tweaks are made to wrangle input.
2024-05-29 04:10:39 -05:00
Austin Mroz f06d0fe0a5 Rework Gifski support
Gifski added support for input from pipes about a month ago, but I only
learned of this today.

The implementation was due for a rework, and brings numerous advantages:
- Gifski no longer needs to be compiled with ffmpeg support
- Gifski output now supports Meta Batches
- A temp file is no longer required
- The simplified intermediary format should increase performance/quality

This will require a recently updated version of gifski and there is not
currently code in place to notify the user of this.
2024-05-21 16:10:57 -05:00
Austin Mroz 0391ddfed3 Implement format templates, pre_pass, ffmpeg gifs
Adds supoort for an ffmpeg gif output.
Resolves #160

Adds support for a pre_pass field in video formats which can be used for
other advanced encoding formats

Adds support for string templates in format widgets

Known issues:
Gif output requires a complex filtergraph. This makes it incompatible
with the loop count setting. The error message for this is not the
clearest currently and will need further investigation.
2024-02-24 15:26:39 -06:00
Austin Mroz a2900c3273 Add support for Gifski ouput
Adds support for a gifski_pass in video_formats and a gifski format
which utilizes it. Resolves #79

Much consideration was put into how best to implement this. Gifski does
not support piped input, and implementing such functionality is
infeasible as the ffmpeg library used by Gifski requires inputs be
physical files. Consequentially, an intermediate file of some sort is
required. While an implementation that would not require a prior ffmpeg
pass was investigated, the only viable intermediary format
between Pillow and Gifski's ffmpeg decoder is an animated png and gifski
will never pass this png to it's ffmpeg decoder as it sees the png
header and instead interprets the file as a single frame image.
2024-02-07 12:03:26 -06:00
Austin Mroz cf343e0a9d Add 16bit-png format. Support sequence file paths
Add a 16bit-png video_format which supports output transparency. Other
formats could be updated for similar capabilities, but are likely to
have issues with device support and unlikely to see widespread adoption.

Modifies the preview server code to properly parse and check for the
existence of sequence filenames.
2024-01-13 17:56:00 -06:00
Isaac Emesowum 1318b08a32 Add h264_nvenc, hevc_nvenc (NVIDIA) hw encoding
In Video Combine, libx264 may crash with 1000+ input images.

To avoid the crash, add hardware encoding supported by NVIDIA GPUs.

Add bitrate option which precludes crf.
Add megabit option, which so the user may specify bitrate in Mb or Kb.
Add hvc1 video tag, for better support on with Apple quicktime - to hevc_nvenc and libx265 video formats.
    This allows previews to show up in Safari too.

Add *.swp to .gitignore.
2024-01-02 18:04:31 -05:00
Austin Mroz 9193868907 Revert metadata toggle, logging, round ints
The toggle for saving metadata has been changed back to a boolean
instead of a combo. While I wished to provide for future compatibility,
the change broke existing workflows and there was no accommodating
implementation to load metadata saved under a different tag.

The log level for ffmpeg preview processes has been raised to fatal.
There's a good chance this will make debugging harder for users when
errors arise, but aborted requests were too common for the error
messages produced by them to be acceptable.

Format widgets for ints are now properly rounded.
2023-12-03 12:36:41 -06:00
Austin Mroz 19a84ddf72 Yet further fixes
Add "-b:v" flag to webm format, resolves #78

Fixes Video Combine to provide an output usable outside the ui,
a list of files produced, resolves #57

Fix error in file path safety checks across drives on windows

Fixes for preview generation when backing file has audio

Don't scale video previews above their base resolution

Implement select_every_nth for advanced previews

Fix regression with improper callback checking on Load Audio

Reorder Load Audio in node mappings to not be grouped with image nodes
2023-12-01 14:43:20 -06:00
Austin Mroz a1ee051238 Further cleanup
save_metadata is now a format flag
- This allows saving to different tag and hides for image formats

Implement high bit depth support
- Disabled by default, but works for images and has shown in testing to
  produce objectively higher quality output than base Save Image

Fix target_size from load video not applying when 2 dimensions are set
When an input video is scaled to a new aspect ratio, it is now cropped
Removed try wrapping of load video nodes. This creates more confusion
now a system of fallbacks isn't used

A fix for parsing format_widgets when applied outside a '_pass'

Fixed missing import of logger in utils

Animated images are now included in the animated preview code
- This improves performance and allows for pausing

Cleaned up injection of code to load metadata
2023-11-30 17:40:57 -06:00
Austin Mroz e8e6971eaf Merge branch 'format_widgets' into develop 2023-11-29 20:43:25 -06:00
Austin Mroz d0ddff7391 Numerous audio improvements
Audio settings are now stored in video_formats
Updated video_formats with reasonable defaults for audio
A Load Audio (Path) node has been added
Audio Loads are cached with load state and only occur once.
2023-11-26 22:30:33 -06:00
Austin Mroz 9fd996ead3 Fix server-side prompt parsing, debugging.
While having the optional arguments passed is non-trivial, there's an
easy fix to get retrieve all params sent from the client.

Substantial changes to how formats are stored on the backend to ensure
that the extra data isn't displayed in the dropdown list or upon
clicking the "Refresh" button in the ui.

Update most existing existing formats to expose options as widgets
2023-11-22 00:04:58 -06:00
Jedrzej Kosinski 8841506a81 Rolled back h264 and webm -pix_fmt due to too many issues (at least with h264, not sure about webm, rolled back just in case) 2023-11-18 17:35:43 -06:00
zhangsongbo d36f61ff46 upgrade the video formats. 2023-11-15 17:54:10 +08:00
Austin Mroz 9ed20235c3 Support ProRes as an output video_format 2023-11-03 12:12:59 -05:00
FizzleDorf b668935c45 exposed crf value for user input 2023-10-31 21:55:35 -04:00
Austin Mroz 7671c680ff Add additional video formats and config system
Allows for ffmpeg output settings to be set from a series of json config
files stored in video_formats. This allows for higher quality
output files with newer codecs (like av1), while still ensuring
compatibility with older ffmpeg versions

In addition to these changes, the logging of ffmpeg is better handled.
Error messages from ffmpeg itself are printed and logging from encoders
that was improperly filtered have been individually addressed.

While h265 has been included, most browsers will be unable to display
the resulting video.
2023-09-18 15:52:52 -05:00