Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FFplay: WASAPI can't initialize audio client (FFmpeg 3.4 binaries)

Tags:

ffmpeg

I am trying to playback a stream that is multicasted over RTP using ffplay on Windows 7 64 bits. The computer that serves the audio over RTP runs:

ffmpeg -re -f dshow -audio_buffer_size 15 -ac 1 -i audio="Mic in at front Mic-in (Realtek" -ar 8k -acodec pcm_alaw -vn -f rtp rtp://127.0.0.1:5000

The client runs:

ffplay rtp://127.0.0.1:5000

While this was working correctly in release 3.3, release 3.4 fails with this error:

SDL_OpenAudio (1 channels, 8000 Hz): WASAPI can't initialize audio client: CoInitialize has not been called.

No more combinations to try, audio open failed
Failed to open file 'rtp://127.0.0.1:5000' or configure filtergraph

Anyone has an idea of whats going on ?

Thanks

UPDATE #1:

A workaround is to specify an alternate output driver. Set SDL_AUDIODRIVER environment variable value to the driver you want to use. Under windows 7, directsound and winmm both solved my issue.

like image 255
fve Avatar asked Oct 19 '17 17:10

fve


1 Answers

To solve the problem, it is better to set the SDL_AUDIODRIVER in user environment variables:

  1. Press Win+R to open Run. Type SystemPropertiesAdvanced and press OK button.
  2. Press the Environment Variables... button.

System Properties

  1. In User variables section, press the New... button.
  2. In front of "Variable name" type SDL_AUDIODRIVER. In front of "Variable value" type directsound or winmm.

New Variable

  1. Press OK buttons recursively.
  2. Reopen the terminal and run ffplay.
like image 145
Hamid Rouhani Avatar answered Nov 12 '22 05:11

Hamid Rouhani