ffpyplayer icon indicating copy to clipboard operation
ffpyplayer copied to clipboard

'volume' argument in ff_opts not working

Open mak8kammerer opened this issue 2 years ago • 1 comments

Hello everyone! I am trying write a simple audio player using MediaPlayer class. Here is my code:

from ffpyplayer.player import MediaPlayer
player = MediaPlayer('audio.mp3', ff_opts={'volume': 0})
while True:
    pass

The sound is playing, but the volume is not 0! This command work perfectly: ffplay -af "volume=0.0" audio.mp3 Some additional info:

  • Python: 3.9.5
  • OS: Windows 10 Pro
  • Installation metod: pip
  • ffpyplayer version: 4.5.0

mak8kammerer avatar May 20 '23 08:05 mak8kammerer

The problem was solved by manual compilation on the computer. I downloaded the source code of the ffpyplayer, then downloaded the SDL2 and ffmpeg (from here; the archive name looked like this: ffmpeg-n6.0-latest-win64-gpl-shared-6.0.zip) binaries. Then I unpacked the archive and added the paths to them in the environment variables at the top of setup.py (FFMPEG_ROOT and SDL_ROOT).

In the SDL2 folder there is a lib folder with two folders x64 and x86. You need to transfer the contents of the folder with the architecture of your processor (for example: x64) to the lib folder.

Compilation is done with the command: python setup.py build_ext

mak8kammerer avatar May 24 '23 13:05 mak8kammerer