Compare commits
No commits in common. "eea27c5f8c64d1403e85b3bde38bd3017d6d526b" and "7368316f8d4b9a4fbe8725cd8f5ad031db2b3d5b" have entirely different histories.
eea27c5f8c
...
7368316f8d
2 changed files with 2 additions and 83 deletions
|
|
@ -142,10 +142,7 @@ class Sync(Thread):
|
||||||
|
|
||||||
def adjust_position(self):
|
def adjust_position(self):
|
||||||
if self.mpv.time_pos is not None:
|
if self.mpv.time_pos is not None:
|
||||||
try:
|
|
||||||
deviation = self.main.time_pos - self.mpv.time_pos
|
deviation = self.main.time_pos - self.mpv.time_pos
|
||||||
except:
|
|
||||||
return
|
|
||||||
self.deviations.append(deviation)
|
self.deviations.append(deviation)
|
||||||
median_deviation = self.median(list(self.deviations))
|
median_deviation = self.median(list(self.deviations))
|
||||||
frames = deviation / 0.04
|
frames = deviation / 0.04
|
||||||
|
|
@ -166,7 +163,7 @@ class Sync(Thread):
|
||||||
if self.main.playlist_current_pos != self.mpv.playlist_current_pos:
|
if self.main.playlist_current_pos != self.mpv.playlist_current_pos:
|
||||||
self.mpv.playlist_play_index(self.main.playlist_current_pos)
|
self.mpv.playlist_play_index(self.main.playlist_current_pos)
|
||||||
self.mpv.pause = False
|
self.mpv.pause = False
|
||||||
self.mpv.wait_until_playing()
|
time.sleep(0.1)
|
||||||
self.mpv.pause = True
|
self.mpv.pause = True
|
||||||
pos = self.main.time_pos + SYNC_JUMP_AHEAD
|
pos = self.main.time_pos + SYNC_JUMP_AHEAD
|
||||||
#print(pos, self.mpv.playlist_current_pos, self.mpv.time_pos)
|
#print(pos, self.mpv.playlist_current_pos, self.mpv.time_pos)
|
||||||
|
|
|
||||||
78
sax.py
78
sax.py
|
|
@ -1,78 +0,0 @@
|
||||||
#!/usr/bin/python3
|
|
||||||
import os
|
|
||||||
from render_kdenlive import KDEnliveProject, _CACHE
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
def generate_sax_mix(root):
|
|
||||||
os.chdir(root)
|
|
||||||
|
|
||||||
|
|
||||||
root = os.path.abspath(".")
|
|
||||||
project = KDEnliveProject(root)
|
|
||||||
|
|
||||||
long_wav = "Soon_Kim_Long_Reverb_Only2.wav"
|
|
||||||
nois_wav = "Soon_Kim_Noise.wav"
|
|
||||||
reverb_wav = "Soon_Kim_Short_Reverb_Mix2.wav"
|
|
||||||
|
|
||||||
|
|
||||||
long = {
|
|
||||||
"src": long_wav,
|
|
||||||
"duration": 3600.0,
|
|
||||||
"filter": {
|
|
||||||
"volume": "-3"
|
|
||||||
},
|
|
||||||
}
|
|
||||||
noise = {
|
|
||||||
"src": nois_wav,
|
|
||||||
"duration": 3600.0,
|
|
||||||
"filter": {
|
|
||||||
"volume": "-1"
|
|
||||||
},
|
|
||||||
}
|
|
||||||
project.append_clip('A1', long)
|
|
||||||
project.append_clip('A2', noise)
|
|
||||||
path = os.path.join(root, "sax-mix.kdenlive")
|
|
||||||
with open(path, 'w') as fd:
|
|
||||||
fd.write(project.to_xml())
|
|
||||||
|
|
||||||
cmds = []
|
|
||||||
cmds.append([
|
|
||||||
"melt", "sax-mix.kdenlive", '-quiet', '-consumer', 'avformat:sax-mix.wav'
|
|
||||||
])
|
|
||||||
cmds.append([
|
|
||||||
"ffmpeg", "-y",
|
|
||||||
"-nostats", "-loglevel", "error",
|
|
||||||
"-f", "lavfi", "-i", "anullsrc=r=48000:cl=mono", "-t", "3600", "silence.wav"
|
|
||||||
])
|
|
||||||
|
|
||||||
for src, out1, out2 in (
|
|
||||||
(reverb_wav, "fl.wav", "fr.wav"),
|
|
||||||
("sax-mix.wav", "bl.wav", "br.wav"),
|
|
||||||
):
|
|
||||||
cmds.append([
|
|
||||||
"ffmpeg", "-y",
|
|
||||||
"-nostats", "-loglevel", "error",
|
|
||||||
"-i", src,
|
|
||||||
"-filter_complex",
|
|
||||||
"[0:0]pan=1|c0=c0[left]; [0:0]pan=1|c0=c1[right]",
|
|
||||||
"-map", "[left]", out1,
|
|
||||||
"-map", "[right]", out2,
|
|
||||||
])
|
|
||||||
|
|
||||||
cmds.append([
|
|
||||||
"ffmpeg", "-y",
|
|
||||||
"-nostats", "-loglevel", "error",
|
|
||||||
"-i", "fl.wav",
|
|
||||||
"-i", "fr.wav",
|
|
||||||
"-i", "silence.wav",
|
|
||||||
"-i", "silence.wav",
|
|
||||||
"-i", "bl.wav",
|
|
||||||
"-i", "br.wav",
|
|
||||||
"-filter_complex", "[0:a][1:a][2:a][3:a][4:a][5:a]amerge=inputs=6[a]",
|
|
||||||
"-map", "[a]",
|
|
||||||
"-ar", "48000",
|
|
||||||
"-c:a", "aac", "Saxophone-5.1.mp4"
|
|
||||||
])
|
|
||||||
for cmd in cmds:
|
|
||||||
print(" ".join([str(x) for x in cmd]))
|
|
||||||
subprocess.call(cmd)
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue