Started working with avconv to stream video & audio to RTMP server but am completely new to this and don't understand how this is put together.
I've been given this command, please could someone explain why there are multiple -f, -i parameters, for example? How much does the order of the parameters play a part?
avconv -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -i - -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental RTMP_URL
Thanks in advance.
Anything before
-iapplies to the next input, anything after applies to the output-reProcess in real time (read 1 second of media every second)-ar 44100The input audio rate is 44100 samples per second-ac 2The input audio is in stereo-acodec pcm_s16lethe input audio is encoded using signed 16 bit little endian vales per sample-f s16leThe input audios container is raw-ac 2The input audio is in stereo (You specifies this twice its only needed once)-i /dev/zeroRead a infinitely long stream of zeros to use as the raw audio source-f h264The input video source is raw h264 (annex b) stream-i -The input video should be read from stdin-vcodec copyCopy the video from input to output without transcoding-acodec aacTranscode the audio from whatever format it is in, to acc-ab 128kthe resulting audio should be encoded to 128kbps-g 50The video encoder should create a keyframe ever 50 frames. Note: this does nothing because you are using-vcodec copysince there is no video encoder in use-strict experimentalsome ffmpeg feature are experimental and should not be used. This will allow those features to be used. This can be set anywhere in the command.RTMP_URLThe format and location to send the result of the output.You probably also need to add
-f flvto the output for ramp to work correctly.