Unity to FFMPEG

Description
Below is FMETP STREAM 3.0 feature, broadcasting GameViewEncoder, Mic/AudioEncoder to computer with ffmpeg, via ffplay.
It’s simple UDP stream with format MJPEG, PCM16.
There are some interesting use cases requested by customers.


Use case 1: FMETP STREAM -> FFMPEG Playback(ffplay)

// + ffplay Commands(Example):
// + Playback source: Unity GameViewEncoder(Output Format: MJPEG)
// + with FMNetworkManager(DataStream, Sender mode, port 3001)
ffplay "udp://127.0.0.1:3001"
// + experiments with more variables for better result
ffplay -i "udp://127.0.0.1:3001" -vcodec mjpeg -framerate 60 -max_delay 0 -loop 0 -fast -infbuf
 
// + Playback source: Unity MicEncoder(Output Format: PCM16, mono, sample rate 11025)
// + with FMNetworkManager(DataStream, Sender mode, port 3002)
ffplay -f s16le -ac 1 -ar 11025 "udp://127.0.0.1:3002"
// + experiments with more variables for better result
ffplay -i "udp://127.0.0.1:3002" -acodec pcm_s16le -f s16le -ac 1 -ar 11025 -max_delay 0 -loop 0 -fast -infbuf

Use case 2: FMETP STREAM -> FFMPEG -> Youtube Live Stream

// + ffmpeg to Youtube Commands(Example):
// + Playback source: Unity GameViewEncoder(Output Format: MJPEG)
// + with FMNetworkManager(DataStream, Sender mode, port 3001)
ffmpeg -re -f mjpeg -i "udp://127.0.0.1:3001" -f lavfi -i anullsrc -c:v libx264 -g 60 -c:a aac -ar 44100 -ac 2 -f flv "rtmp://a.rtmp.youtube.com/live2/<key>"