spdl.io.demux_config¶
- demux_config(**kwargs) DemuxConfig [source]¶
Customize demuxing behavior.
- Parameters:
- Returns:
Config object.
Example: Loading headeless audio file (raw PCM)
>>> import asyncio >>> import spdl.io >>> >>> # Say, this file contains raw PCM samples. >>> # One way to generate such a file is, >>> # ffmpeg -f lavfi -i 'sine=duration=3' -f s16le -c:a pcm_s16le sample.raw >>> src = "sample.raw" >>> >>> # This won't work >>> # packets = asyncio.run(spdl.io.async_demux_media("audio", src)) >>> >>> # This works. >>> cfg = demux_config(format="s16le") >>> packets = asyncio.run(spdl.io.async_demux_audio(src, demux_config=cfg)) >>>