Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have Clippi remove black frames in videos #165

Open
TheJaredWilcurt opened this issue Mar 4, 2023 · 3 comments
Open

Have Clippi remove black frames in videos #165

TheJaredWilcurt opened this issue Mar 4, 2023 · 3 comments

Comments

@TheJaredWilcurt
Copy link

Clippi makes the combo JSON, Dolphin plays it back, and OBS records the playback. Makes sense, but Dolphin needs to take time to load up the stage and playback between each clip. So the recording will have black frames that need to be manually removed. FFMPEG can remove these automatically, but is too complex for most users to do without a GUI.

Resources:

  • ffmpeg in.mp4 -vf mpdecimate,setpts=N/FRAME_RATE/TB -an out.mp4
    • This detects any frame that is identical to the previous frame, then removes all except one. So it would leave behind 1 black frame.
    • source
  • ffmpeg -i in.mp4 -vf blackframe=0,metadata=select:key=lavfi.blackframe.pblack:value=50:function=less -vsync cfr -c:a copy out.mp4
    • This would replace a black frame with the contents of the previous frame
    • source

Combining these two would probably work, but if you looked into FFMPEG's CLI switches documentation there is probably a simpler approach that just removes all black frames entirely in one go.

This would be a nice tool to add in to the sidebar in Clippi to save people time. Ultimately a good compilation will have good editing to chop out the boring bits and reorganize the action to be in a better order, but no matter what, EVERYONE will want the black frames removed, and it would be nice to build that tool in.

Note: FFMPEG has weird licensing. You'll need to have the user opt-in to downloading it themselves. Either by telling Clippi where it is located on disk, or by clicking a button in Clippi that automatically downlaods FFMPEG into Clippi's folder (this is what ScreenToGif and many other tools do).

@TheJaredWilcurt
Copy link
Author

TheJaredWilcurt commented Mar 4, 2023

This would also open the door for other video automations. For example. It would be nice to just point to a video as an input, a folder as an output, click a button and it splits it up into a bunch of clips based on black frames, then removes the black frames from each clip. Then you could just drag them into a time line in Resolve, reorder them, and tighten them up. Would make the process really efficient and painless.

@TheJaredWilcurt
Copy link
Author

I realize I've proposed a solution instead of explaining the need (fundamental UX error).

My ideal tool would take the clips that Clippi has found, then generate separate video files for each clip with file names like:

  • TheJaredWilcurt (Samus) vs SomeGuy (Fox) on FoD (some time stamp).mp4
  • TheJaredWilcurt (Samus) vs SomeGuy (Falco) on FD (some time stamp).mp4
  • TheJaredWilcurt (Samus) vs SomeGuy (Sheik) on DL (some time stamp).mp4
  • TheJaredWilcurt (Samus) vs SomeGuy (Dr. Mario) on PS (some time stamp).mp4
  • TheJaredWilcurt (Samus) vs SomeGuy (Captain Falcon) on YS (some time stamp).mp4

Those video files would not have any dead frames at the start or end. So they could be reviewed, deleted, sorted, posted directly to social media, or dragged into a time line in a video editor.

@vinceau
Copy link
Owner

vinceau commented Mar 7, 2023

Have you followed this replay guide? If you have pausing enabled in OBS it should be able to record your videos without the black frames in between.

If you want to have all your indivual clips recorded separately you can also do that by clicking record as separate clips. If you want the MP4 files to also have the same name as the SLP you can also enable this experimental setting under Playback (assuming you've already renamed all your SLP files beforehand):

Screenshot 2023-03-07 at 13 13 18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants