RTMP stream framerate continually drops
RTMP stream framerate continually drops
I have been trying to stream online through ffmpeg but I am having this problem. The frame rate drops from 30 down to 11 within 1-2 minutes. The audio is fine and does not skip at any time. I can use the exact same settings, with output set to save in .mp4 to the hard drive, and it works perfect.
c:\ffmpeg\bin>ffmpeg -re -rtbufsize 100000k -i "f:\xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
-pix_fmt yuv420p -s hd720 -vcodec libx264 -preset medium -b:v 2400k -maxrate 240
0k -bufsize 600k -acodec libmp3lame -ac 2 -b:a 128k -ar 44100 -f flv "rtmp://liv
e-dfw.justin.tv/app/xxxxxxxxxxxxxxxxxxxxx flashver=FME/2.5 (compatible; FMSc 1.0
)"
I have already tried removing the -re and setting the output to -r 30. I also tried setting -g 300 and -keyint_min 30 to see if Iframes would somehow fix it. No errors or frame drops are shown.
Somehow only the video encoding is getting messed up when it is set for -f flv output. This happens for both dshow desktop capture input and file input. My cpu is an Intel 3770K at 4.4GHz and can easily handle the load. Internet upload is 3Mb so the bitrate is well within this.
Thanks for reading. Hopefully someone here knows how to fix this because I am stumped. No idea why it will save to the hard drive just fine but not stream when its well within the cable bandwidth.
c:\ffmpeg\bin>ffmpeg -re -rtbufsize 100000k -i "f:\xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
-pix_fmt yuv420p -s hd720 -vcodec libx264 -preset medium -b:v 2400k -maxrate 240
0k -bufsize 600k -acodec libmp3lame -ac 2 -b:a 128k -ar 44100 -f flv "rtmp://liv
e-dfw.justin.tv/app/xxxxxxxxxxxxxxxxxxxxx flashver=FME/2.5 (compatible; FMSc 1.0
)"
I have already tried removing the -re and setting the output to -r 30. I also tried setting -g 300 and -keyint_min 30 to see if Iframes would somehow fix it. No errors or frame drops are shown.
Somehow only the video encoding is getting messed up when it is set for -f flv output. This happens for both dshow desktop capture input and file input. My cpu is an Intel 3770K at 4.4GHz and can easily handle the load. Internet upload is 3Mb so the bitrate is well within this.
Thanks for reading. Hopefully someone here knows how to fix this because I am stumped. No idea why it will save to the hard drive just fine but not stream when its well within the cable bandwidth.
-
- Posts: 1872
- Joined: Fri Aug 05, 2011 9:56 pm
Re: RTMP stream framerate continually drops
what's your complete uncut console output?
-r
-r
Re: RTMP stream framerate continually drops
I just did a 2 minute run with -report on. Attaching the report file because its quite a bit of text.
I forgot to mention my ram usage is around 1 GB higher when attempting to stream than when it records to the hard drive.
I forgot to mention my ram usage is around 1 GB higher when attempting to stream than when it records to the hard drive.
- Attachments
-
- ffmpeg-report out.rar
- (49.15 KiB) Downloaded 253 times
-
- Posts: 1872
- Joined: Fri Aug 05, 2011 9:56 pm
Re: RTMP stream framerate continually drops
It does appear to be getting slower over time. What if you stream it to rtmp located at "localhost"? Regardless, I'd query the ffmpeg-user group and see if they have any ideas...
Re: RTMP stream framerate continually drops
I'll have to figure out how to do the localhost and try it out. I've only been messing around with ffmpeg for a few days and learning as I go. Thanks for taking a look at it and for the suggestion.
-
- Posts: 1872
- Joined: Fri Aug 05, 2011 9:56 pm
Re: RTMP stream framerate continually drops
also you may want to try an older build of ffmpeg until the pthreads issue gets resolved:
http://betterlogic.com/roger/2012/08/ff ... rk-around/
http://betterlogic.com/roger/2012/08/ff ... rk-around/
Re: RTMP stream framerate continually drops
I just downloaded a 64 bit version to see if it would make a difference. The same thing happens but it keeps taking more and more ram until all (8 GB) is used. I'm thinking this is a buffering problem.
Is there some way to force the output? I'm guessing frames just keep piling up in the buffer waiting for something that never comes, or not very often at least, to send them out.
Is there some way to force the output? I'm guessing frames just keep piling up in the buffer waiting for something that never comes, or not very often at least, to send them out.
-
- Posts: 1872
- Joined: Fri Aug 05, 2011 9:56 pm
Re: RTMP stream framerate continually drops
yeah I'd repost your question to the ffmpeg-user group (or maybe the librtmp group?)
http://lists.mplayerhq.hu/pipermail/rtm ... 01803.html was turned up via a google search, so I wonder if the problem is reproducible in linux...
http://lists.mplayerhq.hu/pipermail/rtm ... 01803.html was turned up via a google search, so I wonder if the problem is reproducible in linux...
Re: RTMP stream framerate continually drops
The ffmpeg irc and I did some troubleshooting of this last night.
It works with the output at -f flv udp and with -f flv - > NUL. It only does not work for rtmp so we are thinking its a problem with the librtmp.
It works with the output at -f flv udp and with -f flv - > NUL. It only does not work for rtmp so we are thinking its a problem with the librtmp.
-
- Posts: 9
- Joined: Mon Aug 06, 2012 1:20 pm
Re: RTMP stream framerate continually drops
ive got the same issue.
is there any build that dont have this problem?
is there any build that dont have this problem?