Skip to content
Permalink
Browse files

fix(ffmpeg): fix issue for start and durtion argument position

  • Loading branch information...
numb3r3 committed Aug 27, 2019
1 parent 1ea487f commit 0215c6bf08b09548f06834bd577b4efb725d99da
Showing with 11 additions and 2 deletions.
  1. +7 −0 gnes/preprocessor/io_utils/ffmpeg.py
  2. +4 −2 tests/test_ffmpeg_tools.py
@@ -92,8 +92,15 @@ def compile_args(input_fn: str = 'pipe:',
if fmt:
input_args += ['-f', fmt]

start_time = input_options.pop('ss', None)
duration = input_options.pop('t', None)

input_args += kwargs_to_cmd_args(input_options)
input_args += ['-i', input_fn]
if start_time is not None:
input_args += ['-ss', str(start_time)]
if duration is not None:
input_args += ['-t', str(duration)]

vf_args = []
if len(video_filters) > 0:
@@ -65,7 +65,9 @@ def test_capture_audio(self):
self.assertEqual(audio_data1.shape, audio_data2.shape)

def test_split_audio(self):
audio.split_audio(input_fn=self.video_path)
chunks1 = audio.split_audio(input_fn=self.video_path)
with open(self.video_path, 'rb') as f:
data = f.read()
audio.split_audio(input_data=data)
chunks2 = audio.split_audio(input_data=data)
self.assertEqual(len(chunks1), len(chunks2))
self.assertEqual(chunks1[0].shape, chunks2[0].shape)

0 comments on commit 0215c6b

Please sign in to comment.
You can’t perform that action at this time.