-Restore original name of 'VHS_LoadVideo' to 'VHS_LoadVideoPath'
-Restore LoadVideoUpload and bring its features up to parity with LoadVideoPath and UploadVideo
-Rename 'input' and 'effective' variables to 'original' and 'actual'
-Add guard clause for undefined video widget value
-Add PIL fallback to LoadVideo to support video types not supported by opencv2, such as webp, apng, and mjpeg. Changing frame rate is not supported in this mode. The output log will inform you of this when the fallback is used.
-Removed VHS_LoadVideoUpload node
-Renamed VHS_LoadVideoPath to just VHS_LoadVideo
-Added a video_info output to LoadVideo which includes more information, such as the frame count, fps, duration and frame time for the input video and the output frames
-Added a new node UploadVideo which includes the functionality of LoadVideoUpload insofar as copying a video to the input folder but also allows the user to upload to temp instead for testing so as not to clutter the input folder. Uploaded videos now go to a subfolder, 'VHS_upload'.
-Added gif preview to UploadVideo so uploaded videos can be viewed on the node when selected.
-Fixed autoplay for gif preview on VideoCombine, still not working for videos on UploadVideo node.
-Added drag and drop for videos on UploadVideo node.
-Changed 'force_frame_rate' to 'desired_frame_rate' because it cannot be forced in PIL fallback, this is an effort to communicate this to the user
Older versions of ffmpeg (including the one bundled with imageio)
lack the -fps_mode flag. The code has been switched to use the
deprecated equivalent form for this: vsync 2
The backend which is tried first can be set with VHS_PREFERRED_BACKEND
For loadvideo, the backends are tried in order, starting with preferred
A proper error message (No frames generated) is returned instead of a
cryptic error from numpy about failing to cat/stack
Duplicate error messages are suppressed
Instead of a second select video filter, the frame cap is enforced with
-frames:v. This prevents the unusual output and provides the desired
performance benefits
When a frame rate is forced, neither path would return the first input
frame as the first output frame. ffmpeg would return the middlemost
frame from that time window and the opencv code would return the latest.
Both have been adjusted to return the earliest valid frame, but an off
by one error seems to remain resulting in more correct output from
opencv
After this change, skip_first_frames can be used as an accurate offset
into the returned frames, but can no longer be used to select a starting
time point independent of a forced frame rate.
This makes it easier and more intuitive to change under standard use
cases, and users seeking an exact start time can just trim the
video with external tools
Frames for skip_first_frames and frame_load_cap are chosen with select
video filters. This improves performance, removes inconsistencies of the
starting frame changing with target frame rate, and prevents errors
about broken pipes.
ffmpeg is used as a default and opencv is swapped to if an error occurs
This includes decoding gifs with ffmpeg, but it should still fallback
to opencv if errors are observed
Actually use the looked-up path for ffmpeg commands. This is unlikely to
make a difference at present, but is likely to be important if ffmpeg is
ever bundled.
force_rate and force_size have been implemented for the opencv
implementation.
skip_first_frames and frame_load_cap have been implemented for ffmpeg
When resizing, round to the nearest multiple of 8
In addition to latent encoding requiring multiples of 8, Av1 decoding
requires multiples of two. Currently, this results in minor changes in
aspect ratio.
VALIDATE_INPUTS now only checks the video arg
Setting fps through the rate flag was giving unreliable results, so the
implementation is swapped to use the fps video filter instead which is
giving exactly the expected number in testing.
A test video had additional size information within the comma separated
group. The regex to detect size has been loosened to account for this.
Both are conveneice options to work towards the end goal of users not
needing to understanding video formats or preprocessing.
Frame rate may need some more tweaking. The quick tests I performed was
giving unexpected numerical output. (an input of 32 frames at 8 fps gave
18 frames when the target frame rate was 4)