How to pass start time option to PyAV

197 Views Asked by At

I am trying to read an audio file starting at a particular time in second. In FFMPEG you would put -ss x to do this.

In this project, I am using PyAv 10. Per the documentation the open function has options. But I can't find nowhere what options can be passed.

I assumed it's straight FFMPEG options but it does not seem to work.

So I am trying to figure out a) what options can be passed to PyAv.open function but more importantly, how to get the audio starting from a particulart point in time.

1

There are 1 best solutions below

0
Christoph Rackwitz On

You want to seek in the file.

That is not an option of open().

Examples can be found in the PyAV code base: https://github.com/PyAV-Org/PyAV/blob/main/tests/test_seek.py