Ok so this are results:
1. I starter nginx and OBS, I run: "ffmpeg -i rtmp://localhost/live1/test1 -c:v libx264 -preset veryfast -vsync cfr -pix_fmt yuv420p -g 120 -s:v 1280x720 -b:v 3500k -minrate 3500k -maxrate 3500k -bufsize 3500k -c:a copy -f flv out.flv
and file looks ok, ffmpeg "cmd" is showing ~60fps and q=~30, bitrate ~3500
2. VLC might not be the best tool, I watched "live1" and it was laggy than VLC had error, without changing anything I run VLC again after few minutes and everyhing looks fine on live1... I run It again and it was again laggy, I decided to keep it open and run ffmpeg to file from live1. . The out.flv was ok.... So I decided to not use VLC anymore :p
3. I changed ffmpeg to send everything to rtmp not to the file "ffmpeg -i rtmp://localhost/live1/test1 -c:v libx264 -preset veryfast -vsync cfr -pix_fmt yuv420p -g 120 -s:v 1280x720 -b:v 3500k -minrate 3500k -maxrate 3500k -bufsize 3500k -c:a copy -f flv out.flv"
fps was ~45 and jumping, q= was jumping a lot, bitrate was ~2000 and it crashed o_O
I check it again and it crashed again.
So here is ffmpeg working when it is saving to file (ffmpeg -i rtmp://localhost/live1/test1 -c:v libx264 -preset veryfast -vsync cfr -pix_fmt yuv420p -g 120 -s:v 1280x720 -b:v 3500k -minrate 3500k -maxrate 3500k -bufsize 3500k -c:a copy -f flv out.flv)
ffmpeg streaming to rtmp (ffmpeg -i rtmp://localhost/live1/test1 -c:v libx264 -preset veryfast -vsync cfr -pix_fmt yuv420p -g 120 -s:v 1280x720 -b:v 3500k -minrate 3500k -maxrate 3500k -bufsize 3500k -c:a copy -f flv rtmp://Live-lhr.Twitch.TV/app/live_72207403_QXuRvFUGzanARowXk66ymIGNmoLeXB)
4. I decided to try obs > nginx > live1 >ffmpeg > live2 > nginx > Twitch
"ffmpeg -i rtmp://localhost/live1/test1 -c:v libx264 -preset veryfast -vsync cfr -pix_fmt yuv420p -g 120 -s:v 1280x720 -b:v 3500k -minrate 3500k -maxrate 3500k -bufsize 3500k -c:a copy -f flv rtmp://localhost/live2/test2"
"
#user nobody;
worker_processes 1;
error_log logs/error.log;
error_log logs/error.log notice;
error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
rtmp {
server {
listen 1935;
chunk_size 4096;
application live1 {
live on;
}
application live2 {
live on;
push rtmp://Live-lhr.Twitch.TV/app/KEY;
}
}
}"
Ffmpeg during stream:
Result on Twitch.tv:
http://www.twitch.tv/sstesttest/c/5222191 (hope it works, just wait few seconds, Twitch highlight tool sucks ;)
I checked it in VLC and it was not so bad like on Twitch but I saw some artifacts (even on live1). I checked it again and it was ok... (WTF VLC?!).
At the end I decided to just run another ffmpeg and save live1 and live2 to file. Both were OK!
5. Last test, simple "push" (live1) command and OBS stream in 3500kb/s
result (very bad):
http://www.twitch.tv/sstesttest/b/574159806
CONCLUSION
Everything saved by ffmpeg in file was ok, live1, live2 after ffmpeg transcoding etc. Something is wrong with sending to rtmp (in ffmpeg and also in nginx when Im "pushing" the stream).
Thx for help :)