Commit Graph
109 Commits
Author SHA1 Message Date
Jedrzej Kosinski fb1879aca6 fixed Load Video (Upload) ID mismatch for name 2023-10-20 09:21:09 -05:00
Jedrzej Kosinski 9e834b4f58 Fixed ID of Load Video (Upload) node getting screwed up in PR 2023-10-20 09:16:17 -05:00
Jedrzej Kosinski a5c5556f8d Merge pull request #28 from kijai/main
Fix video autoplay...
2023-10-20 07:38:42 -05:00
kijai f705532da5 Update gif_preview.js 2023-10-20 15:38:33 +03:00
kijai 18f15ef6ca Fix video autoplay...
Video element never calls the onload function, I didn't figure out why... so just moved it out of it to restore functionality.
2023-10-20 15:30:04 +03:00
Jedrzej Kosinski 72340a31d2 Reordered nodes, updated names, added temp workaround for get_ffmpeg_exe bug, clarified Video Info outputs 2023-10-20 04:57:25 -05:00
Jedrzej Kosinski b2c4b4a5ac Merge pull request #21 from kijai/main
Sync gifs too
2023-10-20 04:53:16 -05:00
kijai fda9ffd0df Merge remote-tracking branch 'upstream/main' 2023-10-20 12:50:44 +03:00
Jedrzej Kosinski f032b046af Merge pull request #25 from JaredTherriault/main
UploadVideo, gif preview autoplay fix, VideoInfo out from LoadVideo, …
2023-10-20 04:35:02 -05:00
JaredTherriault 9306e62e0a Restore VHS_LoadVideoPath and VHS_LoadVideoUpload, update to parity with VHS_UploadVideo
-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
2023-10-17 19:49:01 -07:00
JaredTherriault ba7bc35390 UploadVideo, gif preview autoplay fix, VideoInfo out from LoadVideo, support webp, apng, mjpeg
-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
2023-10-16 21:31:32 -07:00
kijai 05cd93de4e Update gif_preview.js
make it select by id instead to not affect possible other elements
2023-10-12 19:18:10 +03:00
kijai a8470de02e Sync gifs too
gif elemenets weren't being reset with the sync button, made it reload all gifs for same effect
2023-10-12 19:02:31 +03:00
Jedrzej Kosinski 8f10981d32 Merge pull request #15 from kijai/main
Add preview video playback syncing
2023-10-12 05:41:11 -05:00
Jedrzej Kosinski 8cb7a57a95 Merge pull request #18 from Kosinkadink/develop
Merge multiple PRs (+ edits) into master
2023-10-12 05:39:32 -05:00
Jedrzej Kosinski f8f667fb27 added select_every_nth to Load Video nodes, allow quotes around Load Video (Path) video 2023-10-12 05:21:44 -05:00
Jedrzej Kosinski dcb851d581 created Path versions of Load Video and Load Images nodes 2023-10-10 04:40:17 -05:00
Jedrzej Kosinski 65097075cb Merge pull request #16 from Kosinkadink/loadvideo_improvements
Merge Loadvideo improvements into develop so can be edited before main merge
2023-10-09 15:29:56 -05:00
kijai 00f0981763 Add preview video playback syncing
- Syncs the videos on new video creation
- Adds button to force the sync and reset playback time of all video previews
2023-10-05 22:49:48 +03:00
Austin Mroz 1c09f747a2 Fix compatibility with older ffmpeg versions
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
2023-10-01 21:01:37 -05:00
Austin Mroz c9dc1548a8 Rewrite backend pathing, improve error messages
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
2023-10-01 20:42:38 -05:00
Austin Mroz fba6488011 Fix Load Video giving superfluous frames, rouding
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
2023-10-01 19:51:20 -05:00
AustinMroz 8d775cd762 Merge pull request #8 from Fannovel16/auto-down-ffmpeg
Add automatic ffmpeg downloading
2023-09-30 01:47:05 -05:00
Hacker 17082006 2a7e4dcfc0 Register folder_names_and_paths 2023-09-30 13:18:37 +07:00
Hacker 17082006 e6df961d6c In case ffmpeg from imageio can't be found 2023-09-29 20:56:33 +07:00
Hacker 17082006 2988fceaba Add automatic ffmpeg downloading 2023-09-29 20:48:28 +07:00
Jedrzej Kosinski 3c3061cb00 fixed Load Video IS_CHANGED args 2023-09-29 06:33:38 -05:00
Jedrzej Kosinski 41d1e8158a Merge pull request #5 from Kosinkadink/cv_loadvideo
CV LoadVideo + other small things
2023-09-29 00:01:45 -05:00
Jedrzej Kosinski 4830f195c3 Merge branch 'main' into cv_loadvideo 2023-09-29 00:01:11 -05:00
Jedrzej Kosinski e31b33816d Merge pull request #6 from Kosinkadink/image_latent_batch_nodes
Added merge, split, select_every_nth, and Load Images nodes
2023-09-28 23:58:26 -05:00
Jedrzej Kosinski 376516b48e added Duplicate Latent/Image Batch nodes 2023-09-28 23:55:11 -05:00
Jedrzej Kosinski d8446656fd Load Images now properly combines input directory with uploaded directory name 2023-09-28 23:04:27 -05:00
Austin Mroz 46b2e67a68 Implement folder upload 2023-09-27 15:56:51 -05:00
Jedrzej Kosinski a143fc0685 added Count nodes 2023-09-27 14:29:56 -05:00
Austin Mroz e1443b9cef Add upload button to Load Video 2023-09-27 03:16:23 -05:00
Jedrzej Kosinski 9fa5e37e20 added extension-checking code to get_sorted_dir_files_from_directory 2023-09-27 02:56:04 -05:00
Jedrzej Kosinski 99babcf489 added merge, split, select_every_nth, and Load Images nodes 2023-09-27 02:05:10 -05:00
Austin Mroz a90149d57a Count skip_first_frames after frame rate calc
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
2023-09-27 01:59:31 -05:00
Austin Mroz cb9204894f Fixes to ffmpeg frame selection, fallback logic
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.
2023-09-26 23:10:57 -05:00
Austin Mroz 3696067589 Numerous improvements to Load Video
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
2023-09-26 22:12:50 -05:00
Jedrzej Kosinski 5c51dd3b6d changed LoadVideo node to use cv to support frame_load_cap and skip_first_frames + additional formats, added frame_count output, changed visual appearance of nodes to make it clear what custom nodes they are part of 2023-09-26 19:53:35 -05:00
AustinMroz 7ec746580c Merge pull request #4 from sdbds/main
fix decode for Japanese or Chinese
2023-09-26 14:49:18 -05:00
青龍聖者@bdsqlsz d1a10b4d4c fix decode for Japanese or Chinese 2023-09-27 02:08:04 +08:00
Austin Mroz c9e6c07997 Set rate limit by video filter, fix size regex
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.
2023-09-26 01:42:47 -05:00
Austin Mroz 2d2d2521e2 Fix width/height order of tensor in load video
Update element name in animation preview code.
2023-09-25 22:36:04 -05:00
Austin Mroz a8498d4c43 Add options for frame, rate size on Load Video
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)
2023-09-25 19:36:53 -05:00
Austin Mroz d9ba631028 Backend implementation for Load Video 2023-09-24 20:55:19 -05:00
Austin Mroz 81b7f1fede Only warn about missing ffmpeg once. 2023-09-24 20:55:19 -05:00
AustinMroz 32f4b39ce4 Merge pull request #2 from Kosinkadink/migrated_code
Migrated code
2023-09-24 16:24:06 -05:00
Austin Mroz 278fb3c4a6 Cleanup and migration
Removed uneeded AnimateDiff nodes
Add scaffolding
Modify names
2023-09-23 19:50:05 -05:00