Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_subsampling(self):
self.assertEqual('444', vsutil.get_subsampling(self.YUV444P8_CLIP))
self.assertEqual('440', vsutil.get_subsampling(self.YUV440P8_CLIP))
self.assertEqual('420', vsutil.get_subsampling(self.YUV420P8_CLIP))
self.assertEqual('422', vsutil.get_subsampling(self.YUV422P8_CLIP))
self.assertEqual('411', vsutil.get_subsampling(self.YUV411P8_CLIP))
self.assertEqual('410', vsutil.get_subsampling(self.YUV410P8_CLIP))
self.assertEqual(None, vsutil.get_subsampling(self.RGB24_CLIP))
# let’s create a custom format with higher subsampling than any of the legal ones to test that branch as well:
with self.assertRaisesRegex(ValueError, 'Unknown subsampling.'):
vsutil.get_subsampling(
vs.core.std.BlankClip(_format=self.YUV444P8_CLIP.format.replace(subsampling_w=4))
)
#!/usr/bin/env python3
import vapoursynth as vs
import audiocutter
from subprocess import call
core = vs.core
ts_in = r"../Fate Grand Order -First Order-/BDROM/BDMV/STREAM/00010.m2ts"
src = core.lsmas.LWLibavSource(ts_in)
ac = audiocutter.AudioCutter()
vid = ac.split(src, [(24,383)])
ac.ready_qp_and_chapters(vid)
vid.set_output(0)
if __name__ == "__main__":
ac.cut_audio(r'CMs/KnK_CM2_cut.flac', audio_source=r'../Fate Grand Order -First Order-/BDROM/BDMV/STREAM/00009.flac')
#!/usr/bin/env python3
import vapoursynth as vs
import audiocutter
from subprocess import call
core = vs.core
ts_in = r"../Fate Grand Order -First Order-/BDROM/BDMV/STREAM/00003.m2ts"
src = core.lsmas.LWLibavSource(ts_in)
ac = audiocutter.AudioCutter()
vid = ac.split(src, [(24,383)])
ac.ready_qp_and_chapters(vid)
vid.set_output(0)
if __name__ == "__main__":
ac.cut_audio(r'CMs/FGO_CM2_cut.flac', audio_source=r'../Fate Grand Order -First Order-/BDROM/BDMV/STREAM/00003.flac')
#!/usr/bin/env python3
import vapoursynth as vs
import audiocutter
from subprocess import call
import shutil
import os
core = vs.core
ts_in = r'[BDMV]冴えない彼女の育てかた♭Vol.01~Vol.06/[BDMV]冴えない彼女の育てかた♭ VOL.03/BDMV/STREAM/00002.m2ts'
src = core.lsmas.LWLibavSource(ts_in)
ac = audiocutter.AudioCutter()
vid = ac.split(src, [(0,32847)])
ac.ready_qp_and_chapters(vid)
vid.set_output(0)
if __name__ == "__main__":
ac.cut_audio('ac_SaeKano2BD_05.m4a', audio_source='[BDMV]冴えない彼女の育てかた♭Vol.01~Vol.06/[BDMV]冴えない彼女の育てかた♭ VOL.03/BDMV/STREAM/00002.flac')
#!/usr/bin/env python3
import vapoursynth as vs
import audiocutter
from subprocess import call
import shutil
import os
core = vs.core
ts_in = r"[BDMV][Katekyou Hitman REBORN!]\[家庭教師ヒットマンREBORN!][2006][TV][BDMV][Blu-ray BOX 2][JP][20170517]\REBORN2_DISC9\BDMV\STREAM\00009.m2ts"
src = core.lsmas.LWLibavSource(ts_in)
ac = audiocutter.AudioCutter()
vid = ac.split(src, [(15,2697)])
ac.ready_qp_and_chapters(vid)
vid.set_output(0)
if __name__ == "__main__":
ac.cut_audio('ED11_cut.m4a', audio_source=r'[BDMV][Katekyou Hitman REBORN!]\[家庭教師ヒットマンREBORN!][2006][TV][BDMV][Blu-ray BOX 2][JP][20170517]\REBORN2_DISC9\BDMV\STREAM\00009_Track01.m4a')
#!/usr/bin/env python3
import vapoursynth as vs
import audiocutter
from subprocess import call
import os
endcard = 16662
part_b = 16902
epend = 20952
core = vs.core
ts_in = r"10/Mysteria Friends E10 [1080p][E-AC3][JapDub][GerSub][Web-DL].mkv"
src = core.lsmas.LWLibavSource(ts_in)
ac = audiocutter.AudioCutter()
vid = ac.split(src, [(0,endcard+48),(part_b,epend),(endcard,part_b)])
ac.ready_qp_and_chapters(vid)
vid.set_output(0)
if __name__ == "__main__":
ac.cut_audio('10/10_cut.mka', audio_source='10/Mysteria Friends E10 [1080p][E-AC3][JapDub][GerSub][Web-DL].mka')
os.remove("tmp-001.mka")
os.remove("tmp-002.mka")
os.remove("tmp-003.mka")
#!/usr/bin/env python3
import vapoursynth as vs
import audiocutter
import lvsfunc as lvf
from subprocess import call
core = vs.core
ts_in = r"src/06/Senki Zesshou Symphogear XV - 06 (BS11).d2v"
src = lvf.src(ts_in)
if ts_in.endswith(".d2v"):
src = core.vivtc.VDecimate(src)
ac = audiocutter.AudioCutter()
vid = ac.split(src, [(682, 4806),(6485, 20773), (22212, 37845)])
ac.ready_qp_and_chapters(vid)
vid.set_output(0)
if __name__ == "__main__":
ac.cut_audio(r'ac_Sympho5_06.aac', audio_source=r'src/06/Senki Zesshou Symphogear XV - 06 (BS11) T141 stereo 226 kbps DELAY -373 ms.aac')
#!/usr/bin/env python3
import vapoursynth as vs
import audiocutter
from subprocess import call
import shutil
import os
preview_b = 16688
endcard_b = 16808
part_b_b = 16928
epend_b = 19995
core = vs.core
ts_in = r"03/[DragsterPS] Manariafurenzu Ekusutorapaato Zuke S01E03 [1080p] [Japanese Audio] [E13CFD37].mkv"
src = core.lsmas.LWLibavSource(ts_in)
ac = audiocutter.AudioCutter()
vid = ac.split(src, [(50,preview_b-1),(endcard_b,endcard_b+48),(part_b_b,epend_b),(preview_b,part_b_b)])
ac.ready_qp_and_chapters(vid)
vid.set_output(0)
if __name__ == "__main__":
ac.cut_audio('03_cut.aac', audio_source='03/track1_jpn.aac')
os.remove("tmp-001.mka")
os.remove("tmp-002.mka")
os.remove("tmp-003.mka")
#!/usr/bin/env python3
import vapoursynth as vs
import audiocutter
import lvsfunc as lvf
from subprocess import call
core = vs.core
ts_in = r'BDMV/[BDMV][190424][Tate no Yuusha no Nariagari][Vol.1]/TATE_1_1/BDMV/STREAM/00010.m2ts'
src = lvf.src(ts_in)
ac = audiocutter.AudioCutter()
vid = ac.split(src, [(0,34044)])
ac.ready_qp_and_chapters(vid)
vid.set_output(0)
if __name__ == "__main__":
ac.cut_audio(r'ShieldbroBD_02_cut.m4a', audio_source=r'BDMV/[BDMV][190424][Tate no Yuusha no Nariagari][Vol.1]/TATE_1_1/BDMV/STREAM/00010.m4a')
#!/usr/bin/env python3
import vapoursynth as vs
import audiocutter
from subprocess import call
import shutil
import os
core = vs.core
ts_in = r"ac.mkv"
src = core.lsmas.LWLibavSource(ts_in)
ac = audiocutter.AudioCutter()
vid = ac.split(src, [(24,2181)])
ac.ready_qp_and_chapters(vid)
vid.set_output(0)
if __name__ == "__main__":
ac.cut_audio('ED1_cut.m4a', audio_source=r'00017_Track01.m4a')