4 Commits

Author SHA1 Message Date
Akash Bora
5296b793b6 Update Readme.md 2024-10-10 13:50:45 +05:30
Akash Bora
7c7905394b Update Readme.md 2024-10-10 13:50:24 +05:30
Akash Bora
90f22f9d05 new classic mode added 2024-10-10 13:40:49 +05:30
Akash Bora
a7b7afa8ac Add files via upload 2024-10-10 13:40:19 +05:30
3 changed files with 45 additions and 9 deletions

View File

@@ -0,0 +1,28 @@
#Author: Akash Bora
def Datamosh(filename,outfile,s,e,fps):
def mosh_iframe_removal():
for index, frame in enumerate(frames):
if index < start_frame or end_frame < index or frame[5:8] != iframe:
out_file.write(frame_start + frame)
start_frame = s
end_frame = e
if end_frame==1:
end_frame=1000
input_avi = filename
in_file = open(input_avi, 'rb')
output_avi= outfile
in_file_bytes = in_file.read()
out_file = open(output_avi, 'wb')
frame_start = bytes.fromhex('30306463')
frames = in_file_bytes.split(frame_start)
out_file.write(frames[0])
frames = frames[1:]
iframe = bytes.fromhex('0001B0')
pframe = bytes.fromhex('0001B6')
n_video_frames = len([frame for frame in frames if frame[5:8] == iframe or frame[5:8] == pframe])
if end_frame < 0:
end_frame = n_video_frames
mosh_iframe_removal()
in_file.close()
out_file.close()

View File

@@ -1,10 +1,10 @@
"""
DATAMOSHER PRO Py version 2.2
DATAMOSHER PRO Py version 2.3
Author: Akash Bora (Akascape)
License: MIT | Copyright (c) 2024 Akash Bora
"""
currentversion = 2.2
currentversion = 2.3
#Import installed modules
import tkinter
@@ -26,7 +26,7 @@ from PIL import Image, ImageTk
#Import the local datamosh library
from DatamoshLib.Tomato import tomato
from DatamoshLib.Original import classic, repeat, pymodes
from DatamoshLib.Original import classic, repeat, pymodes, classic_new
from DatamoshLib.FFG_effects import basic_modes, external_script
# get full base path
@@ -63,7 +63,7 @@ ffmpeg = imageio_ffmpeg.get_ffmpeg_exe()
#Effect List
modelist = sorted(["Bloom", "Invert", "Jiggle", "Overlap", "Pulse", "Reverse",
"Random", "Classic", "Glide", "Sort", "Echo", "Void",
"Random", "Classic", "Classic2", "Glide", "Sort", "Echo", "Void",
"Fluid", "Stretch", "Motion Transfer", "Repeat", "Shear", "Delay", "Sink",
"Mirror", "Vibrate", "Slam Zoom", "Zoom","Invert-Reverse", "Shift",
"Noise", "Stop", "Buffer", "Slice", "Shuffle", "Rise", "Custom Script",
@@ -666,6 +666,11 @@ def dynamic():
showwidgets=[rangeslider, pdelta]
u=1
mode_type.configure(text="Mode Type: FFmpeg")
elif (current=="Classic2"):
showwidgets=[rangeslider2]
u=1
mode_type.configure(text="Mode Type: FFmpeg")
elif (current=="Glide"):
showwidgets=[pdelta]
@@ -799,7 +804,7 @@ def do_the_mosh():
ProcessLabel.configure(text='STEP 3/3 FIXING THE CORRUPTED FILE...')
ffmpeg_convert(mfile,param,sfile)
os.remove(mfile)
elif ((current=="Classic") or (current=="Repeat") or (current=="Glide") or (current=="Sort") or (current=="Echo")):
elif ((current=="Classic") or (current=="Classic2") or (current=="Repeat") or (current=="Glide") or (current=="Sort") or (current=="Echo")):
if not changed:
param = "-bf 0 -b 10000k" # Default ffmpeg parameter for the above modes
ifile = sfile[:-4]+".avi"
@@ -808,6 +813,8 @@ def do_the_mosh():
mfile = sfile[:-4]+"_corrupted.avi"
if current=="Classic":
classic.Datamosh(ifile, mfile,s=int(start_mosh.get()),e=int(end_mosh.get()),p=int(varp.get()), fps=vid.get_meta_data()['fps'])
elif current=="Classic2":
classic_new.Datamosh(ifile, mfile, s=int(start_frame_mosh.get()), e=int(end_frame_mosh.get()), fps=vid.get_meta_data()['fps'])
elif current=="Repeat":
repeat.Datamosh(ifile, mfile, s=int(start_frame_mosh.get()), e=int(end_frame_mosh.get()),
p=int(varp.get()), fps=vid.get_meta_data()['fps'])
@@ -876,7 +883,7 @@ def do_the_mosh():
#Check the result and complete the task
if os.path.exists(sfile):
messagebox.showinfo("Exported!", "File exported successfully, \nFile Location: " +str(sfile))
res = messagebox.showinfo("Exported!", "File exported successfully, \nFile Location: " +str(sfile))
ProcessLabel.configure(text="Last used: "+last_used)
try: os.startfile(sfile)
except: pass

View File

@@ -17,7 +17,7 @@ Then I found some scripts and algorithms available for datamoshing which gives a
### <p align='center'> WINDOWS VERSION ⚡
<br> <p align='center'> [<img src="https://img.shields.io/badge/WINDOWS-DATAMOSHER_PRO-informational?&logo=Microsoft&logoColor=blue&color=007ec6" width="500">](https://akascape.gumroad.com/l/Datamosher-Pro) </br>
### <p align='center'> FREE SOURCE CODE VERSION 🔻
<br> <p align='center'> [<img src="https://img.shields.io/badge/Python_Version-informational?style=flat&logo=python&logoColor=blue&color=eaea4a" width=300 height=50>](https://github.com/Akascape/Datamosher-Pro/releases/download/Datamosher_Prov2.2/Datamosher-Pro_python-version_2.2.zip) <br> Don't forget to leave a ⭐ </p>
<br> <p align='center'> [<img src="https://img.shields.io/badge/Python_Version-informational?style=flat&logo=python&logoColor=blue&color=eaea4a" width=300 height=50>](https://github.com/Akascape/Datamosher-Pro/releases/download/Datamosher_Prov2.3/Datamosher-Pro_python-version_2.3.zip) <br> Don't forget to leave a ⭐ </p>
# Installation? ⚙️
- For the window version, just extract the downloaded zip file and run the "Datamosher Pro.exe" application.
@@ -48,6 +48,7 @@ Find more Examples and Tutorial Videos here 👇
| ----------------| --------------------------------------------------------------------- |
| Void | gives the standard datamosh cuts based on video vectors (automatic i-frame removal) |
| Classic | gives the avidemux type datamosh within a range |
| Classic2 | similar to classic mode, but more precise results (uses frame numbers) |
| Combine | combine multiple videos and mosh them together |
| Rise | gives you the ffglitch datamosh by manually removing a range of i frames |
| Shuffle | randomly shuffles chunks of frames and then moshes them with the normal ffglitch datamosh |
@@ -111,8 +112,8 @@ All the other required component licenses (mostly MIT) are provided in their fol
<br>
## DATAMOSH MADE EASY!
### Current Py Version: 2.2
### Current Win Version: 2.6
### Current Py Version: 2.3
### Current Win Version: 2.7
![footer](https://capsule-render.vercel.app/api?type=rect&color=timeGradient&height=2)
![footer](https://capsule-render.vercel.app/api?type=rect&color=timeGradient&height=2)