From 76d9a5f85153f2da9fe888491bc22bde10af89b7 Mon Sep 17 00:00:00 2001 From: cskonopka Date: Thu, 11 Jul 2024 10:50:15 -0400 Subject: [PATCH 1/2] added pickle_juice --- README.md | 2 + config.yaml | 16 +++++++ programs/fever.py | 22 +++++++++ programs/light_snow.py | 20 +++++++++ programs/pickle_juice.py | 20 +++++++++ programs/steel_wash.py | 20 +++++++++ videobeaux.py | 97 ++++++++++++++++++++++++++++++++++------ 7 files changed, 183 insertions(+), 14 deletions(-) create mode 100644 programs/fever.py create mode 100644 programs/light_snow.py create mode 100644 programs/pickle_juice.py create mode 100644 programs/steel_wash.py diff --git a/README.md b/README.md index ed93d5e..ccf256b 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ | nostalgic_stutter | Apply frame stutter akin to a corrupted file | | overexposed_stutter | Apply a frame stutter and exposing the video like the file is corrupted | | overlay_img_pro | Overlay an image with location & dimension control | +| pickle_juice | Apply filter like the video was dipped in pickle juice | | resize | Resizing the dimensions of a video file | | reverse | Reverse video file | | scrolling_pro | Apply video scrolling effect with definable parameters | @@ -31,6 +32,7 @@ | slight_smear | Slightly smearing RGB color space | | speed | Change the video and audio speed of a file | | stack_2x | Stack 2 videos on top of each other keeping the original orientation | +| steel_wash | Apply steel blue filter to video | | stutter_pro | Apply frame stutter effect with definable parameters | | transraibe | AI-based transcription tool | diff --git a/config.yaml b/config.yaml index 7f2f543..5ab6237 100644 --- a/config.yaml +++ b/config.yaml @@ -48,6 +48,10 @@ extract_sound: input_file: 'inputs/input.mp4' output_file: 'outputs/extract_sound.wav' +fever: + input_file: 'inputs/input.mp4' + output_file: 'outputs/fever.mp4' + frame_delay_pro1: input_file: 'inputs/input.mp4' # num_of_frames: "10" @@ -62,6 +66,10 @@ frame_delay_pro2: planes: "7" output_file: 'outputs/frame_delay_pro2.mp4' +light_snow: + input_file: 'inputs/input2.mp4' + output_file: 'outputs/light_snow.mp4' + looper_pro: input_file: 'inputs/input.mp4' loop_count: '3' @@ -100,6 +108,10 @@ overlay_img_pro: overlay_height: "100" output_file: 'outputs/overlay_img_pro.mp4' +pickle_juice: + input_file: 'inputs/input.mp4' + output_file: 'outputs/pickle_juice.mp4' + rb_blur: input_file: 'inputs/input.mp4' output_file: 'outputs/rb_blur.mp4' @@ -143,6 +155,10 @@ stack_2x: input_file2: 'inputs/input.mp4' output_file: 'outputs/stack_2x.mp4' +steel_wash: + input_file: 'inputs/input.mp4' + output_file: 'outputs/steel_wash.mp4' + stutter_pro: input_file: 'inputs/input.mp4' stutter: "233.4" diff --git a/programs/fever.py b/programs/fever.py new file mode 100644 index 0000000..3d5fd5f --- /dev/null +++ b/programs/fever.py @@ -0,0 +1,22 @@ +from utils.ffmpeg_operations import run_ffmpeg_command + +def fever(input_file, output_file): + command = [ + "ffmpeg", + "-i", input_file, + "-filter_complex", "[0:v]shuffleplanes=map1=0:map3=2,smartblur=luma_radius=.6:lr=2.88:luma_strength=0.11:lt=-17:cr=0.93,amplify=radius=1.4:factor=4[out_v]", + "-map", "[out_v]", + "-map", "0:a", + "-c:v", "libx264", + "-profile:v", "high", + "-level:v", "4.2", + "-pix_fmt", "yuv420p", + "-movflags", "+faststart", + "-c:a", "aac", + "-b:a", "128", + output_file + ] + run_ffmpeg_command(command) + print(f"Video processed with fever and file is {output_file}") + +# ffmpeg -i shoe.mp4 -filter_complex "[0:v]shuffleplanes=map1=0:map3=2,smartblur=luma_radius=1.6:lr=2.88:luma_strength=0.11:lt=-17:cr=0.93,amplify=radius=33:factor=4:threshold=10721.12:tolerance=12[out_v]" -map "[out_v]" -map 0:a out.mp4 diff --git a/programs/light_snow.py b/programs/light_snow.py new file mode 100644 index 0000000..1b6a94b --- /dev/null +++ b/programs/light_snow.py @@ -0,0 +1,20 @@ +from utils.ffmpeg_operations import run_ffmpeg_command + +def light_snow(input_file, output_file): + command = [ + "ffmpeg", + "-i", input_file, + "-filter_complex", "[0:v]minterpolate,chromashift=cbh=-5.7:cbv=22:crh=1.44:crv=10.8,deband=1thr=0.45003:2thr=0.48003:3thr=0.21003:4thr=0.30003:range=-1.3:r=16:d=1.69681[out_v]", + "-map", "[out_v]", + "-map", "0:a", + "-c:v", "libx264", + "-profile:v", "high", + "-level:v", "4.2", + "-pix_fmt", "yuv420p", + "-movflags", "+faststart", + "-c:a", "aac", + "-b:a", "128", + output_file + ] + run_ffmpeg_command(command) + print(f"Video processed with light_snow and file is {output_file}") diff --git a/programs/pickle_juice.py b/programs/pickle_juice.py new file mode 100644 index 0000000..aa9d8c8 --- /dev/null +++ b/programs/pickle_juice.py @@ -0,0 +1,20 @@ +from utils.ffmpeg_operations import run_ffmpeg_command + +def pickle_juice(input_file, output_file): + command = [ + "ffmpeg", + "-i", input_file, + "-filter_complex", "[0:v]shear,vibrance=intensity=0.36:rbal=2.94:gbal=3.34:bbal=-3.83:rlum=0.41:glum=0.15:blum=0.28[out_v]", + "-map", "[out_v]", + "-map", "0:a", + "-c:v", "libx264", + "-profile:v", "high", + "-level:v", "4.2", + "-pix_fmt", "yuv420p", + "-movflags", "+faststart", + "-c:a", "aac", + "-b:a", "128", + output_file + ] + run_ffmpeg_command(command) + print(f"Video processed with pickle_juice and file is {output_file}") \ No newline at end of file diff --git a/programs/steel_wash.py b/programs/steel_wash.py new file mode 100644 index 0000000..3ca3dbc --- /dev/null +++ b/programs/steel_wash.py @@ -0,0 +1,20 @@ +from utils.ffmpeg_operations import run_ffmpeg_command + +def steel_wash(input_file, output_file): + command = [ + "ffmpeg", + "-i", input_file, + "-filter_complex", "[0:v]shear,vibrance=intensity=0.36:rbal=2.44:gbal=1.13:bbal=-1.28:rlum=0.69:glum=0.35:blum=0.39[out_v]", + "-map", "[out_v]", + "-map", "0:a", + "-c:v", "libx264", + "-profile:v", "high", + "-level:v", "4.2", + "-pix_fmt", "yuv420p", + "-movflags", "+faststart", + "-c:a", "aac", + "-b:a", "128", + output_file + ] + run_ffmpeg_command(command) + print(f"Video processed with steel_wash and file is {output_file}") \ No newline at end of file diff --git a/videobeaux.py b/videobeaux.py index 4d0c3e4..747628d 100644 --- a/videobeaux.py +++ b/videobeaux.py @@ -5,7 +5,6 @@ from typing_extensions import Annotated import os import calendar - from pathlib import Path from programs import ( @@ -13,13 +12,15 @@ from programs import ( bad_predator, blur_pix, broken_scroll, - convert, + convert, double_cup, download_yt, extract_frames, extract_sound, + fever, frame_delay_pro1, frame_delay_pro2, + light_snow, looper_pro, lsd_feedback, mirror_delay, @@ -27,6 +28,7 @@ from programs import ( num_edits, overexposed_stutter, overlay_img_pro, + pickle_juice, rb_blur, resize, reverse, @@ -34,7 +36,8 @@ from programs import ( silence_xtraction, slight_smear, speed, - stack_2x, + stack_2x, + steel_wash, stutter_pro, transcraibe) @@ -143,6 +146,22 @@ def convert_vb( params = {key: params.get(key) or defaults[key] for key in defaults} convert.convert(**params) +########### +# fever +########### +@app.command('fever', help='Apply fever effect to video.') +def fever_vb( + input_file: str = typer.Argument(None, help="Input video file"), + output_file: str = typer.Argument(None, help="Output video file") +): + params = { + "input_file": input_file, + "output_file": output_file + } + defaults = config['fever'] + params = {key: params.get(key) or defaults[key] for key in defaults} + fever.fever(**params) + ########### # double_cup ########### @@ -252,21 +271,21 @@ def frame_delay_pro2_vb( params = {key: params.get(key) or defaults[key] for key in defaults} frame_delay_pro2.frame_delay_pro2(**params) -################ -# lsd-feedback -################ -@app.command('lsd-feedback', help='Apply LSD feedback effect to video file.') -def lsd_feedback_vb( - input_file: str = typer.Argument(None, help="Input video file "), +########### +# light_snow +########### +@app.command('light_snow', help='Slightly smearing RGB color space.') +def light_snow_vb( + input_file: str = typer.Argument(None, help="Input video file"), output_file: str = typer.Argument(None, help="Output video file") ): params = { - "input_file": input_file, + "input_file": input_file, "output_file": output_file } - defaults = config['lsd_feedback'] + defaults = config['light_snow'] params = {key: params.get(key) or defaults[key] for key in defaults} - lsd_feedback.lsd_feedback(**params) + light_snow.light_snow(**params) ################# # looper-pro @@ -290,6 +309,22 @@ def scrolling_pro_video( params = {key: params.get(key) or defaults[key] for key in defaults} looper_pro.looper_pro(**params) +################ +# lsd-feedback +################ +@app.command('lsd-feedback', help='Apply LSD feedback effect to video file.') +def lsd_feedback_vb( + input_file: str = typer.Argument(None, help="Input video file "), + output_file: str = typer.Argument(None, help="Output video file") +): + params = { + "input_file": input_file, + "output_file": output_file + } + defaults = config['lsd_feedback'] + params = {key: params.get(key) or defaults[key] for key in defaults} + lsd_feedback.lsd_feedback(**params) + ################ # mirror-delay ################ @@ -358,8 +393,9 @@ def overexposed_stutter_vb( params = {key: params.get(key) or defaults[key] for key in defaults} overexposed_stutter.overexposed_stutter(**params) +###################### # overlay_img_pro -#################### +###################### @app.command('overlay-img-pro', help='Overlay an image with location & dimension control.') def overlay_img_pro_vb( input_file: str = typer.Argument(None, help="Input video file "), @@ -383,6 +419,24 @@ def overlay_img_pro_vb( params = {key: params.get(key) or defaults[key] for key in defaults} overlay_img_pro.overlay_img_pro(**params) + + +########## +# pickle_juice +########## +@app.command('pickle_juice', help='Apply filter like the video was dipped in pickle juice.') +def pickle_juice_vb( + input_file: str = typer.Argument(None, help="Input video file"), + output_file: str = typer.Argument(None, help="Output video file"), +): + params = { + "input_file": input_file, + "output_file": output_file + } + defaults = config['pickle_juice'] + params = {key: params.get(key) or defaults[key] for key in defaults} + pickle_juice.pickle_juice(**params) + ########## # rb_blur ########## @@ -480,7 +534,6 @@ def silence_xtraction_vb( params = {key: params.get(key) or defaults[key] for key in defaults} silence_xtraction.silence_xtraction(**params) - ########### # slight_smear ########### @@ -531,6 +584,22 @@ def stack_2x_vb( params = {key: params.get(key) or defaults[key] for key in defaults} stack_2x.stack_2x(**params) +############ +# steel_wash +############ +@app.command('steel_wash', help='Apply steel blue filter to video.') +def steel_wash_vb( + input_file: str = typer.Argument(None, help="Input video file 1"), + output_file: str = typer.Argument(None, help="Output video file") +): + params = { + "input_file": input_file, + "output_file": output_file + } + defaults = config['steel_wash'] + params = {key: params.get(key) or defaults[key] for key in defaults} + steel_wash.steel_wash(**params) + ############### # stutter-pro ############### From c9f98252f2b11a22cc62d9462f05c26274caec97 Mon Sep 17 00:00:00 2001 From: cskonopka Date: Thu, 11 Jul 2024 10:50:36 -0400 Subject: [PATCH 2/2] added pickle_juice again --- programs/steel_wash.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/programs/steel_wash.py b/programs/steel_wash.py index 3ca3dbc..1914503 100644 --- a/programs/steel_wash.py +++ b/programs/steel_wash.py @@ -17,4 +17,6 @@ def steel_wash(input_file, output_file): output_file ] run_ffmpeg_command(command) - print(f"Video processed with steel_wash and file is {output_file}") \ No newline at end of file + print(f"Video processed with steel_wash and file is {output_file}") + +# hello \ No newline at end of file