[FFmpeg-user] How to stream just audio with ffmpeg

Yan Brenman ybrenman at xopnetworks.com
Sat Jul 12 20:12:17 CEST 2014


Hello,

I am trying to stream just audio with ffmpeg from a PC with built in 
microphone and play on the other PC with ffplay.
The name of a microphone device I get with "ffmpeg -list_devices true -f 
dshow -i dummy" command.

The command on the streaming side looks like this:

ffmpeg -f dshow -i audio="Internal Microphone Array (IDT High Definition 
Audio CODEC)" -vn -c:a mp3 -q:a 9 -ar 11025 -ac 1 -f flv 
rtmp://[RTMP_server_name]/live/[file_name]

And as you can see I am explicitly disabling the video component from 
being included by default with "-vn" switch.
The streaming side seems to be working fine (with no warnings or errors) 
but unfortunately when I try to play the audio stream with ffplay it 
still tries to find the video stream
and bails out with "RTMP_ReadPacket, failed to read RTMP packet header" 
error and then complaining the codec parameters for the video stream 
can't be found.

Seems to me that the root of the problem is the fact that ffplay is 
still looking for video in stream 0, while in fact stream 0 is an audio 
(and no video of course at all). I tried to run
ffplay with "-nodisp" option but it didn't help either:

ffplay -nodisp rtmp://[RTMP_server_name]/live/[file_name].

Is there something wrong I am doing on the streaming side or is there 
something else I need to specify on the playing side?

Every piece of advise is greatly appreciated
Yan




More information about the ffmpeg-user mailing list