Issues In Python Based Ffmpeg Operation
I am trying to write a script that would automatically take duration values and chop an audio file into smaller splits. To do this I have saved all my start times and durations in
Solution 1:
Google Colab is running Jupyter notebook powered by IPython in its cloud, IPython uses special syntax for shell invocation (commands starting from ! exclamation mark), i.e. they are executed in (temporary) shell session. In case of Google Colab it's bash:
res = !echo$SHELLprint(res)
> ['/bin/bash']
As I checked, ffmpeg is indeed available on Google Colab:
res = !which ffmpeg
print(res)
> ['/usr/bin/ffmpeg']
, so you have legitimate error message printed by ffmpeg: "Invalid duration specification ... " (I mean not by shell or python) and it just means that variable you're passing is not substituted with its value the way you do. And it's so because this above mentioned special syntax is not followed for passing variable to the shell, check this; variables should be curly-braced to be passed:
!ffmpeg -iAudio.mp3 -ss {s} -t {e} -acodec copy {filename}
Post a Comment for "Issues In Python Based Ffmpeg Operation"