Stream MP4 video successfully to RTMP with FFMPEG

Fight Fire With Fire picture Fight Fire With Fire · Nov 24, 2015 · Viewed 18.6k times · Source

I'm attempted to stream an already recorded video file to twitch servers using FFMPEG but I only get audio so far no video. I've tried several settings, and different files (avi,etc) but I still get audio only. Here is my FFMPEG settings:

 ffmpeg -re -i test.mp4  -vcodec libx264 -preset fast -crf 30 -acodec aac -ab 128k -ar 44100 -strict experimental -f flv rtmp://live-dfw.twitch.tv/app/"TWITCHKEY"

Has anyone nailed this? I'm using ffmpeg 0.8.17-6:0.8.17-1 under Ubuntu.

Answer

szatmary picture szatmary · Nov 24, 2015
ffmpeg -re -i ~/INPUT_FILE -vcodec libx264 -profile:v main -preset:v medium -r 30 -g 60 -keyint_min 60 -sc_threshold 0 -b:v 2500k -maxrate 2500k -bufsize 2500k -filter:v scale="trunc(oha/2)2:720" -sws_flags lanczos+accurate_rnd -acodec libfdk_aac -b:a 96k -ar 48000 -ac 2 -f flv rtmp://live.twitch.tv/app/STREAM_KEY

But please read the Twitch Rules of conduct before you post that Charle Sheen video.